Skip to content

Commit

Permalink
FOLLOW-244: Remove MultiPartTransactionToBeProcessed::TopUpCanisterV2 (
Browse files Browse the repository at this point in the history
…#5989)

# Motivation

#5862 removed the canister
top-up functionality from the backend canister.
It left some TODOs to do after the next release.
There has now been a release so we can remove
`MultiPartTransactionToBeProcessed::TopUpCanisterV2` now.

# Changes

Remove `MultiPartTransactionToBeProcessed::TopUpCanisterV2`.

# Tests

CI passes

# Todos

- [ ] Add entry to changelog (if necessary).
not necessary
  • Loading branch information
dskloetd authored Dec 11, 2024
1 parent 7a7b3ac commit 80445c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 3 additions & 8 deletions rs/backend/src/multi_part_transactions_processor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use candid::CandidType;
use ic_base_types::{CanisterId, PrincipalId};
use ic_base_types::PrincipalId;
use icp_ledger::BlockIndex;
use serde::Deserialize;
use std::collections::VecDeque;
Expand All @@ -12,10 +12,6 @@ pub struct MultiPartTransactionsProcessor {
#[derive(Clone, CandidType, Deserialize, Debug, Eq, PartialEq)]
pub enum MultiPartTransactionToBeProcessed {
CreateCanisterV2(PrincipalId),
// TODO: Remove TopUpCanisterV2 after a version has been released that does
// not add TopUpCanisterV2 to the multi-part transaction queue
// anymore.
TopUpCanisterV2(PrincipalId, CanisterId),
}

impl MultiPartTransactionsProcessor {
Expand Down Expand Up @@ -55,9 +51,8 @@ mod tests {
for i in 0..10 {
let (block_height, to_be_processed) = processor.take_next().unwrap();
assert_eq!(block_height, i);
if let MultiPartTransactionToBeProcessed::CreateCanisterV2(p) = to_be_processed {
assert_eq!(p, principal);
}
let MultiPartTransactionToBeProcessed::CreateCanisterV2(p) = to_be_processed;
assert_eq!(p, principal);
}

assert!(processor.take_next().is_none());
Expand Down
4 changes: 0 additions & 4 deletions rs/backend/src/periodic_tasks_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ pub async fn run_periodic_tasks() {
MultiPartTransactionToBeProcessed::CreateCanisterV2(controller) => {
handle_create_canister_v2(block_height, controller).await;
}
// TODO: Remove TopUpCanisterV2 after a version has been released
// that does not add TopUpCanisterV2 to the multi-part
// transaction queue anymore.
MultiPartTransactionToBeProcessed::TopUpCanisterV2(_principal, _canister_id) => {}
}
}
}
Expand Down

0 comments on commit 80445c6

Please sign in to comment.