Skip to content

Commit

Permalink
Fix NonceManager for increment 0 and provided nonce (ethers-io#3062, e…
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent 55990f7 commit 9dbfb11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/experimental/src.ts/nonce-manager.ts
Expand Up @@ -46,7 +46,7 @@ export class NonceManager extends ethers.Signer {
}

incrementTransactionCount(count?: number): void {
this._deltaCount += (count ? count: 1);
this._deltaCount += ((count == null) ? 1: count);
}

signMessage(message: ethers.Bytes | string): Promise<string> {
Expand All @@ -64,6 +64,7 @@ export class NonceManager extends ethers.Signer {
this.incrementTransactionCount();
} else {
this.setTransactionCount(transaction.nonce);
this._deltaCount++;
}

return this.signer.sendTransaction(transaction).then((tx) => {
Expand Down

0 comments on commit 9dbfb11

Please sign in to comment.