forked from cerc-io/laconicd-deprecated
Fix failed to call EstimateGas (#761)
* fix failed to call function EstimateGas * add ut to test estimateGas after contract deployed
This commit is contained in:
@@ -551,6 +551,8 @@ func (api *PublicEthereumAPI) doCall(
|
||||
addr = *args.From
|
||||
}
|
||||
|
||||
nonce, _ := api.accountNonce(api.clientCtx, addr, true)
|
||||
|
||||
// Set default gas & gas price if none were set
|
||||
// Change this to uint64(math.MaxUint64 / 2) if gas cap can be configured
|
||||
gas := uint64(ethermint.DefaultRPCGasLimit)
|
||||
@@ -588,7 +590,7 @@ func (api *PublicEthereumAPI) doCall(
|
||||
|
||||
var msgs []sdk.Msg
|
||||
// Create new call message
|
||||
msg := evmtypes.NewMsgEthermint(0, &toAddr, sdk.NewIntFromBigInt(value), gas,
|
||||
msg := evmtypes.NewMsgEthermint(nonce, &toAddr, sdk.NewIntFromBigInt(value), gas,
|
||||
sdk.NewIntFromBigInt(gasPrice), data, sdk.AccAddress(addr.Bytes()))
|
||||
msgs = append(msgs, msg)
|
||||
|
||||
@@ -1086,8 +1088,9 @@ func (api *PublicEthereumAPI) pendingMsgs() ([]sdk.Msg, error) {
|
||||
}
|
||||
|
||||
pendingData := pendingTx.Input
|
||||
nonce, _ := api.accountNonce(api.clientCtx, pendingTx.From, true)
|
||||
|
||||
msg := evmtypes.NewMsgEthermint(0, &pendingTo, sdk.NewIntFromBigInt(pendingValue), pendingGas,
|
||||
msg := evmtypes.NewMsgEthermint(nonce, &pendingTo, sdk.NewIntFromBigInt(pendingValue), pendingGas,
|
||||
sdk.NewIntFromBigInt(pendingGasPrice), pendingData, pendingFrom)
|
||||
|
||||
msgs = append(msgs, msg)
|
||||
|
||||
Reference in New Issue
Block a user