diff --git a/CHANGELOG.md b/CHANGELOG.md index aa1a0a2e45..5ab88f90e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (rpc) [tharsis#727](https://github.com/tharsis/ethermint/pull/727) Decode raw transaction using RLP. * (rpc) [tharsis#661](https://github.com/tharsis/ethermint/pull/661) Fix OOM bug when creating too many filters using JSON-RPC. * (evm) [tharsis#660](https://github.com/tharsis/ethermint/pull/660) Fix `nil` pointer panic in `ApplyNativeMessage`. * (evm, test) [tharsis#649](https://github.com/tharsis/ethermint/pull/649) Test DynamicFeeTx. diff --git a/rpc/ethereum/namespaces/eth/api.go b/rpc/ethereum/namespaces/eth/api.go index c19f9dc004..3d57a6129c 100644 --- a/rpc/ethereum/namespaces/eth/api.go +++ b/rpc/ethereum/namespaces/eth/api.go @@ -432,17 +432,16 @@ func (e *PublicAPI) SendRawTransaction(data hexutil.Bytes) (common.Hash, error) e.logger.Debug("eth_sendRawTransaction", "length", len(data)) // RLP decode raw transaction bytes - tx, err := e.clientCtx.TxConfig.TxDecoder()(data) - if err != nil { + tx := ðtypes.Transaction{} + if err := tx.UnmarshalBinary(data); err != nil { e.logger.Error("transaction decoding failed", "error", err.Error()) - return common.Hash{}, err } - ethereumTx, isEthTx := tx.(*evmtypes.MsgEthereumTx) - if !isEthTx { - e.logger.Debug("invalid transaction type", "type", fmt.Sprintf("%T", tx)) - return common.Hash{}, fmt.Errorf("invalid transaction type %T", tx) + ethereumTx := &evmtypes.MsgEthereumTx{} + if err := ethereumTx.FromEthereumTx(tx); err != nil { + e.logger.Error("transaction converting failed", "error", err.Error()) + return common.Hash{}, err } if err := ethereumTx.ValidateBasic(); err != nil {