rpc: fix default nonce (#152)

fixes #151
This commit is contained in:
yihuang 2021-06-21 16:02:05 +08:00 committed by GitHub
parent eee53a9500
commit a3ee8a4622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -972,7 +972,7 @@ func (e *PublicEthAPI) setTxDefaults(args rpctypes.SendTxArgs) (rpctypes.SendTxA
args.GasPrice = (*hexutil.Big)(big.NewInt(ethermint.DefaultGasPrice))
}
if args.Nonce != nil {
if args.Nonce == nil {
// get the nonce from the account retriever
// ignore error in case tge account doesn't exist yet
_, nonce, _ := e.clientCtx.AccountRetriever.GetAccountNumberSequence(e.clientCtx, from)