MCPcopy Create free account
hub / github.com/base/base / create_test_flashblock

Function create_test_flashblock

crates/execution/flashblocks/src/block_assembler.rs:179–211  ·  view source on GitHub ↗
(index: u64, with_base: bool)

Source from the content-addressed store, hash-verified

177 use crate::ProtocolError;
178
179 fn create_test_flashblock(index: u64, with_base: bool) -> Flashblock {
180 Flashblock {
181 payload_id: PayloadId::default(),
182 index,
183 base: if with_base {
184 Some(ExecutionPayloadBaseV1 {
185 parent_beacon_block_root: B256::ZERO,
186 parent_hash: B256::ZERO,
187 fee_recipient: Address::ZERO,
188 prev_randao: B256::ZERO,
189 block_number: 100,
190 gas_limit: 30_000_000,
191 timestamp: 1700000000,
192 extra_data: Bytes::default(),
193 base_fee_per_gas: U256::from(1000000000u64),
194 })
195 } else {
196 None
197 },
198 diff: ExecutionPayloadFlashblockDeltaV1 {
199 state_root: B256::ZERO,
200 receipts_root: B256::ZERO,
201 logs_bloom: Bloom::default(),
202 gas_used: 21000,
203 block_hash: B256::ZERO,
204 transactions: vec![],
205 withdrawals: vec![],
206 withdrawals_root: B256::ZERO,
207 blob_gas_used: None,
208 },
209 metadata: Metadata::new(100),
210 }
211 }
212
213 fn block_info_tx() -> Bytes {
214 Bytes::from_hex("0x7ef90104a06c0c775b6b492bab9d7e81abdf27f77cafb698551226455a82f559e0f93fea3794deaddeaddeaddeaddeaddeaddeaddeaddead00019442000000000000000000000000000000000000158080830f424080b8b0098999be000008dd00101c1200000000000000020000000068869d6300000000015f277f000000000000000000000000000000000000000000000000000000000d42ac290000000000000000000000000000000000000000000000000000000000000001abf52777e63959936b1bf633a2a643f0da38d63deffe49452fed1bf8a44975d50000000000000000000000005050f69a9786f081509234f1a7f4684b5e5b76c9000000000000000000000000").expect("valid block info transaction")

Calls 1

newFunction · 0.50