Skip to content

Commit 906ba37

Browse files
authored
test(anvil): add legacy tx recover test (foundry-rs#3334)
1 parent 2bce100 commit 906ba37

File tree

1 file changed

+11
-0
lines changed
  • anvil/core/src/eth/transaction

1 file changed

+11
-0
lines changed

anvil/core/src/eth/transaction/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -1341,4 +1341,15 @@ mod tests {
13411341
});
13421342
assert_eq!(expected, TypedTransaction::decode(bytes_fifth).unwrap());
13431343
}
1344+
1345+
// <https://github.com/gakonst/ethers-rs/issues/1732>
1346+
#[test]
1347+
fn test_recover_legacy_tx() {
1348+
let raw_tx = "f9015482078b8505d21dba0083022ef1947a250d5630b4cf539739df2c5dacb4c659f2488d880c46549a521b13d8b8e47ff36ab50000000000000000000000000000000000000000000066ab5a608bd00a23f2fe000000000000000000000000000000000000000000000000000000000000008000000000000000000000000048c04ed5691981c42154c6167398f95e8f38a7ff00000000000000000000000000000000000000000000000000000000632ceac70000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006c6ee5e31d828de241282b9606c8e98ea48526e225a0c9077369501641a92ef7399ff81c21639ed4fd8fc69cb793cfa1dbfab342e10aa0615facb2f1bcf3274a354cfe384a38d0cc008a11c2dd23a69111bc6930ba27a8";
1349+
1350+
let tx: TypedTransaction = rlp::decode(&hex::decode(raw_tx).unwrap()).unwrap();
1351+
let recovered = tx.recover().unwrap();
1352+
let expected: Address = "0xa12e1462d0ced572f396f58b6e2d03894cd7c8a4".parse().unwrap();
1353+
assert_eq!(expected, recovered);
1354+
}
13441355
}

0 commit comments

Comments
 (0)