Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ic-cdk-executor = { path = "ic-cdk-executor", version = "2.0.0" }
ic-cdk-macros = { path = "ic-cdk-macros", version = "=0.20.2" }
ic-cdk-management-canister = { path = "ic-cdk-management-canister", version = "0.1.1" }
ic-cdk-timers = { path = "ic-cdk-timers", version = "1.0.0" }
ic-management-canister-types = "0.7.1"
ic-management-canister-types = "0.10"
ic0 = { path = "ic0", version = "1.1.0" }

# Regular dependencies
Expand Down Expand Up @@ -68,7 +68,7 @@ escargot = "0.5.15"
futures = "0.3"
ic-vetkd-utils = { git = "https://github.com/dfinity/ic", rev = "95231520" }
lazy_static = "1.5.0"
pocket-ic = { git = "https://github.com/dfinity/ic", tag = "release-2026-04-16_04-20-base" }
pocket-ic = { git = "https://github.com/dfinity/ic", tag = "release-2026-09-03_04-41-base" }
prost = "0.14.3"
prost-build = "0.14.3"
reqwest = "0.13.2"
Expand Down
44 changes: 44 additions & 0 deletions e2e-tests/src/bin/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ fn call_subnet_self() {
msg_reply(vec![]);
}

#[unsafe(export_name = "canister_update call_subnet_self_node_count")]
fn call_subnet_self_node_count() {
let count = subnet_self_node_count();
debug_print(format!("Subnet node count: {count}"));
// Every subnet has at least one node.
assert!(count > 0);
msg_reply(vec![]);
}

#[unsafe(export_name = "canister_inspect_message")]
fn inspect_message() {
assert!(msg_method_name().starts_with("call_"));
Expand Down Expand Up @@ -239,6 +248,41 @@ fn call_cost_http_request() {
msg_reply(vec![]);
}

#[unsafe(export_name = "canister_query call_cost_http_request_v2")]
fn call_cost_http_request_v2() {
use ic_cdk_management_canister::{
CostHttpRequestV2Args, HttpOutcallType, ReplicationCounts, cost_http_request_v2,
};
// The System API traps if the parameter record is not encoded the way it expects, and the
// `fully_replicated` and `non_replicated` payloads in particular have to be encoded as
// `null`. So every `outcall_type` the CDK can produce is priced here, including the absent
// one, which prices a fully replicated outcall.
let outcall_types = [
None,
Some(HttpOutcallType::FullyReplicated(candid::Reserved)),
Some(HttpOutcallType::NonReplicated(candid::Reserved)),
Some(HttpOutcallType::Flexible(None)),
Some(HttpOutcallType::Flexible(Some(ReplicationCounts {
min_responses: 2,
max_responses: 3,
total_requests: 3,
}))),
];
for outcall_type in outcall_types {
let args = CostHttpRequestV2Args {
request_bytes: 100,
http_roundtrip_time_ms: 1_000,
raw_response_bytes: 1_000,
transformed_response_bytes: 1_000,
transform_instructions: 1_000_000,
outcall_type,
};
let res = cost_http_request_v2(&args);
assert!(res > 0);
}
msg_reply(vec![]);
}

const INVALID_KEY_NAME: &str = "invalid_key_name";
const INVALID_CURVE_OR_ALGORITHM: u32 = 42; // Just a big number which is impossible to be valid.
const VALID_KEY_NAME: &str = "test_key_1";
Expand Down
3 changes: 3 additions & 0 deletions e2e-tests/src/bin/canister_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ async fn canister_lifecycle() -> Principal {
memory_allocation: None,
freezing_threshold: None,
reserved_cycles_limit: None,
minimum_incoming_canister_call_cycles: None,
log_visibility: None,
log_memory_limit: None,
snapshot_visibility: None,
status_visibility: None,
wasm_memory_limit: None,
wasm_memory_threshold: None,
environment_variables: None,
Expand Down
Loading
Loading