foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Fix `eth_signTransaction` request and response

Open alisinabh opened this issue 9 months ago • 0 comments

Motivation

As per Ethereum JSON-RPC API Specification, the eth_signTransaction method should return an RLP encoded transaction payload. Anvil is just returning the signature.

Also the parameters of the transaction MUST be part of a sequence.

Solution

This PR returns the signed payload in eth_signTransaction request and also configures the deserializer to deserialize params using a sequence.

A happy path test was also added in tests/it/sign.rs (Was not sure if I should put the test there or in tests/it/transaction.rs)

Thank you!

alisinabh avatar Apr 28 '24 02:04 alisinabh