fix: add alloy-rlp dependency to testing-utils (test_sign_eip_155) (#19807)

This commit is contained in:
gustavo
2025-11-17 15:41:50 +00:00
committed by GitHub
parent cac2443dfc
commit adbc68c66c
3 changed files with 9 additions and 7 deletions

1
Cargo.lock generated
View File

@@ -10709,6 +10709,7 @@ dependencies = [
"alloy-eips",
"alloy-genesis",
"alloy-primitives",
"alloy-rlp",
"rand 0.8.5",
"rand 0.9.2",
"reth-ethereum-primitives",

View File

@@ -14,7 +14,6 @@ workspace = true
[dependencies]
reth-ethereum-primitives = { workspace = true, features = ["arbitrary", "std"] }
reth-primitives-traits = { workspace = true, features = ["secp256k1", "arbitrary"] }
alloy-genesis.workspace = true
alloy-primitives = { workspace = true, features = ["rand"] }
alloy-consensus.workspace = true
@@ -23,3 +22,6 @@ alloy-eips.workspace = true
rand.workspace = true
secp256k1 = { workspace = true, features = ["rand"] }
rand_08.workspace = true
[dev-dependencies]
alloy-rlp.workspace = true

View File

@@ -529,7 +529,7 @@ mod tests {
#[test]
fn test_sign_eip_155() {
// reference: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#example
let transaction = Transaction::Legacy(TxLegacy {
let tx = TxLegacy {
chain_id: Some(1),
nonce: 9,
gas_price: 20 * 10_u128.pow(9),
@@ -537,12 +537,11 @@ mod tests {
to: TxKind::Call(hex!("3535353535353535353535353535353535353535").into()),
value: U256::from(10_u128.pow(18)),
input: Bytes::default(),
});
};
let transaction = Transaction::Legacy(tx.clone());
// TODO resolve dependency issue
// let expected =
// hex!("ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080");
// assert_eq!(expected, &alloy_rlp::encode(transaction));
let expected = hex!("ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080");
assert_eq!(expected.as_slice(), &alloy_rlp::encode(tx));
let hash = transaction.signature_hash();
let expected =