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