From 0523fd264dcfd0eb04a95f0d1d60f81ce415a0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= Date: Sat, 21 Jan 2023 22:53:59 +0100 Subject: [PATCH] Add withdrawals in Block eth test model (#961) --- bin/reth/src/test_eth_chain/models.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/reth/src/test_eth_chain/models.rs b/bin/reth/src/test_eth_chain/models.rs index 703ae73677..0bb5006da5 100644 --- a/bin/reth/src/test_eth_chain/models.rs +++ b/bin/reth/src/test_eth_chain/models.rs @@ -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>, /// Transaction Sequence pub transaction_sequence: Option>, + /// Withdrawals + pub withdrawals: Option>, } /// 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); @@ -359,6 +371,8 @@ mod test { } ], "uncleHeaders" : [ + ], + "withdrawals" : [ ] } ],