Skip to content

Commit

Permalink
remove canister endpoint from package/pocket-ic
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrodimarco-dfinity committed Jan 31, 2025
1 parent 3a08815 commit 189b8b3
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 36 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion packages/pocket-ic/test_canister/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ rust_canister(
service_file = ":canister.did",
deps = [
# Keep sorted.
"//rs/types/management_canister_types",
"@crate_index//:candid",
"@crate_index//:ic-cdk",
"@crate_index//:serde",
Expand Down
1 change: 0 additions & 1 deletion packages/pocket-ic/test_canister/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ candid = { workspace = true }
ic-cdk = { workspace = true }
serde = { workspace = true }
serde_bytes = { workspace = true }
ic-management-canister-types = { path = "../../../rs/types/management_canister_types" }
17 changes: 0 additions & 17 deletions packages/pocket-ic/test_canister/canister.did
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,6 @@ type TransformArgs = record {
context : blob;
};

type NodeMetricsHistoryArgs = record {
subnet_id: principal;
start_at_timestamp_nanos: nat64;
};

type NodeMetrics = record {
node_id: principal;
num_blocks_proposed_total: nat64;
num_block_failures_total: nat64;
};

type NodeMetricsHistoryResponse = record {
timestamp_nanos: nat64;
node_metrics: vec NodeMetrics;
};

service : {
http_request: (request: HttpGatewayRequest) -> (HttpGatewayResponse) query;
schnorr_public_key : (opt principal, vec blob, SchnorrKeyId) -> (SchnorrPublicKeyResult);
Expand All @@ -123,7 +107,6 @@ service : {
canister_http : () -> (HttpResponseResult);
canister_http_with_transform : () -> (HttpResponse);
transform : (TransformArgs) -> (HttpResponse) query;
node_metrics_history_proxy: (NodeMetricsHistoryArgs) -> (vec NodeMetricsHistoryResponse);
whoami : () -> (text);
whois : (principal) -> (text);
blob_len : (blob) -> (nat64);
Expand Down
17 changes: 1 addition & 16 deletions packages/pocket-ic/test_canister/src/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use ic_cdk::api::management_canister::http_request::{
TransformArgs, TransformContext, TransformFunc,
};
use ic_cdk::{inspect_message, query, trap, update};
use ic_management_canister_types::{NodeMetricsHistoryArgs, NodeMetricsHistoryResponse};
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;

// HTTP gateway interface

pub type HeaderField = (String, String);
Expand Down Expand Up @@ -267,21 +267,6 @@ async fn canister_http_with_transform() -> HttpResponse {

// inter-canister calls

#[update]
async fn node_metrics_history_proxy(
args: NodeMetricsHistoryArgs,
) -> Vec<NodeMetricsHistoryResponse> {
ic_cdk::api::call::call_with_payment128::<_, (Vec<NodeMetricsHistoryResponse>,)>(
candid::Principal::management_canister(),
"node_metrics_history",
(args,),
0_u128,
)
.await
.unwrap()
.0
}

#[update]
async fn whoami() -> String {
ic_cdk::id().to_string()
Expand Down

0 comments on commit 189b8b3

Please sign in to comment.