mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 09:08:05 -05:00
Add withdrawals in Block eth test model (#961)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use reth_primitives::{
|
||||
Address, BigEndianHash, Bloom, Bytes, ChainSpec, ChainSpecBuilder, Header as RethHeader,
|
||||
JsonU256, SealedHeader, H160, H256, H64,
|
||||
JsonU256, SealedHeader, H160, H256, H64, U256, U64,
|
||||
};
|
||||
use serde::{self, Deserialize};
|
||||
use std::collections::BTreeMap;
|
||||
@@ -114,6 +114,8 @@ pub struct Block {
|
||||
pub uncle_headers: Option<Vec<Header>>,
|
||||
/// Transaction Sequence
|
||||
pub transaction_sequence: Option<Vec<TransactionSequence>>,
|
||||
/// Withdrawals
|
||||
pub withdrawals: Option<Vec<Withdrawal>>,
|
||||
}
|
||||
|
||||
/// Transaction Sequence in block
|
||||
@@ -126,6 +128,16 @@ pub struct TransactionSequence {
|
||||
valid: String,
|
||||
}
|
||||
|
||||
/// Withdrawal in block
|
||||
#[derive(Default, Clone, Debug, PartialEq, Eq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Withdrawal {
|
||||
index: U64,
|
||||
validator_index: U64,
|
||||
address: Address,
|
||||
amount: U256,
|
||||
}
|
||||
|
||||
/// Ethereum blockchain test data state.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Deserialize)]
|
||||
pub struct State(pub BTreeMap<Address, Account>);
|
||||
@@ -359,6 +371,8 @@ mod test {
|
||||
}
|
||||
],
|
||||
"uncleHeaders" : [
|
||||
],
|
||||
"withdrawals" : [
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user