Add withdrawals in Block eth test model (#961)

This commit is contained in:
Aurélien
2023-01-21 22:53:59 +01:00
committed by GitHub
parent 3c64c94616
commit 0523fd264d

View File

@@ -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" : [
]
}
],