Skip to content

Commit 1a3b495

Browse files
committed
test(core): share MAINNET_BLOCK_1_HEX between block hash display tests
Reuses the constant introduced for the Block::check tests, removing the duplicated inline hex from test_block_hash_display and test_block_hash_ref_display.
1 parent b74cebd commit 1a3b495

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

src/core/block.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,19 +2326,7 @@ mod tests {
23262326

23272327
#[test]
23282328
fn test_block_hash_display() {
2329-
let block = Block::new(
2330-
hex::decode(
2331-
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000982051fd\
2332-
1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e36299\
2333-
0101000000010000000000000000000000000000000000000000000000000000000000000000ffff\
2334-
ffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1\
2335-
1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf62\
2336-
1e73a82cbf2342c858eeac00000000",
2337-
)
2338-
.unwrap()
2339-
.as_slice(),
2340-
)
2341-
.unwrap();
2329+
let block = Block::new(hex::decode(MAINNET_BLOCK_1_HEX).unwrap().as_slice()).unwrap();
23422330

23432331
let block_hash = block.hash().to_owned();
23442332

@@ -2350,19 +2338,7 @@ mod tests {
23502338

23512339
#[test]
23522340
fn test_block_hash_ref_display() {
2353-
let block = Block::new(
2354-
hex::decode(
2355-
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000982051fd\
2356-
1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e36299\
2357-
0101000000010000000000000000000000000000000000000000000000000000000000000000ffff\
2358-
ffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec1\
2359-
1600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf62\
2360-
1e73a82cbf2342c858eeac00000000",
2361-
)
2362-
.unwrap()
2363-
.as_slice(),
2364-
)
2365-
.unwrap();
2341+
let block = Block::new(hex::decode(MAINNET_BLOCK_1_HEX).unwrap().as_slice()).unwrap();
23662342

23672343
let block_hash_ref = block.hash();
23682344

0 commit comments

Comments
 (0)