Skip to content

Commit f3fd4f8

Browse files
author
Frederik Rothenberger
authored
Update ic-cdk and ic dependencies (#1219)
This PR updates ic-cdk to v0.7 and ic to the latest master. The most notable change in ic-cdk is that the timers feature is now its own crate ic-cdk-timers. In addition, all other dependencies were upgraded within their minor version.
1 parent d3a0b9d commit f3fd4f8

File tree

10 files changed

+455
-342
lines changed

10 files changed

+455
-342
lines changed

Cargo.lock

Lines changed: 237 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/test-app/Cargo.lock

Lines changed: 204 additions & 152 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/test-app/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ crate-type = ["cdylib"]
1515
base64 = "0.21"
1616
lazy_static = "1.4"
1717
candid = "0.8"
18-
ic-cdk = "0.6"
18+
ic-cdk = "0.7"
1919
ic-cdk-macros = "0.6"
2020
ic-certified-map = "0.3"
2121
sha2 = "^0.10" # set bound to match ic-certified-map bound

src/archive/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ edition = "2021"
1111
internet_identity_interface = { path = "../internet_identity_interface" }
1212
# ic dependencies
1313
candid = "0.8"
14-
ic-cdk = { version = "0.6", features = ["timers"] }
14+
ic-cdk = "0.7"
15+
ic-cdk-timers = "0.1"
1516
ic-cdk-macros = "0.6"
1617
ic-metrics-encoder = "1"
1718
ic-stable-structures = "0.5"

src/archive/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ use ic_cdk::api::call::CallResult;
4141
use ic_cdk::api::management_canister::main::{canister_status, CanisterIdRecord};
4242
use ic_cdk::api::stable::stable64_size;
4343
use ic_cdk::api::time;
44-
use ic_cdk::timer::set_timer_interval;
4544
use ic_cdk::{call, caller, id, print, trap};
4645
use ic_cdk_macros::{init, post_upgrade, query, update};
46+
use ic_cdk_timers::set_timer_interval;
4747
use ic_metrics_encoder::MetricsEncoder;
4848
use ic_stable_structures::memory_manager::{MemoryId, MemoryManager, VirtualMemory};
4949
use ic_stable_structures::{

src/canister_tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internet_identity_interface = { path = "../internet_identity_interface" }
1919

2020
# All IC deps
2121
candid = "0.8"
22-
ic-cdk = "0.6"
22+
ic-cdk = "0.7"
2323
ic-types = { git = "https://github.com/dfinity/ic" }
2424
ic-sdk-certification = { package="ic-certification", version="0.23" }
2525
ic-certification = { git = "https://github.com/dfinity/ic" }

src/internet_identity/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ captcha = "0.0.9"
2626

2727
# All IC deps
2828
candid = "0.8"
29-
ic-cdk = "0.6"
29+
ic-cdk = "0.7"
3030
ic-cdk-macros = "0.6"
3131
ic-certified-map = "0.3"
3232
ic-metrics-encoder = "1"

src/internet_identity/src/assets.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// This file describes which assets are used and how (content, content type and content encoding).
44

55
use crate::{http, state};
6+
use base64::engine::general_purpose::STANDARD as BASE64;
7+
use base64::Engine;
68
use ic_cdk::api;
79
use lazy_static::lazy_static;
810
use sha2::Digest;
@@ -49,7 +51,7 @@ lazy_static! {
4951
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src
5052
pub static ref JS_SETUP_SCRIPT_SRI_HASH: String = {
5153
let hash = &sha2::Sha256::digest(JS_SETUP_SCRIPT.as_bytes());
52-
let hash = base64::encode(hash);
54+
let hash = BASE64.encode(hash);
5355
format!("sha256-{hash}")
5456
};
5557

src/internet_identity/src/http.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use crate::archive::ArchiveState;
22
use crate::assets::ContentType;
33
use crate::{assets, state, LABEL_ASSETS, LABEL_SIG};
4+
use base64::engine::general_purpose::STANDARD as BASE64;
5+
use base64::Engine;
46
use ic_cdk::api::stable::stable64_size;
57
use ic_cdk::api::{data_certificate, time};
68
use ic_cdk::trap;
@@ -311,8 +313,8 @@ fn make_asset_certificate_header(asset_name: &str) -> (String, String) {
311313
"IC-Certificate".to_string(),
312314
format!(
313315
"certificate=:{}:, tree=:{}:",
314-
base64::encode(&certificate),
315-
base64::encode(serializer.into_inner())
316+
BASE64.encode(&certificate),
317+
BASE64.encode(serializer.into_inner())
316318
),
317319
)
318320
})

src/internet_identity_interface/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ edition = "2021"
99
serde_bytes = "0.11"
1010
candid = "0.8"
1111
serde = "1"
12-
ic-cdk = "0.6"
12+
ic-cdk = "0.7"

0 commit comments

Comments
 (0)