Skip to content

Commit 987256c

Browse files
committed
test: replace removed H256::from_low_u64_be usage
1 parent 63b2a35 commit 987256c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/src/spec/deploy_info_ordering.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,19 @@ threshold = 1
6666
"used_input_txs should not be empty"
6767
);
6868

69+
fn h256_from_low_u64_be(value: u64) -> H256 {
70+
let mut bytes = [0u8; 32];
71+
bytes[24..].copy_from_slice(&value.to_be_bytes());
72+
H256::from_slice(&bytes).expect("value should fit in H256")
73+
}
74+
6975
let sample_tx = used_input_txs.values().next().cloned().unwrap();
7076
let mut reordered_map = Map::new();
7177
let extra_keys = vec![
72-
H256::from_low_u64_be(3),
73-
H256::from_low_u64_be(1),
74-
H256::from_low_u64_be(4),
75-
H256::from_low_u64_be(2),
78+
h256_from_low_u64_be(3),
79+
h256_from_low_u64_be(1),
80+
h256_from_low_u64_be(4),
81+
h256_from_low_u64_be(2),
7682
];
7783
for key in &extra_keys {
7884
reordered_map.insert(format!("{:#x}", key), sample_tx.clone());

0 commit comments

Comments
 (0)