Repository: onflow/fcl-js
Pull request #995 (2022-02-01 22:12:13)

PKG -- [transport-http] Removes signer_index from Envelope and Payload signatures
PKG -- [transport-http] Removes signer_index from Envelope and Payload signatures


Patch:
diff --git a/packages/transport-http/CHANGELOG.md b/packages/transport-http/CHANGELOG.md
index e69de29b..db73111f 100644
--- a/packages/transport-http/CHANGELOG.md
+++ b/packages/transport-http/CHANGELOG.md
@@ -0,0 +1,3 @@
+### 0.0.2 -- 2022-02-01
+
+- 2022-02-01 -- Removes signer_index field from envelope signature and payload signature.
diff --git a/packages/transport-http/package-lock.json b/packages/transport-http/package-lock.json
index 55bdd434..3ebfd316 100644
--- a/packages/transport-http/package-lock.json
+++ b/packages/transport-http/package-lock.json
@@ -1,12 +1,12 @@
 {
     "name": "@onflow/transport-http",
-    "version": "0.0.1",
+    "version": "0.0.2",
     "lockfileVersion": 2,
     "requires": true,
     "packages": {
         "": {
             "name": "@onflow/transport-http",
-            "version": "0.0.1",
+            "version": "0.0.2",
             "license": "Apache-2.0",
             "dependencies": {
                 "@onflow/util-address": "^0.0.0",
diff --git a/packages/transport-http/package.json b/packages/transport-http/package.json
index 4abae2af..e616772b 100644
--- a/packages/transport-http/package.json
+++ b/packages/transport-http/package.json
@@ -1,6 +1,6 @@
 {
     "name": "@onflow/transport-http",
-    "version": "0.0.1",
+    "version": "0.0.2",
     "description": "Flow SDK HTTP Transport Module",
     "license": "Apache-2.0",
     "author": "Dapper Labs <dev@dapperlabs.com>",
diff --git a/packages/transport-http/src/send-transaction.js b/packages/transport-http/src/send-transaction.js
index 931909dc..dad33cde 100644
--- a/packages/transport-http/src/send-transaction.js
+++ b/packages/transport-http/src/send-transaction.js
@@ -12,17 +12,14 @@ export async function sendTransaction(ix, context = {}, opts = {}) {
 
   // Apply Non Payer Signatures to Payload Signatures
   let payloadSignatures = []
-  var i = 0
   for (let acct of Object.values(ix.accounts)) {
     try {
       if (!acct.role.payer && acct.signature != null) {
         payloadSignatures.push({
           address: sansPrefix(acct.addr),
-          signer_index: String(i),
           key_index: String(acct.keyId),
           signature: Buffer.from(acct.signature, "hex").toString("base64")
         })
-        i = i + 1
       }
     } catch (error) {
       console.error("SDK HTTP Send Error: Trouble applying payload signature", {acct, ix})
@@ -32,18 +29,15 @@ export async function sendTransaction(ix, context = {}, opts = {}) {
 
   // Apply Payer Signatures to Envelope Signatures
   let envelopeSignatures = {}
-  var j = 0
   for (let acct of Object.values(ix.accounts)) {
     try {
       if (acct.role.payer && acct.signature != null) {
         let id = acct.tempId || `${acct.addr}-${acct.keyId}`
         envelopeSignatures[id] = envelopeSignatures[id] || {
           address: sansPrefix(acct.addr),
-          signer_index: String(j),
           key_index: String(acct.keyId),
           signature: Buffer.from(acct.signature, "hex").toString("base64")
         }
-        j = j + 1
       }
     } catch (error) {
       console.error("SDK HTTP Send Error: Trouble applying envelope signature", {acct, ix})


Test patch:
diff --git a/packages/transport-http/src/send-transaction.test.js b/packages/transport-http/src/send-transaction.test.js
index 2c6981fe..48e381c2 100644
--- a/packages/transport-http/src/send-transaction.test.js
+++ b/packages/transport-http/src/send-transaction.test.js
@@ -107,7 +107,6 @@ describe("Transaction", () => {
             "payload_signatures": [
                 {
                     "address": "f8d6e0586b0a20c7",
-                    "signer_index": "0",
                     "key_index": "1",
                     "signature": "q8Ej",
                 }
@@ -115,7 +114,6 @@ describe("Transaction", () => {
             "envelope_signatures": [
                 {
                     "address": "f8d6e0586b0a20c7",
-                    "signer_index": "0",
                     "key_index": "1",
                     "signature": "q8Ej"
                 }