-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrating a call to cmc canister to fetch previous public subnets
- Loading branch information
1 parent
83230c0
commit e1441a8
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use ic_nns_constants::CYCLES_MINTING_CANISTER_ID; | ||
use ic_types::{CanisterId, PrincipalId}; | ||
|
||
use crate::IcAgentCanisterClient; | ||
|
||
pub struct CyclesMintingCanisterWrapper { | ||
agent: IcAgentCanisterClient, | ||
canister_id: CanisterId, | ||
} | ||
|
||
impl From<IcAgentCanisterClient> for CyclesMintingCanisterWrapper { | ||
fn from(value: IcAgentCanisterClient) -> Self { | ||
Self { | ||
agent: value, | ||
canister_id: CYCLES_MINTING_CANISTER_ID.clone(), | ||
} | ||
} | ||
} | ||
|
||
impl CyclesMintingCanisterWrapper { | ||
pub async fn get_authorized_subnets(&self) -> anyhow::Result<Vec<PrincipalId>> { | ||
self.agent | ||
.query(&self.canister_id.into(), "get_default_subnets", candid::encode_one(())?) | ||
.await | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters