Follow-up from PR #740.
Code:
|
/// TODO(test): golden-test against viem's `serializeTransaction` with known |
|
/// EvmTransactionParams. Verify the output matches byte-for-byte — this is |
|
/// what gets hashed and signed, so any divergence breaks on-chain verification. |
|
fn encode_unsigned_eip1559(params: &CantonEvmTransactionParams) -> anyhow::Result<Vec<u8>> { |
|
// TODO(test): golden-test build_calldata against viem's encodeFunctionData for: |
|
// - ERC20 transfer/approve (static types) |
|
// - Uniswap exactInputSingle with tuple arg |
|
// - Functions with dynamic types (string, bytes, address[]) |
|
// - Empty-args view functions (totalSupply) |
|
// - Invalid signature rejection, invalid hex rejection |
Context: encode_unsigned_eip1559 produces the bytes that are hashed and signed for Canton bidirectional EVM transactions. Add golden tests against viem for full unsigned EIP-1559 serialization and for the calldata path used by contract calls.
Coverage to include:
serializeTransaction with known EvmTransactionParams, verified byte-for-byte
encodeFunctionData parity for ERC20 transfer/approve, tuple args, dynamic types, and empty-arg view functions
- invalid function signature rejection and invalid hex rejection
This absorbs #769 so the viem parity coverage is tracked in one issue.
Follow-up from PR #740.
Code:
mpc/chain-signatures/node/src/indexer_canton/mod.rs
Lines 98 to 101 in 93c8e00
mpc/chain-signatures/node/src/indexer_canton/calldata.rs
Lines 1 to 6 in 93c8e00
Context:
encode_unsigned_eip1559produces the bytes that are hashed and signed for Canton bidirectional EVM transactions. Add golden tests against viem for full unsigned EIP-1559 serialization and for the calldata path used by contract calls.Coverage to include:
serializeTransactionwith knownEvmTransactionParams, verified byte-for-byteencodeFunctionDataparity for ERC20 transfer/approve, tuple args, dynamic types, and empty-arg view functionsThis absorbs #769 so the viem parity coverage is tracked in one issue.