mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: generalize Block impls (#14133)
This commit is contained in:
@ -352,7 +352,7 @@ mod tests {
|
||||
const TX: [u8; 251] = hex!("7ef8f8a0a539eb753df3b13b7e386e147d45822b67cb908c9ddc5618e3dbaa22ed00850b94deaddeaddeaddeaddeaddeaddeaddeaddead00019442000000000000000000000000000000000000158080830f424080b8a4440a5e2000000558000c5fc50000000000000000000000006605a89f00000000012a10d90000000000000000000000000000000000000000000000000000000af39ac3270000000000000000000000000000000000000000000000000000000d5ea528d24e582fa68786f080069bdbfe06a43f8e67bfd31b8e4d8a8837ba41da9a82a54a0000000000000000000000006887246668a3b87f54deb3b94ba47a6f63f32985");
|
||||
|
||||
let tx = OpTransactionSigned::decode_2718(&mut TX.as_slice()).unwrap();
|
||||
let block = Block {
|
||||
let block: Block<OpTransactionSigned> = Block {
|
||||
body: BlockBody { transactions: vec![tx], ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@ -293,7 +293,7 @@ mod test {
|
||||
OpTransactionSigned::decode_2718(&mut TX_1_OP_MAINNET_BLOCK_124665056.as_slice())
|
||||
.unwrap();
|
||||
|
||||
let block = Block {
|
||||
let block: Block<OpTransactionSigned> = Block {
|
||||
body: BlockBody { transactions: [tx_0, tx_1.clone()].to_vec(), ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
@ -359,7 +359,7 @@ mod test {
|
||||
let system = hex!("7ef8f8a0389e292420bcbf9330741f72074e39562a09ff5a00fd22e4e9eee7e34b81bca494deaddeaddeaddeaddeaddeaddeaddeaddead00019442000000000000000000000000000000000000158080830f424080b8a4440a5e20000008dd00101c120000000000000004000000006721035b00000000014189960000000000000000000000000000000000000000000000000000000349b4dcdc000000000000000000000000000000000000000000000000000000004ef9325cc5991ce750960f636ca2ffbb6e209bb3ba91412f21dd78c14ff154d1930f1f9a0000000000000000000000005050f69a9786f081509234f1a7f4684b5e5b76c9");
|
||||
let tx_0 = OpTransactionSigned::decode_2718(&mut &system[..]).unwrap();
|
||||
|
||||
let block = Block {
|
||||
let block: alloy_consensus::Block<OpTransactionSigned> = Block {
|
||||
body: BlockBody { transactions: vec![tx_0], ..Default::default() },
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user