pub mod types {
pub type BlockNumber = ethers_core::types::U64;
}
pub mod simulation {
use crate::types::BlockNumber;
pub struct SimulationParameters {
state_block_number: BlockNumber,
timestamp: usize,
}
pub enum SimulationError {
MaxFeePerGasTooLow,
}
}
pub mod auction {
use crate::types::BlockNumber;
use ethers_core::types::Bytes;
use ethers_core::types::TxHash;
use uuid::Uuid;
pub struct Bundle {
transactions: Vec<Bytes>,
block_number: BlockNumber,
min_timestamp: Option<usize>,
max_timestamp: Option<usize>,
reverting_tx_hashes: Vec<TxHash>,
replacement_uuid: Option<Uuid>,
}
pub struct CachedBundle {
bundle_id: Uuid,
transactions: Vec<Bytes>,
}
pub mod stats {
pub struct User {}
pub struct Bundle {}
}
}
pub mod protect {
use crate::simulation::SimulationError;
use crate::types::BlockNumber;
use ethers_core::types::Transaction;
use ethers_core::types::TxHash;
pub struct Preferences {
fast: bool,
}
pub struct PrivateTransaction<T> {
transaction: T,
max_block_number: BlockNumber,
preferences: Preferences,
}
pub enum Status {
Pending,
Included,
Failed,
Cancelled,
Unknown,
}
pub struct TransactionStatus {
status: Status,
hash: TxHash,
max_block_number: BlockNumber,
transaction: Transaction,
fast_mode: bool,
seen_in_mempool: bool,
simulation_error: SimulationError,
}
}
pub mod blocks {
use crate::types::BlockNumber;
use ethers_core::types::{Address, TxHash, U256};
pub struct Transaction {
transaction_hash: TxHash,
tx_index: U256,
bundle_index: U256,
block_number: BlockNumber,
eoa_address: Address,
to_address: Address,
gas_used: U256,
gas_price: U256,
fee_recipient_eth_diff: U256,
eth_sent_to_fee_recipient: U256,
}
pub struct Block {
block_number: BlockNumber,
fee_recipient: Address,
fee_recipient_eth_diff: U256,
eth_sent_to_fee_recipient: U256,
gas_used: U256,
gas_price: U256,
transactions: Vec<Transaction>,
}
}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 2 + 2;
assert_eq!(result, 4);
}
}