Skip to content
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
4 changes: 1 addition & 3 deletions crates/icp-cli/src/commands/canister/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ pub(crate) async fn exec(ctx: &Context, args: &CreateArgs) -> Result<(), Command
.filter_map(|(_, c)| {
ctx.ids
.lookup(&Key {
network: env.network.name.to_owned(),
environment: env.name.to_owned(),
canister: c.name.to_owned(),
})
Expand Down Expand Up @@ -239,9 +238,8 @@ pub(crate) async fn exec(ctx: &Context, args: &CreateArgs) -> Result<(), Command
// Indicate to user that the canister is created
pb.set_message("Creating...");

// Create canister-network association-key
// Create canister-environment association-key
let k = Key {
network: env_ref.network.name.to_owned(),
environment: env_ref.name.to_owned(),
canister: name.to_string(),
};
Expand Down
1 change: 0 additions & 1 deletion crates/icp-cli/src/commands/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ pub(crate) async fn exec(ctx: &Context, args: &SyncArgs) -> Result<(), CommandEr

// Get canister principal ID
let cid = ctx.ids.lookup(&Key {
network: env.network.name.to_owned(),
environment: env.name.to_owned(),
canister: c.name.to_owned(),
})?;
Expand Down
1 change: 0 additions & 1 deletion crates/icp/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ impl Context {
let cid = self
.ids
.lookup(&Key {
network: env.network.name.to_owned(),
environment: env.name.to_owned(),
canister: canister_name.to_owned(),
})
Expand Down
2 changes: 0 additions & 2 deletions crates/icp/src/context/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ async fn test_get_canister_id_for_env_success() {
ids_store
.register(
&Key {
network: "local".to_string(),
environment: "dev".to_string(),
canister: "backend".to_string(),
},
Expand Down Expand Up @@ -337,7 +336,6 @@ async fn test_get_canister_id() {
ids_store
.register(
&Key {
network: "local".to_string(),
environment: "dev".to_string(),
canister: "backend".to_string(),
},
Expand Down
11 changes: 4 additions & 7 deletions crates/icp/src/store_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ pub trait Access: Sync + Send {
/// An association-key, used for associating an existing canister to an ID on a network
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct Key {
/// Network name
pub network: String,

/// Environment name
pub environment: String,

Expand All @@ -46,8 +43,8 @@ pub enum RegisterError {
RegisterLoadStore { source: json::Error },

#[snafu(display(
"canister '{}' in environment '{}', associated with network '{}' is already registered with id '{id}'",
key.canister, key.environment, key.network,
"canister '{}' in environment '{}' is already registered with id '{id}'",
key.canister, key.environment,
))]
AlreadyRegistered { key: Key, id: Principal },

Expand All @@ -61,8 +58,8 @@ pub enum LookupIdError {
LookupLoadStore { source: json::Error },

#[snafu(display(
"could not find ID for canister '{}' in environment '{}', associated with network '{}'",
key.canister, key.environment, key.network
"could not find ID for canister '{}' in environment '{}'",
key.canister, key.environment
))]
IdNotFound { key: Key },

Expand Down