diff --git a/CHANGELOG.md b/CHANGELOG.md index aa1a0a2e..5ab88f90 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 c19f9dc0..3d57a612 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 {