Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Weigelt committed Nov 15, 2024
1 parent 9d8495d commit 7338c16
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions rs/execution_environment/src/canister_manager/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7981,7 +7981,7 @@ fn node_metrics_history_update_succeeds() {
let uni_canister = test
.universal_canister_with_cycles(Cycles::new(1_000_000_000_000))
.unwrap();
let update = wasm()
let payload = wasm()
.call_simple(
CanisterId::ic_00(),
Method::NodeMetricsHistory,
Expand All @@ -7994,7 +7994,7 @@ fn node_metrics_history_update_succeeds() {
),
)
.build();
let result = test.ingress(uni_canister, "update", update);
let result = test.ingress(uni_canister, "update", payload);
let bytes = get_reply(result);
let _ = Decode!(&bytes, Vec<NodeMetricsHistoryResponse>).unwrap();
}
Expand All @@ -8004,24 +8004,33 @@ fn node_metrics_history_query_fails() {
let own_subnet_id = subnet_test_id(1);
let mut test = ExecutionTestBuilder::new()
.with_own_subnet_id(own_subnet_id)
.with_composite_queries()
.build();
let uni_canister = test
.universal_canister_with_cycles(Cycles::new(1_000_000_000_000))
.unwrap();
let query = wasm()
println!(
"{:?}, {:?}, {:?}",
uni_canister,
CanisterId::ic_00(),
own_subnet_id
);
let payload = wasm()
.call_simple(
CanisterId::ic_00(),
Method::NodeMetricsHistory,
call_args().other_side(
NodeMetricsHistoryArgs {
subnet_id: own_subnet_id.get(),
start_at_timestamp_nanos: 0,
}
.encode(),
),
call_args()
.other_side(
NodeMetricsHistoryArgs {
subnet_id: own_subnet_id.get(),
start_at_timestamp_nanos: 0,
}
.encode(),
)
.on_reject(wasm().reject_message().reject()),
)
.build();
test.ingress(uni_canister, "query", query)
test.non_replicated_query(uni_canister, "composite_query", payload)
.unwrap_err()
.assert_contains(
ErrorCode::CanisterContractViolation,
Expand Down

0 comments on commit 7338c16

Please sign in to comment.