Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NonceManager.incrementTransactionCount(0) bug #3062

Closed
olehmisar opened this issue Jun 7, 2022 · 1 comment
Closed

NonceManager.incrementTransactionCount(0) bug #3062

olehmisar opened this issue Jun 7, 2022 · 1 comment
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@olehmisar
Copy link

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

@olehmisar olehmisar added the investigate Under investigation and may be a bug. label Jun 7, 2022
@olehmisar olehmisar changed the title Bug Report Title NonceManager.incrementTransactionCount(0) bug Jun 7, 2022
@ricmoo ricmoo added the on-deck This Enhancement or Bug is currently being worked on. label Jun 8, 2022
@ricmoo
Copy link
Member

ricmoo commented Jun 18, 2022

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

Thanks! :)

@ricmoo ricmoo closed this as completed Jun 18, 2022
@ricmoo ricmoo added bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. and removed investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants