Avoid unnecessary conversion to bytes in postTx

In Cosmos world, transactions are posted as JSON. Move the byte
representation into BCP.
This commit is contained in:
Simon Warta
2020-02-21 13:57:01 +01:00
parent 8f1f8d93be
commit 00801b2831
10 changed files with 30 additions and 33 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ const instantiateContract = async (initClient: RestClient, initPen: Secp256k1Pen
memo: memo,
signatures: [signature],
};
const result = await initClient.postTx(marshalTx(signedTx));
const result = await initClient.postTx(signedTx);
if (result.code) {
throw new Error(`Failed tx: (${result.code}): ${result.raw_log}`)
}
@@ -78,7 +78,7 @@ const executeContract = async (execClient: RestClient, execPen: Secp256k1Pen, co
memo: memo,
signatures: [signature],
};
const result = await execClient.postTx(marshalTx(signedTx));
const result = await execClient.postTx(signedTx);
if (result.code) {
throw new Error(`Failed tx: (${result.code}): ${result.raw_log}`)
}