Skip to content

Commit

Permalink
chore: Remove last management canister types from PocketIC and its us…
Browse files Browse the repository at this point in the history
…ers (#4178)

Co-authored-by: IDX GitHub Automation <[email protected]>
  • Loading branch information
michael-weigelt and IDX GitHub Automation authored Mar 1, 2025
1 parent 55dcbc7 commit ddcdb2e
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 67 deletions.
16 changes: 8 additions & 8 deletions Cargo.Bazel.Fuzzing.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "1e8bffe24652db11f439e8104fd2a22890550692ac65d2158f6bf76b10cf8a04",
"checksum": "08d6ff34bbb2dba9b147373032c8d6016a785821f41dea400d071133689f395b",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down Expand Up @@ -19968,7 +19968,7 @@
"target": "ic_http_gateway"
},
{
"id": "ic-management-canister-types 0.2.0",
"id": "ic-management-canister-types 0.2.1",
"target": "ic_management_canister_types"
},
{
Expand Down Expand Up @@ -33389,14 +33389,14 @@
],
"license_file": null
},
"ic-management-canister-types 0.2.0": {
"ic-management-canister-types 0.2.1": {
"name": "ic-management-canister-types",
"version": "0.2.0",
"version": "0.2.1",
"package_url": "https://github.com/dfinity/cdk-rs",
"repository": {
"Http": {
"url": "https://static.crates.io/crates/ic-management-canister-types/0.2.0/download",
"sha256": "4ce1cdd2b6df9eac37cd2dcf5d40cf9427a24aed9b0751cbe5b09ae116eb4de3"
"url": "https://static.crates.io/crates/ic-management-canister-types/0.2.1/download",
"sha256": "1a23527ab5e2ede1aae270cdb79ef0491479c8b5c2de9fd393048ca907cac5e1"
}
},
"targets": [
Expand Down Expand Up @@ -33440,7 +33440,7 @@
"selects": {}
},
"edition": "2021",
"version": "0.2.0"
"version": "0.2.1"
},
"license": "Apache-2.0",
"license_ids": [
Expand Down Expand Up @@ -91316,7 +91316,7 @@
"ic-certified-map 0.3.4",
"ic-http-certification 3.0.3",
"ic-http-gateway 0.2.0",
"ic-management-canister-types 0.2.0",
"ic-management-canister-types 0.2.1",
"ic-metrics-encoder 1.1.1",
"ic-response-verification 3.0.3",
"ic-sha3 1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions Cargo.Bazel.Fuzzing.toml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5597,9 +5597,9 @@ dependencies = [

[[package]]
name = "ic-management-canister-types"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ce1cdd2b6df9eac37cd2dcf5d40cf9427a24aed9b0751cbe5b09ae116eb4de3"
checksum = "1a23527ab5e2ede1aae270cdb79ef0491479c8b5c2de9fd393048ca907cac5e1"
dependencies = [
"candid",
"candid_parser",
Expand Down
16 changes: 8 additions & 8 deletions Cargo.Bazel.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "bdcbdf21b5cda7470290bfa053f648ac6bd22c5ca394d196b9d1c7029e9284f3",
"checksum": "df8f83940c75aa96f2b7ddeddf586c11aacb29401985b0424589fccd6f5125de",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down Expand Up @@ -19796,7 +19796,7 @@
"target": "ic_http_gateway"
},
{
"id": "ic-management-canister-types 0.2.0",
"id": "ic-management-canister-types 0.2.1",
"target": "ic_management_canister_types"
},
{
Expand Down Expand Up @@ -33244,14 +33244,14 @@
],
"license_file": null
},
"ic-management-canister-types 0.2.0": {
"ic-management-canister-types 0.2.1": {
"name": "ic-management-canister-types",
"version": "0.2.0",
"version": "0.2.1",
"package_url": "https://github.com/dfinity/cdk-rs",
"repository": {
"Http": {
"url": "https://static.crates.io/crates/ic-management-canister-types/0.2.0/download",
"sha256": "4ce1cdd2b6df9eac37cd2dcf5d40cf9427a24aed9b0751cbe5b09ae116eb4de3"
"url": "https://static.crates.io/crates/ic-management-canister-types/0.2.1/download",
"sha256": "1a23527ab5e2ede1aae270cdb79ef0491479c8b5c2de9fd393048ca907cac5e1"
}
},
"targets": [
Expand Down Expand Up @@ -33295,7 +33295,7 @@
"selects": {}
},
"edition": "2021",
"version": "0.2.0"
"version": "0.2.1"
},
"license": "Apache-2.0",
"license_ids": [
Expand Down Expand Up @@ -91229,7 +91229,7 @@
"ic-certified-map 0.3.4",
"ic-http-certification 3.0.3",
"ic-http-gateway 0.2.0",
"ic-management-canister-types 0.2.0",
"ic-management-canister-types 0.2.1",
"ic-metrics-encoder 1.1.1",
"ic-response-verification 3.0.3",
"ic-sha3 1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions Cargo.Bazel.toml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5587,9 +5587,9 @@ dependencies = [

[[package]]
name = "ic-management-canister-types"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ce1cdd2b6df9eac37cd2dcf5d40cf9427a24aed9b0751cbe5b09ae116eb4de3"
checksum = "1a23527ab5e2ede1aae270cdb79ef0491479c8b5c2de9fd393048ca907cac5e1"
dependencies = [
"candid",
"candid_parser",
Expand Down
6 changes: 4 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ ic-certificate-verification = "3"
ic-certification = "3"
ic-http-certification = "3"
ic-http-gateway = "0.1"
ic-management-canister-types = "0.2.0"
ic-management-canister-types = "0.2.1"
ic-response-verification = "3"
ic-sha3 = "1.0.0"
ic-stable-structures = "0.6.5"
Expand Down
2 changes: 1 addition & 1 deletion bazel/external_crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
version = "^1.1.1",
),
"ic-management-canister-types": crate.spec(
version = "0.2.0",
version = "0.2.1",
),
"ic_principal": crate.spec(
version = "^0.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/ic-metrics-assert/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package(default_visibility = ["//visibility:public"])
deps = [
# Keep sorted.
"@crate_index//:candid",
"@crate_index//:ic-management-canister-types",
"@crate_index//:regex",
"@crate_index//:serde",
"@crate_index//:serde_bytes",
Expand Down
1 change: 1 addition & 0 deletions packages/ic-metrics-assert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ documentation.workspace = true
[dependencies]
candid = { workspace = true }
pocket-ic = { path = "../../packages/pocket-ic", optional = true }
ic-management-canister-types = { workspace = true }
regex = "1.11.0"
serde = { workspace = true }
serde_bytes = { workspace = true }
Expand Down
6 changes: 4 additions & 2 deletions packages/ic-metrics-assert/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use std::fmt::Debug;
///
/// ```rust
/// use ic_metrics_assert::{MetricsAssert, PocketIcHttpQuery};
/// use pocket_ic::{management_canister::CanisterId, PocketIc};
/// use pocket_ic::PocketIc;
/// use ic_management_canister_types::CanisterId;
///
/// struct Setup {
/// env: PocketIc,
Expand Down Expand Up @@ -135,7 +136,8 @@ pub use pocket_ic_query_call::PocketIcHttpQuery;
mod pocket_ic_query_call {
use super::*;
use candid::Principal;
use pocket_ic::{management_canister::CanisterId, PocketIc, RejectResponse};
use ic_management_canister_types::CanisterId;
use pocket_ic::{PocketIc, RejectResponse};

/// Provides an implementation of the [CanisterHttpQuery] trait in the case where the canister
/// HTTP requests are made through an instance of [PocketIc].
Expand Down
5 changes: 2 additions & 3 deletions packages/pocket-ic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ use candid::{
};
use flate2::read::GzDecoder;
use ic_management_canister_types::{
CanisterId, CanisterInstallMode, CanisterSettings, CanisterStatusResult, Snapshot,
CanisterId, CanisterInstallMode, CanisterLogRecord, CanisterSettings, CanisterStatusResult,
Snapshot,
};
use ic_transport_types::SubnetMetrics;
use management_canister::CanisterLogRecord;
use reqwest::Url;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
Expand All @@ -95,7 +95,6 @@ use tracing::{instrument, warn};
use wslpath::windows_to_wsl;

pub mod common;
pub mod management_canister;
pub mod nonblocking;

const EXPECTED_SERVER_VERSION: &str = "8.0.0";
Expand Down
30 changes: 0 additions & 30 deletions packages/pocket-ic/src/management_canister.rs

This file was deleted.

8 changes: 3 additions & 5 deletions packages/pocket-ic/src/nonblocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ use crate::common::rest::{
RawMockCanisterHttpResponse, RawPrincipalId, RawSetStableMemory, RawStableMemory, RawSubnetId,
RawTime, RawVerifyCanisterSigArg, SubnetId, TickConfigs, Topology,
};
use crate::management_canister::{
CanisterId, CanisterIdRecord, CanisterLogRecord, FetchCanisterLogsResult,
};
pub use crate::DefaultEffectiveCanisterIdError;
use crate::{start_or_reuse_server, IngressStatusResult, PocketIcBuilder, RejectResponse};
use backoff::backoff::Backoff;
Expand All @@ -21,8 +18,9 @@ use candid::{
};
use ic_certification::{Certificate, Label, LookupResult};
use ic_management_canister_types::{
CanisterInstallMode, CanisterSettings, CanisterStatusResult, ChunkHash,
DeleteCanisterSnapshotArgs, InstallChunkedCodeArgs, InstallCodeArgs, LoadCanisterSnapshotArgs,
CanisterId, CanisterIdRecord, CanisterInstallMode, CanisterLogRecord, CanisterSettings,
CanisterStatusResult, ChunkHash, DeleteCanisterSnapshotArgs, FetchCanisterLogsResult,
InstallChunkedCodeArgs, InstallCodeArgs, LoadCanisterSnapshotArgs,
ProvisionalCreateCanisterWithCyclesArgs, Snapshot, StoredChunksResult,
TakeCanisterSnapshotArgs, UpdateSettingsArgs, UpgradeFlags as CanisterInstallModeUpgradeInner,
UploadChunkArgs, UploadChunkResult,
Expand Down
2 changes: 1 addition & 1 deletion packages/pocket-ic/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use candid::{decode_one, encode_one, CandidType, Decode, Deserialize, Encode, Principal};
use ic_certification::Label;
use ic_management_canister_types::CanisterIdRecord;
use ic_management_canister_types::{
Bip341, CanisterInstallMode, CanisterSettings, EcdsaPublicKeyResult, HttpRequestResult,
NodeMetricsHistoryArgs, NodeMetricsHistoryRecord as NodeMetricsHistoryResultItem,
Expand All @@ -9,7 +10,6 @@ use ic_management_canister_types::{
use ic_transport_types::Envelope;
use ic_transport_types::EnvelopeContent::ReadState;
use pocket_ic::common::rest::{BlockmakerConfigs, RawSubnetBlockmaker, TickConfigs};
use pocket_ic::management_canister::CanisterIdRecord;
use pocket_ic::{
common::rest::{
BlobCompression, CanisterHttpReply, CanisterHttpResponse, MockCanisterHttpResponse,
Expand Down
4 changes: 4 additions & 0 deletions rs/bitcoin/checker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rust_library(
"@crate_index//:bitcoin",
"@crate_index//:candid",
"@crate_index//:ic-btc-interface",
"@crate_index//:ic-management-canister-types",
"@crate_index//:serde",
],
)
Expand All @@ -40,6 +41,7 @@ rust_test(
# Keep sorted.
"@crate_index//:candid_parser",
"@crate_index//:ic-btc-interface",
"@crate_index//:ic-management-canister-types",
"@crate_index//:proptest",
"@crate_index//:scraper",
"@crate_index//:tokio",
Expand Down Expand Up @@ -72,6 +74,7 @@ rust_canister(
"@crate_index//:ic-btc-interface",
"@crate_index//:ic-canister-log",
"@crate_index//:ic-cdk",
"@crate_index//:ic-management-canister-types",
"@crate_index//:ic-metrics-encoder",
"@crate_index//:ic-stable-structures",
"@crate_index//:serde",
Expand Down Expand Up @@ -108,6 +111,7 @@ rust_ic_test(
"@crate_index//:candid",
"@crate_index//:ic-btc-interface",
"@crate_index//:ic-cdk",
"@crate_index//:ic-management-canister-types",
"@crate_index//:regex",
],
)
5 changes: 4 additions & 1 deletion rs/bitcoin/checker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ic-btc-interface = { workspace = true }
ic-canister-log = { path = "../../rust_canisters/canister_log" }
ic-canisters-http-types = { path = "../../rust_canisters/http_types" }
ic-cdk = { workspace = true }
ic-management-canister-types = { workspace = true }
ic-metrics-encoder = "1.1"
ic-stable-structures = { workspace = true }
serde = { workspace = true }
Expand All @@ -32,7 +33,9 @@ url = { workspace = true }
[dev-dependencies]
candid_parser = { workspace = true }
ic-base-types = { path = "../../types/base_types" }
ic-metrics-assert = { path = "../../../packages/ic-metrics-assert", features = ["pocket_ic"] }
ic-metrics-assert = { path = "../../../packages/ic-metrics-assert", features = [
"pocket_ic",
] }
ic-types = { path = "../../types/types" }
ic-test-utilities-load-wasm = { path = "../../test_utilities/load_wasm" }
ic-universal-canister = { path = "../../universal_canister/lib" }
Expand Down
2 changes: 1 addition & 1 deletion rs/bitcoin/checker/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ use ic_btc_checker::{
use ic_btc_interface::Txid;
use ic_canisters_http_types::{HttpRequest, HttpResponse};
use ic_cdk::api::call::RejectionCode;
use ic_management_canister_types::CanisterId;
use ic_metrics_assert::{MetricsAssert, PocketIcHttpQuery};
use ic_test_utilities_load_wasm::load_wasm;
use ic_types::Cycles;
use ic_universal_canister::{call_args, wasm, UNIVERSAL_CANISTER_WASM};
use pocket_ic::management_canister::CanisterId;
use pocket_ic::{
common::rest::{
CanisterHttpHeader, CanisterHttpReject, CanisterHttpReply, CanisterHttpRequest,
Expand Down

0 comments on commit ddcdb2e

Please sign in to comment.