From 2ec6162d94dd312e1343c7bff5d88bb8fdd19c60 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Tue, 3 Dec 2024 14:57:26 -0600 Subject: [PATCH] chore: update ic-agent to 0.39 (#4025) --- Cargo.lock | 40 ++++++++++--------- Cargo.toml | 6 +-- src/dfx/src/commands/canister/call.rs | 3 +- .../src/commands/canister/request_status.rs | 6 +-- src/dfx/src/commands/canister/send.rs | 2 +- src/dfx/src/lib/environment.rs | 2 +- 6 files changed, 32 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9aad469300..56e3888b1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1552,7 +1552,7 @@ dependencies = [ "ic-asset", "ic-cdk", "ic-identity-hsm", - "ic-utils 0.38.0", + "ic-utils 0.39.0", "ic-wasm", "icrc-ledger-types", "idl2json", @@ -1627,7 +1627,7 @@ dependencies = [ "humantime-serde", "ic-agent", "ic-identity-hsm", - "ic-utils 0.38.0", + "ic-utils 0.39.0", "itertools 0.10.5", "k256 0.11.6", "keyring", @@ -2674,23 +2674,27 @@ dependencies = [ [[package]] name = "ic-agent" -version = "0.38.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def8c34690d68caa452486af1fff4782d2f5a9d4c5b4e0e1afca648c616fa380" +checksum = "158138fcb769fe6288e63d5db221c904e472cfb7d376aba13a38c060f2984e63" dependencies = [ "async-lock 3.3.0", + "async-trait", "backoff", "cached 0.52.0", "candid", + "der 0.7.9", + "ecdsa 0.16.9", "ed25519-consensus", + "elliptic-curve 0.13.8", "futures-util", "hex", "http 1.1.0", "http-body 1.0.0", "ic-certification 2.6.0", - "ic-transport-types 0.38.0", + "ic-transport-types 0.39.1", "ic-verify-bls-signature", - "k256 0.13.3", + "k256 0.13.4", "leb128", "p256", "pem 3.0.4", @@ -2698,8 +2702,6 @@ dependencies = [ "rand", "rangemap", "reqwest", - "ring 0.17.8", - "rustls-webpki 0.102.3", "sec1 0.7.3", "serde", "serde_bytes", @@ -2710,6 +2712,7 @@ dependencies = [ "thiserror", "time", "tokio", + "tower-service", "url", ] @@ -2728,7 +2731,7 @@ dependencies = [ "globset", "hex", "ic-agent", - "ic-utils 0.38.0", + "ic-utils 0.39.0", "itertools 0.10.5", "json5", "mime", @@ -3115,9 +3118,9 @@ dependencies = [ [[package]] name = "ic-identity-hsm" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9975ba49e50ccf10d8268b168b9a35da165904f56725a333e8294d7e5f1d92" +checksum = "8722411845f0a4b2c526b906049d45f87c62c78ddf1c38ecdc03ecbd34ffc1d6" dependencies = [ "hex", "ic-agent", @@ -3233,9 +3236,9 @@ dependencies = [ [[package]] name = "ic-transport-types" -version = "0.38.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1834f2f91324b7263e0a05b95d385fd109b51efec991f053112d8cd2503d6e" +checksum = "2d8789a5c176bb1b925fa58ca97c651a3995d504e76101e93d2a17f558bdcf66" dependencies = [ "candid", "hex", @@ -3243,6 +3246,7 @@ dependencies = [ "leb128", "serde", "serde_bytes", + "serde_cbor", "serde_repr", "sha2 0.10.8", "thiserror", @@ -3303,9 +3307,9 @@ dependencies = [ [[package]] name = "ic-utils" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75135bc8838398f2b4a512b900ee1d58fbf34bdedb74aedc0ae772e785535814" +checksum = "bb1da4a68c45146018b8496c157ad94126b9c202ab4400c6c0a9030c1ef0f0ba" dependencies = [ "async-trait", "candid", @@ -3434,7 +3438,7 @@ dependencies = [ "humantime", "ic-agent", "ic-asset", - "ic-utils 0.38.0", + "ic-utils 0.39.0", "libflate 1.4.0", "num-traits", "pem 1.1.1", @@ -3682,9 +3686,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa 0.16.9", diff --git a/Cargo.toml b/Cargo.toml index 44f79885b3..64208950bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,11 +22,11 @@ license = "Apache-2.0" candid = "0.10.4" candid_parser = "0.1.4" dfx-core = { path = "src/dfx-core", version = "0.1.0" } -ic-agent = "0.38" +ic-agent = "0.39" ic-asset = { path = "src/canisters/frontend/ic-asset", version = "0.21.0" } ic-cdk = "0.13.1" -ic-identity-hsm = "0.38" -ic-utils = "0.38" +ic-identity-hsm = "0.39" +ic-utils = "0.39" aes-gcm = "0.10.3" anyhow = "1.0.56" diff --git a/src/dfx/src/commands/canister/call.rs b/src/dfx/src/commands/canister/call.rs index 4157f5c2bc..1a740f7307 100644 --- a/src/dfx/src/commands/canister/call.rs +++ b/src/dfx/src/commands/canister/call.rs @@ -358,7 +358,8 @@ To figure out the id of your wallet, run 'dfx identity get-wallet (--network ic) .with_arg(arg_value) .call() .await - .context("Failed update call.")?, + .context("Failed update call.")? + .map(|(res, _)| res), CallSender::Wallet(wallet_id) => { let wallet = build_wallet_canister(*wallet_id, agent).await?; let mut args = Argument::default(); diff --git a/src/dfx/src/commands/canister/request_status.rs b/src/dfx/src/commands/canister/request_status.rs index c481bcf798..bcc81b75e6 100644 --- a/src/dfx/src/commands/canister/request_status.rs +++ b/src/dfx/src/commands/canister/request_status.rs @@ -50,11 +50,11 @@ pub async fn exec(env: &dyn Environment, opts: RequestStatusOpts) -> DfxResult { let blob = async { let mut request_accepted = false; loop { - match agent + let (response, _cert) = agent .request_status_raw(&request_id, canister_id) .await - .context("Failed to fetch request status.")? - { + .context("Failed to fetch request status.")?; + match response { RequestStatusResponse::Replied(reply) => return Ok(reply.arg), RequestStatusResponse::Rejected(response) => { return Err(DfxError::new(AgentError::CertifiedReject(response))) diff --git a/src/dfx/src/commands/canister/send.rs b/src/dfx/src/commands/canister/send.rs index 94111dd58a..93bf612560 100644 --- a/src/dfx/src/commands/canister/send.rs +++ b/src/dfx/src/commands/canister/send.rs @@ -57,7 +57,7 @@ pub async fn exec( let request_id = request_id .parse::() .context("Failed to decode request ID.")?; - let response = agent + let (response, _cert) = agent .request_status_signed(&request_id, canister_id, envelope) .await .with_context(|| format!("Failed to read canister state of {}.", canister_id))?; diff --git a/src/dfx/src/lib/environment.rs b/src/dfx/src/lib/environment.rs index 6962f5d975..f1535949af 100644 --- a/src/dfx/src/lib/environment.rs +++ b/src/dfx/src/lib/environment.rs @@ -418,7 +418,7 @@ pub fn create_agent( .with_url(url) .with_boxed_identity(identity) .with_verify_query_signatures(!disable_query_verification) - .with_ingress_expiry(Some(timeout)) + .with_ingress_expiry(timeout) .build()?; Ok(agent) }