Merge pull request #165 from CosmWasm/sequence-number-0

Bugfix: sequence number is 0 for first tx
This commit is contained in:
Simon Warta
2020-05-07 21:27:03 +02:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -495,7 +495,7 @@ export class CosmWasmConnection implements BlockchainConnection {
accountNumber,
currentSequence,
);
if (!sequenceForTx) throw new Error("Cound not find matching sequence for this transaction");
if (sequenceForTx === undefined) throw new Error("Cound not find matching sequence for this transaction");
const nonce = accountToNonce(accountNumber, sequenceForTx);
+1 -1
View File
@@ -20,7 +20,7 @@ export async function findSequenceForSignedTx(
chainId: string,
accountNumber: number,
upperBound: number,
min = 1,
min = 0,
): Promise<number | undefined> {
const firstSignature = tx.value.signatures.find(() => true);
if (!firstSignature) throw new Error("Signature missing in tx");