Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add more missing eth_callBundle arguments #1667

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/rpc-types-mev/src/eth_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ pub struct EthCallBundle {
pub block_number: u64,
/// Either a hex encoded number or a block tag for which state to base this simulation on
pub state_block_number: BlockNumberOrTag,
/// the coinbase to use for this bundle simulation
#[serde(default, skip_serializing_if = "Option::is_none")]
pub coinbase: Option<Address>,
/// the timestamp to use for this bundle simulation, in seconds since the unix epoch
#[serde(default, with = "alloy_serde::quantity::opt", skip_serializing_if = "Option::is_none")]
pub timestamp: Option<u64>,
/// the timeout to apply to execution of this bundle, in milliseconds
#[serde(default, with = "alloy_serde::quantity::opt", skip_serializing_if = "Option::is_none")]
pub timeout: Option<u64>,
/// gas limit of the block to use for this simulation
#[serde(default, with = "alloy_serde::quantity::opt", skip_serializing_if = "Option::is_none")]
pub gas_limit: Option<u64>,
Expand Down Expand Up @@ -96,12 +102,24 @@ impl EthCallBundle {
self
}

/// Sets the coinbase for the bundle.
pub const fn with_coinbase(mut self, coinbase: Address) -> Self {
self.coinbase = Some(coinbase);
self
}

/// Sets the timestamp for the bundle.
pub const fn with_timestamp(mut self, timestamp: u64) -> Self {
self.timestamp = Some(timestamp);
self
}

/// Sets the timeout for the bundle.
pub const fn with_timeout(mut self, timeout: u64) -> Self {
self.timeout = Some(timeout);
self
}

/// Sets the gas limit for the bundle.
pub const fn with_gas_limit(mut self, gas_limit: u64) -> Self {
self.gas_limit = Some(gas_limit);
Expand Down