diff --git a/pkg/eth/api.go b/pkg/eth/api.go index 3c4fd6ec..3d5129fa 100644 --- a/pkg/eth/api.go +++ b/pkg/eth/api.go @@ -467,7 +467,7 @@ func (pea *PublicEthAPI) GetRawTransactionByHash(ctx context.Context, hash commo // Retrieve a finalized transaction, or a pooled otherwise tx, _, _, _, err := pea.B.GetTransaction(ctx, hash) if tx != nil && err == nil { - return rlp.EncodeToBytes(tx) + return tx.MarshalBinary() } if pea.config.ProxyOnError { var tx hexutil.Bytes diff --git a/pkg/eth/backend_utils.go b/pkg/eth/backend_utils.go index 789faa22..6965b6dd 100644 --- a/pkg/eth/backend_utils.go +++ b/pkg/eth/backend_utils.go @@ -275,7 +275,7 @@ func newRPCRawTransactionFromBlockIndex(b *types.Block, index uint64) hexutil.By if index >= uint64(len(txs)) { return nil } - blob, _ := rlp.EncodeToBytes(txs[index]) + blob, _ := txs[index].MarshalBinary() return blob }