Skip to content

Commit

Permalink
machete, drain > mem::swap for clarity reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Sep 20, 2024
1 parent a0ed043 commit 2c8af04
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions processor/bin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,19 @@ pub async fn main_loop<
let key_to_activate =
KeyToActivate::<KeyFor<S>>::try_recv(txn.as_mut().unwrap()).map(|key| key.0);

/*
`acknowledge_batch` takes burns to optimize handling returns with standard payments.
That's why handling these with a Batch (and not waiting until the following potential
`queue_burns` call makes sense. As for which Batch, the first is equally valid unless
we want to start introspecting (and should be our only Batch anyways).
*/
let mut this_batchs_burns = vec![];
std::mem::swap(&mut burns, &mut this_batchs_burns);

// This is a cheap call as it internally just queues this to be done later
let _: () = scanner.acknowledge_batch(
txn.take().unwrap(),
id,
in_instructions,
this_batchs_burns,
/*
`acknowledge_batch` takes burns to optimize handling returns with standard
payments. That's why handling these with a Batch (and not waiting until the
following potential `queue_burns` call makes sense. As for which Batch, the first
is equally valid unless we want to start introspecting (and should be our only
Batch anyways).
*/
burns.drain(..).collect(),
key_to_activate,
);
}
Expand Down
1 change: 0 additions & 1 deletion processor/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ k256 = { version = "^0.13.1", default-features = false, features = ["std"] }

alloy-core = { version = "0.8", default-features = false }
alloy-rlp = { version = "0.3", default-features = false }
alloy-consensus = { version = "0.3", default-features = false }

alloy-rpc-types-eth = { version = "0.3", default-features = false }
alloy-transport = { version = "0.3", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion processor/ethereum/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ workspace = true

[dependencies]
group = { version = "0.13", default-features = false }
k256 = { version = "^0.13.1", default-features = false, features = ["std", "ecdsa", "arithmetic"] }

alloy-core = { version = "0.8", default-features = false }
alloy-consensus = { version = "0.3", default-features = false }
Expand Down

0 comments on commit 2c8af04

Please sign in to comment.