Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: change type of skip_pre_upgrade #516

Merged
merged 1 commit into from
Feb 20, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Changed the return type of `stored_chunks` to a struct.
* Added a prime256v1-based `Identity` impl to complement the ed25519 and secp256k1 `Identity` impls.
* Added serde and candid serialization traits to the `Status` type.
* Changed the type of `InstallMode.skip_pre_upgrade` from `bool` to `Option<bool>` to match the interface specification.

## [0.32.0] - 2024-01-18

Expand Down
6 changes: 3 additions & 3 deletions ic-utils/src/interfaces/management_canister/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct CanisterSettings {
pub controllers: Option<Vec<Principal>>,
/// The allocation percentage (between 0 and 100 inclusive) for *guaranteed* compute capacity.
///
/// The settings update will be rejected if the IC can't commit to allocating this much compupte capacity.
/// The settings update will be rejected if the IC can't commit to allocating this much compute capacity.
///
/// If unspecified and a canister is being created with these settings, defaults to 0, i.e. best-effort.
pub compute_allocation: Option<Nat>,
Expand Down Expand Up @@ -392,7 +392,7 @@ pub enum InstallMode {
#[serde(rename = "upgrade")]
Upgrade {
/// If true, skip a canister's `#[pre_upgrade]` function.
skip_pre_upgrade: bool,
skip_pre_upgrade: Option<bool>,
},
}

Expand All @@ -419,7 +419,7 @@ impl FromStr for InstallMode {
"install" => Ok(InstallMode::Install),
"reinstall" => Ok(InstallMode::Reinstall),
"upgrade" => Ok(InstallMode::Upgrade {
skip_pre_upgrade: false,
skip_pre_upgrade: Some(false),
}),
&_ => Err(format!("Invalid install mode: {}", s)),
}
Expand Down
6 changes: 3 additions & 3 deletions ref-tests/tests/ic-ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ mod management_canister {
// Upgrade should succeed.
ic00.install_code(&canister_id, &canister_wasm)
.with_mode(InstallMode::Upgrade {
skip_pre_upgrade: false,
skip_pre_upgrade: None,
})
.call_and_wait()
.await?;
Expand All @@ -171,7 +171,7 @@ mod management_canister {
let result = other_ic00
.install_code(&canister_id, &canister_wasm)
.with_mode(InstallMode::Upgrade {
skip_pre_upgrade: false,
skip_pre_upgrade: None,
})
.call_and_wait()
.await;
Expand Down Expand Up @@ -486,7 +486,7 @@ mod management_canister {
// Upgrade should succeed
ic00.install_code(&canister_id, &canister_wasm)
.with_mode(InstallMode::Upgrade {
skip_pre_upgrade: false,
skip_pre_upgrade: None,
})
.call_and_wait()
.await?;
Expand Down
Loading