Skip to content

NonceManager.incrementTransactionCount(0) bug #3062

Closed

Description

@olehmisar

Ethers Version

5.6.8

Search Terms

nonce manager, increment nonce

Describe the Problem

nonceManager.incrementTransactionCount(0) increments nonce by 1.

The bug is on this line https://github.com/ethers-io/ethers.js/blob/master/packages/experimental/src.ts/nonce-manager.ts#L49

It should be changed to:

this._deltaCount += (count ?? 1);

Code Snippet

import { NonceManager } from "@ethersproject/experimental"
import { VoidSigner } from "ethers"

;(async () => {
    const manager = new NonceManager(new VoidSigner(''))
    manager.setTransactionCount(10)
    console.log(await manager.getTransactionCount('pending')) // 10
    manager.incrementTransactionCount(0)
    console.log(await manager.getTransactionCount('pending')) // 11
})()

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

Activity

  1. changed the title [-]Bug Report Title[/-] [+]NonceManager.incrementTransactionCount(0) bug[/+] on Jun 7, 2022
  2. added
    on-deckThis Enhancement or Bug is currently being worked on.
    on Jun 8, 2022
  3. ricmoo commented on Jun 18, 2022

    @ricmoo
    Member

    This has been fixed in 5.6.9. Let me know if you still have any problems.

    Thanks! :)

  4. added
    bugVerified to be an issue.
    fixed/completeThis Bug is fixed or Enhancement is complete and published.
    and removed
    investigateUnder investigation and may be a bug.
    on-deckThis Enhancement or Bug is currently being worked on.
    on Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugVerified to be an issue.fixed/completeThis Bug is fixed or Enhancement is complete and published.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions