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
commit cc6a98fd33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

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);

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");