forked from cerc-io/laconicd-deprecated
rpc: decode raw transaction via RLP (#727)
* Decode raw transaction via RLP * add changelog * Apply suggestions from code review Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
882dd4e2e3
commit
fd36873261
@ -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.
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user