rpc: fix nil pointer exception when parameters are nil (#180)

* fix nil pointer exception when parameters are nil

* Update ethereum/rpc/types/types.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Thomas Nguy
2021-06-24 03:57:51 -04:00
committed by GitHub
co-authored by Federico Kunze
parent 1c06553746
commit b7f00d5a07
2 changed files with 54 additions and 8 deletions
+2 -2
View File
@@ -347,7 +347,7 @@ func (e *PublicAPI) Sign(address common.Address, data hexutil.Bytes) (hexutil.By
// SendTransaction sends an Ethereum transaction.
func (e *PublicAPI) SendTransaction(args rpctypes.SendTxArgs) (common.Hash, error) {
e.logger.Debugln("eth_sendTransaction", "args", args)
e.logger.Debugln("eth_sendTransaction", "args", args.String())
// Look up the wallet containing the requested signer
_, err := e.clientCtx.Keyring.KeyByAddress(sdk.AccAddress(args.From.Bytes()))
@@ -493,7 +493,7 @@ func (e *PublicAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error)
// Call performs a raw contract call.
func (e *PublicAPI) Call(args rpctypes.CallArgs, blockNr rpctypes.BlockNumber, _ *rpctypes.StateOverride) (hexutil.Bytes, error) {
e.logger.Debugln("eth_call", "args", args, "block number", blockNr)
e.logger.Debugln("eth_call", "args", args.String(), "block number", blockNr)
simRes, err := e.doCall(args, blockNr, big.NewInt(ethermint.DefaultRPCGasLimit))
if err != nil {
return []byte{}, err