anvil_core/types.rs
1use alloy_primitives::Bytes;
2use alloy_rpc_types::TransactionRequest;
3use serde::Deserialize;
4
5/// Represents the options used in `anvil_reorg`
6#[derive(Debug, Clone, Deserialize)]
7pub struct ReorgOptions {
8 // The depth of the reorg
9 pub depth: u64,
10 // List of transaction requests and blocks pairs to be mined into the new chain
11 pub tx_block_pairs: Vec<(TransactionData, u64)>,
12}
13
14#[derive(Debug, Clone, Deserialize)]
15#[serde(untagged)]
16#[expect(clippy::large_enum_variant)]
17pub enum TransactionData {
18 JSON(TransactionRequest),
19 Raw(Bytes),
20}