You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I use web3 offline without a node connection. I have a problem with the signTransaction method (web3.eth.accounts.signTransaction). Nonce existence check in this method is not correct.
Expected behavior
Calling web3.eth.accounts.signTransaction with a nonce (even at 0) should return a signed transaction without trying to call the ethereum node.
Actual behavior
Calling web3.eth.accounts.signTransaction with a nonce at 0 will call the ethereum node to get the transactionCount
Steps to reproduce the behavior
1. Import `web3`
2. Try to sign a transaction like this:
Description
Hello,
I use web3 offline without a node connection. I have a problem with the signTransaction method (web3.eth.accounts.signTransaction). Nonce existence check in this method is not correct.
Expected behavior
Calling
web3.eth.accounts.signTransaction
with a nonce (even at 0) should return a signed transaction without trying to call the ethereum node.Actual behavior
Calling
web3.eth.accounts.signTransaction
with a nonce at 0 will call the ethereum node to get the transactionCountSteps to reproduce the behavior
{ jsonrpc: '2.0',
id: 1,
method: 'eth_getTransactionCount',
params: [ 'Address', 'latest' ] }
Versions
I think the problem is at this line: https://github.com/ethereum/web3.js/blob/1.0/packages/web3-eth-accounts/src/Accounts.js#L158
The if condition return false if nonce is set to 0.
The text was updated successfully, but these errors were encountered: