Bugfix: sequence number is 0 for first tx

This commit is contained in:
Simon Warta 2020-05-07 12:20:35 +02:00
parent c13b8c4351
commit 85e57bcab2
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");