Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion examples/checkpoints-eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ fn main() -> eyre::Result<()> {

// Checkpoints can be applied on top of each other, creating a progressive
// history of state changes.
let payload = start.apply(tx1)?.apply(bundle)?.apply(tx4)?;
let payload = start
.execute(tx1)?
.apply()
.execute(bundle)?
.apply()
.execute(tx4)?
.apply();
let built_payload = payload
.build_payload()
.expect("payload should be built successfully");
Expand Down
8 changes: 7 additions & 1 deletion examples/checkpoints-op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ fn main() -> eyre::Result<()> {

// Checkpoints can be applied on top of each other, creating a progressive
// history of state changes.
let payload = start.apply(tx1)?.apply(bundle)?.apply(tx4)?;
let payload = start
.execute(tx1)?
.apply()
.execute(bundle)?
.apply()
.execute(tx4)?
.apply();
let built_payload = payload
.build_payload()
.expect("payload should be built successfully");
Expand Down
17 changes: 14 additions & 3 deletions examples/custom-bundle-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct CustomPlatform;

impl Platform for CustomPlatform {
type Bundle = CustomBundleType;
type CheckpointMetadata = EmptyMetadata;
type DefaultLimits = types::DefaultLimits<Optimism>;
type EvmConfig = types::EvmConfig<Optimism>;
type NodeTypes = types::NodeTypes<Optimism>;
Expand Down Expand Up @@ -79,7 +80,13 @@ fn main() -> eyre::Result<()> {
.with_transaction(tx2)
.with_transaction(tx3);

let payload = start.apply(tx1)?.apply(bundle)?.apply(tx4)?;
let payload = start
.execute(tx1)?
.apply()
.execute(bundle)?
.apply()
.execute(tx4)?
.apply();

let tx5 = transfer_tx(&FundedAccounts::signer(2), 0, U256::from(15_000u64));
let tx6 = transfer_tx(&FundedAccounts::signer(3), 0, U256::from(7_500u64));
Expand All @@ -91,7 +98,7 @@ fn main() -> eyre::Result<()> {
// ensure that custom bundle logic is applied correctly and bundles that do
// not meet the minimum profit are rejected.
assert!(matches!(
payload.apply(failing_bundle),
payload.execute(failing_bundle),
Err(ExecutionError::InvalidBundlePostExecutionState(
MinimumProfitNotMet { .. }
))
Expand Down Expand Up @@ -177,7 +184,11 @@ impl Bundle<CustomPlatform> for CustomBundleType {
}
}

fn is_eligible(&self, _: &BlockContext<CustomPlatform>) -> Eligibility {
fn is_eligible(
&self,
_: &BlockContext<CustomPlatform>,
_: &EmptyMetadata,
) -> Eligibility {
Eligibility::Eligible
}

Expand Down
Loading
Loading