Skip to content

Commit

Permalink
feat: Add CanisterInfo. (#628)
Browse files Browse the repository at this point in the history
* Add CanisterInfo for management canister.

* Update changelog.

* Fixed format.

* Force to use ubuntu-22.04 as node 14 is not supported on ubuntu-24.04.
  • Loading branch information
vincent-dfinity authored Jan 15, 2025
1 parent a651dbb commit 446bea4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macos-13-large, ubuntu-latest ]
os: [ macos-13-large, ubuntu-22.04 ]
dfx: [ '0.8.4', '0.9.2', '0.10.1', '0.11.1' ]

steps:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Added `wasm_memory_threshold` field to `CanisterSettings`.

* Added `CanisterInfo` to `MgmtMethod`.

## [0.39.2] - 2024-12-20

* Bumped `ic-certification` to `3.0.0`.
Expand Down
2 changes: 2 additions & 0 deletions ic-utils/src/interfaces/management_canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub enum MgmtMethod {
BitcoinGetBlockHeaders,
/// There is no corresponding agent function as only canisters can call it.
NodeMetricsHistory,
/// There is no corresponding agent function as only canisters can call it.
CanisterInfo,
}

impl<'agent> ManagementCanister<'agent> {
Expand Down
3 changes: 2 additions & 1 deletion icx/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ pub fn get_effective_canister_id(
| MgmtMethod::BitcoinGetBlockHeaders
| MgmtMethod::EcdsaPublicKey
| MgmtMethod::SignWithEcdsa
| MgmtMethod::NodeMetricsHistory => {
| MgmtMethod::NodeMetricsHistory
| MgmtMethod::CanisterInfo => {
bail!("Management canister method {method_name} can only be run from canisters");
}
}
Expand Down

0 comments on commit 446bea4

Please sign in to comment.