Skip to content

Commit

Permalink
Fix types in SNS CLI and add PocketIc changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
aterga committed Jan 31, 2025
1 parent 86e4af5 commit 238d139
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/pocket-ic/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The function `PocketIc::await_call_no_ticks` to await the status of an update call (submitted through an ingress message) becoming known without triggering round execution
(round execution must be triggered separarely, e.g., on a "live" instance or by separate PocketIC library calls).
- The function `PocketIc::set_certified_time` to set the current certified time on all subnets of the PocketIC instance.
- The function `PocketIc::update_call_with_effective_principal` is made public. It is helpful, e.g., for
modeling management canister calls that need to be routed to the right subnet using effective principals.

### Changed
- The response types `pocket_ic::WasmResult`, `pocket_ic::UserError`, and `pocket_ic::CallError` are replaced by a single reject response type `pocket_ic::RejectResponse`.
Expand Down
2 changes: 1 addition & 1 deletion packages/pocket-ic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ impl PocketIc {
runtime.block_on(async { self.pocket_ic.get_subnet_metrics(subnet_id).await })
}

fn update_call_with_effective_principal(
pub fn update_call_with_effective_principal(
&self,
canister_id: CanisterId,
effective_principal: RawEffectivePrincipal,
Expand Down
9 changes: 6 additions & 3 deletions rs/sns/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ async fn main() -> Result<()> {
SubCommand::List(args) => list::exec(args, &agent).await,
SubCommand::Health(args) => health::exec(args, &agent).await,
SubCommand::UpgradeSnsControlledCanister(args) => {
upgrade_sns_controlled_canister::exec(args, &agent)
.await
.map_err(|err| anyhow::anyhow!(err))
match upgrade_sns_controlled_canister::exec(args, &agent).await {
Ok(_) => Ok(()),
Err(err) => {
bail!("{}", err);
}
}
}
}
}
4 changes: 2 additions & 2 deletions rs/sns/cli/src/upgrade_sns_controlled_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ pub async fn exec<C: CallCanisters>(
let Some(sns) = &sns else {
unimplemented!(
"Direct canister upgrades are not implemented yet. Please use DFX:\n{}",
suggested_install_command(&wasm.path(), &candid_arg)
suggested_install_command(wasm.path(), &candid_arg)
);
};

Expand Down Expand Up @@ -591,7 +591,7 @@ fn suggested_install_command(wasm_path_str: &Path, candid_arg: &Option<String>)
};
format!(
"dfx canister install --mode auto --wasm {} CANISTER_NAME{}",
wasm_path_str.display().to_string(),
wasm_path_str.display(),
arg_suggestion,
)
}

0 comments on commit 238d139

Please sign in to comment.