Skip to content

Commit

Permalink
Fix NonceManager for increment 0 and provided nonce (#3062, #3085).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jun 17, 2022
1 parent ac0165e commit 0a28679
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 0a28679

Please sign in to comment.