Let makeSignBytes take account number and sequence as two args

This commit is contained in:
Simon Warta
2020-02-11 14:31:00 +01:00
parent b4b36c3a34
commit ae586cc012
13 changed files with 55 additions and 61 deletions
+11 -4
View File
@@ -40,8 +40,8 @@ async function uploadContract(client, pen, wasm) {
},
};
const account = (await client.authAccounts(faucetAddress)).result.value;
const signBytes = makeSignBytes([storeCodeMsg], defaultFee, networkId, memo, account);
const { account_number, sequence } = (await client.authAccounts(faucetAddress)).result.value;
const signBytes = makeSignBytes([storeCodeMsg], defaultFee, networkId, memo, account_number, sequence);
const signature = encodeSecp256k1Signature(pen.pubkey, await pen.createSignature(signBytes));
const signedTx = {
msg: [storeCodeMsg],
@@ -63,8 +63,15 @@ async function instantiateContract(client, pen, codeId, msg, transferAmount) {
init_funds: transferAmount || [],
},
};
const account = (await client.authAccounts(faucetAddress)).result.value;
const signBytes = makeSignBytes([instantiateContractMsg], defaultFee, networkId, memo, account);
const { account_number, sequence } = (await client.authAccounts(faucetAddress)).result.value;
const signBytes = makeSignBytes(
[instantiateContractMsg],
defaultFee,
networkId,
memo,
account_number,
sequence,
);
const signature = encodeSecp256k1Signature(pen.pubkey, await pen.createSignature(signBytes));
const signedTx = {
msg: [instantiateContractMsg],