Skip to content

Commit adbc68c

Browse files
authored
fix: add alloy-rlp dependency to testing-utils (test_sign_eip_155) (#19807)
1 parent cac2443 commit adbc68c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testing/testing-utils/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ workspace = true
1414
[dependencies]
1515
reth-ethereum-primitives = { workspace = true, features = ["arbitrary", "std"] }
1616
reth-primitives-traits = { workspace = true, features = ["secp256k1", "arbitrary"] }
17-
1817
alloy-genesis.workspace = true
1918
alloy-primitives = { workspace = true, features = ["rand"] }
2019
alloy-consensus.workspace = true
@@ -23,3 +22,6 @@ alloy-eips.workspace = true
2322
rand.workspace = true
2423
secp256k1 = { workspace = true, features = ["rand"] }
2524
rand_08.workspace = true
25+
26+
[dev-dependencies]
27+
alloy-rlp.workspace = true

testing/testing-utils/src/generators.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -529,20 +529,19 @@ mod tests {
529529
#[test]
530530
fn test_sign_eip_155() {
531531
// reference: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#example
532-
let transaction = Transaction::Legacy(TxLegacy {
532+
let tx = TxLegacy {
533533
chain_id: Some(1),
534534
nonce: 9,
535535
gas_price: 20 * 10_u128.pow(9),
536536
gas_limit: 21000,
537537
to: TxKind::Call(hex!("3535353535353535353535353535353535353535").into()),
538538
value: U256::from(10_u128.pow(18)),
539539
input: Bytes::default(),
540-
});
540+
};
541+
let transaction = Transaction::Legacy(tx.clone());
541542

542-
// TODO resolve dependency issue
543-
// let expected =
544-
// hex!("ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080");
545-
// assert_eq!(expected, &alloy_rlp::encode(transaction));
543+
let expected = hex!("ec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018080");
544+
assert_eq!(expected.as_slice(), &alloy_rlp::encode(tx));
546545

547546
let hash = transaction.signature_hash();
548547
let expected =

0 commit comments

Comments
 (0)