mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-11 07:25:09 -05:00
33 lines
1.2 KiB
Rust
33 lines
1.2 KiB
Rust
//! Decoding tests for [`NewBlock`]
|
|
use reth_eth_wire::NewBlock;
|
|
use reth_primitives::hex;
|
|
use reth_rlp::Decodable;
|
|
use std::{fs, path::PathBuf};
|
|
|
|
#[test]
|
|
fn decode_new_block_network() {
|
|
let network_data_path =
|
|
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("testdata/new_block_network_rlp");
|
|
let data = fs::read_to_string(network_data_path).expect("Unable to read file");
|
|
let hex_data = hex::decode(data.trim()).unwrap();
|
|
let _txs = NewBlock::decode(&mut &hex_data[..]).unwrap();
|
|
}
|
|
|
|
#[test]
|
|
fn decode_new_block_network_bsc_one() {
|
|
let network_data_path =
|
|
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("testdata/bsc_new_block_network_one");
|
|
let data = fs::read_to_string(network_data_path).expect("Unable to read file");
|
|
let hex_data = hex::decode(data.trim()).unwrap();
|
|
let _txs = NewBlock::decode(&mut &hex_data[..]).unwrap();
|
|
}
|
|
|
|
#[test]
|
|
fn decode_new_block_network_bsc_two() {
|
|
let network_data_path =
|
|
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("testdata/bsc_new_block_network_two");
|
|
let data = fs::read_to_string(network_data_path).expect("Unable to read file");
|
|
let hex_data = hex::decode(data.trim()).unwrap();
|
|
let _txs = NewBlock::decode(&mut &hex_data[..]).unwrap();
|
|
}
|