Skip to content

Commit 63cfaf4

Browse files
committed
chore: update with latest ICP crates
1 parent 5842ada commit 63cfaf4

12 files changed

Lines changed: 281 additions & 284 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ sha2 = "0.10"
5050
sha3 = "0.10"
5151
k256 = { version = "0.13" }
5252
num-traits = "0.2"
53-
ic-agent = "0.44"
54-
ic-cdk = "0.18"
55-
ic-cdk-timers = "0.12"
53+
ic-agent = "0.45"
54+
ic-cdk = "0.19"
55+
ic-cdk-timers = "1.0"
5656
ic-stable-structures = "0.7"
5757
icrc-ledger-types = "0.1"
5858
ic_auth_types = "0.7"

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,7 @@ test:
1414

1515
# cargo install ic-wasm
1616
build-wasm:
17-
cargo build --release --target wasm32-unknown-unknown --package ic_delegation_store
18-
cargo build --release --target wasm32-unknown-unknown --package ic_dmsg_minter
19-
cargo build --release --target wasm32-unknown-unknown --package ic_message
20-
cargo build --release --target wasm32-unknown-unknown --package ic_message_channel
21-
cargo build --release --target wasm32-unknown-unknown --package ic_message_profile
22-
cargo build --release --target wasm32-unknown-unknown --package ic_name_identity
23-
cargo build --release --target wasm32-unknown-unknown --package ic_panda_luckypool
24-
cargo build --release --target wasm32-unknown-unknown --package ic_signin_with
17+
cargo build --release --target wasm32-unknown-unknown -p ic_delegation_store -p ic_dmsg_minter -p ic_message -p ic_message_channel -p ic_message_profile -p ic_name_identity -p ic_panda_luckypool -p ic_signin_with
2518

2619
# cargo install candid-extractor
2720
build-did:

src/ic_message/ic_message.did

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ type CanisterStatusResult = record {
99
memory_metrics : MemoryMetrics;
1010
status : CanisterStatusType;
1111
memory_size : nat;
12+
ready_for_migration : bool;
13+
version : nat64;
1214
cycles : nat;
1315
settings : DefiniteCanisterSettings;
1416
query_stats : QueryStats;
@@ -81,13 +83,15 @@ type CreateChannelInput = record {
8183
type DefiniteCanisterSettings = record {
8284
freezing_threshold : nat;
8385
wasm_memory_threshold : nat;
86+
environment_variables : vec EnvironmentVariable;
8487
controllers : vec principal;
8588
reserved_cycles_limit : nat;
8689
log_visibility : LogVisibility;
8790
wasm_memory_limit : nat;
8891
memory_allocation : nat;
8992
compute_allocation : nat;
9093
};
94+
type EnvironmentVariable = record { value : text; name : text };
9195
type GetArchivesArgs = record { from : opt principal };
9296
type GetBlocksRequest = record { start : nat; length : nat };
9397
type GetBlocksResult = record {

src/ic_message/src/api_init.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ fn init(args: Option<ChainArgs>) {
5454
}
5555
}
5656

57-
ic_cdk_timers::set_timer(Duration::from_secs(0), || {
58-
ic_cdk::futures::spawn(store::state::try_init_public_key())
59-
});
57+
ic_cdk_timers::set_timer(Duration::from_secs(0), store::state::try_init_public_key());
6058
}
6159

6260
#[ic_cdk::pre_upgrade]

src/ic_message_channel/ic_message_channel.did

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type CanisterStatusResult = record {
1414
memory_metrics : MemoryMetrics;
1515
status : CanisterStatusType;
1616
memory_size : nat;
17+
ready_for_migration : bool;
18+
version : nat64;
1719
cycles : nat;
1820
settings : DefiniteCanisterSettings;
1921
query_stats : QueryStats;
@@ -98,6 +100,7 @@ type CreateChannelInput = record {
98100
type DefiniteCanisterSettings = record {
99101
freezing_threshold : nat;
100102
wasm_memory_threshold : nat;
103+
environment_variables : vec EnvironmentVariable;
101104
controllers : vec principal;
102105
reserved_cycles_limit : nat;
103106
log_visibility : LogVisibility;
@@ -110,6 +113,7 @@ type DownloadFilesToken = record {
110113
storage : record { principal; nat32 };
111114
access_token : blob;
112115
};
116+
type EnvironmentVariable = record { value : text; name : text };
113117
type InitArgs = record { managers : vec principal; name : text };
114118
type LogVisibility = variant {
115119
controllers;

src/ic_message_profile/ic_message_profile.did

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ type CanisterStatusResult = record {
33
memory_metrics : MemoryMetrics;
44
status : CanisterStatusType;
55
memory_size : nat;
6+
ready_for_migration : bool;
7+
version : nat64;
68
cycles : nat;
79
settings : DefiniteCanisterSettings;
810
query_stats : QueryStats;
@@ -16,13 +18,15 @@ type ChannelSetting = record { pin : nat32; alias : text; tags : vec text };
1618
type DefiniteCanisterSettings = record {
1719
freezing_threshold : nat;
1820
wasm_memory_threshold : nat;
21+
environment_variables : vec EnvironmentVariable;
1922
controllers : vec principal;
2023
reserved_cycles_limit : nat;
2124
log_visibility : LogVisibility;
2225
wasm_memory_limit : nat;
2326
memory_allocation : nat;
2427
compute_allocation : nat;
2528
};
29+
type EnvironmentVariable = record { value : text; name : text };
2630
type InitArgs = record { managers : vec principal; name : text };
2731
type Link = record { uri : text; title : text; image : opt text };
2832
type LogVisibility = variant {

src/ic_panda_luckypool/src/api_admin.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ fn manager_start_airdrops108() -> Result<bool, String> {
313313
if !airdrops108.status < 1 {
314314
airdrops108.status = 1;
315315
let delay = AIRDROP108_TIME_NS.saturating_sub(ic_cdk::api::time());
316-
ic_cdk_timers::set_timer(Duration::from_nanos(delay), || {
317-
ic_cdk::futures::spawn(store::state::start_airdrops108())
318-
});
316+
ic_cdk_timers::set_timer(
317+
Duration::from_nanos(delay),
318+
store::state::start_airdrops108(),
319+
);
319320
return true;
320321
}
321322
}

src/ic_panda_luckypool/src/api_init.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use crate::store;
66
fn init() {
77
store::state::save();
88

9-
ic_cdk_timers::set_timer(Duration::from_nanos(0), || {
10-
ic_cdk::futures::spawn(store::keys::load())
11-
});
9+
ic_cdk_timers::set_timer(Duration::from_nanos(0), store::keys::load());
1210
}
1311

1412
#[ic_cdk::pre_upgrade]
@@ -21,12 +19,10 @@ pub fn pre_upgrade() {
2119
fn post_upgrade() {
2220
store::state::load();
2321

24-
ic_cdk_timers::set_timer(Duration::from_nanos(0), || {
25-
ic_cdk::futures::spawn(store::keys::load())
26-
});
22+
ic_cdk_timers::set_timer(Duration::from_nanos(0), store::keys::load());
2723

2824
// canister_global_timer can not support unbounded type!!!
29-
ic_cdk_timers::set_timer_interval(Duration::from_secs(2 * 60), || {
25+
ic_cdk_timers::set_timer_interval(Duration::from_secs(2 * 60), || async {
3026
store::prize::handle_refund_jobs();
3127
});
3228
}

src/ic_panda_luckypool/src/store.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,9 +1474,7 @@ pub mod state {
14741474
pub async fn start_airdrops108() {
14751475
match process_airdrops108().await {
14761476
Ok(true) => {
1477-
ic_cdk_timers::set_timer(Duration::from_nanos(0), || {
1478-
ic_cdk::futures::spawn(start_airdrops108())
1479-
});
1477+
ic_cdk_timers::set_timer(Duration::from_nanos(0), start_airdrops108());
14801478
}
14811479
Ok(false) => {
14821480
with_mut(|s| {

0 commit comments

Comments
 (0)