From 1bbb287cece43339abc50e60c3d3c471f306a72c Mon Sep 17 00:00:00 2001 From: Andriy Berestovskyy Date: Fri, 8 Dec 2023 10:09:37 +0100 Subject: [PATCH] Update `rust/periodic_tasks` example * bump up `dfx` version * autoformat files * `cargo update` * add `rust-toolchain.toml` --- .github/workflows/rust-periodic_tasks-example.yaml | 8 ++------ rust/periodic_tasks/Cargo.lock | 4 ++-- rust/periodic_tasks/dfx.json | 2 +- rust/periodic_tasks/heartbeat/Cargo.toml | 8 ++++---- rust/periodic_tasks/heartbeat/heartbeat.did | 10 +++++----- rust/periodic_tasks/rust-toolchain.toml | 4 ++++ rust/periodic_tasks/timer/Cargo.toml | 10 +++++----- rust/periodic_tasks/timer/timer.did | 10 +++++----- 8 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 rust/periodic_tasks/rust-toolchain.toml diff --git a/.github/workflows/rust-periodic_tasks-example.yaml b/.github/workflows/rust-periodic_tasks-example.yaml index 9d8c3da5a..29e6ee431 100644 --- a/.github/workflows/rust-periodic_tasks-example.yaml +++ b/.github/workflows/rust-periodic_tasks-example.yaml @@ -18,9 +18,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Provision Darwin - env: - DFX_VERSION: 0.13.1 - run: bash .github/workflows/provision-darwin.sh + run: DFX_VERSION="0.15.2" bash .github/workflows/provision-darwin.sh - name: Rust Periodic Tasks Darwin run: | dfx start --background @@ -32,9 +30,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Provision Linux - env: - DFX_VERSION: 0.13.1 - run: bash .github/workflows/provision-linux.sh + run: DFX_VERSION="0.15.2" bash .github/workflows/provision-linux.sh - name: Rust Periodic Tasks Linux run: | dfx start --background diff --git a/rust/periodic_tasks/Cargo.lock b/rust/periodic_tasks/Cargo.lock index 6fe5ccd8b..68c4dd3ca 100644 --- a/rust/periodic_tasks/Cargo.lock +++ b/rust/periodic_tasks/Cargo.lock @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "slotmap" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ "version_check", ] diff --git a/rust/periodic_tasks/dfx.json b/rust/periodic_tasks/dfx.json index 2a6cc644a..2400e138f 100644 --- a/rust/periodic_tasks/dfx.json +++ b/rust/periodic_tasks/dfx.json @@ -12,4 +12,4 @@ } }, "version": 1 -} +} \ No newline at end of file diff --git a/rust/periodic_tasks/heartbeat/Cargo.toml b/rust/periodic_tasks/heartbeat/Cargo.toml index b460d79c2..d9f3263b9 100644 --- a/rust/periodic_tasks/heartbeat/Cargo.toml +++ b/rust/periodic_tasks/heartbeat/Cargo.toml @@ -1,12 +1,12 @@ [package] +edition = "2021" name = "heartbeat" version = "1.0.0" -edition = "2021" [lib] crate-type = ["cdylib"] [dependencies] -candid = "0.10.0" -ic-cdk = "0.12.0" -ic-cdk-macros = "0.8.2" +candid = "0.10" +ic-cdk = "0.12" +ic-cdk-macros = "0.8" diff --git a/rust/periodic_tasks/heartbeat/heartbeat.did b/rust/periodic_tasks/heartbeat/heartbeat.did index 8019d7139..0ad6279c9 100644 --- a/rust/periodic_tasks/heartbeat/heartbeat.did +++ b/rust/periodic_tasks/heartbeat/heartbeat.did @@ -1,6 +1,6 @@ service : (nat64) -> { - "counter": () -> (nat32) query; - "set_interval_secs": (nat64) -> (); - "stop": () -> (); - "cycles_used": () -> (nat64) query; -} + "counter" : () -> (nat32) query; + "set_interval_secs" : (nat64) -> (); + "stop" : () -> (); + "cycles_used" : () -> (nat64) query; +}; diff --git a/rust/periodic_tasks/rust-toolchain.toml b/rust/periodic_tasks/rust-toolchain.toml new file mode 100644 index 000000000..f8bb13962 --- /dev/null +++ b/rust/periodic_tasks/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.74" +targets = ["wasm32-unknown-unknown"] +components = ["rustfmt", "clippy"] diff --git a/rust/periodic_tasks/timer/Cargo.toml b/rust/periodic_tasks/timer/Cargo.toml index 40519197b..3838a9650 100644 --- a/rust/periodic_tasks/timer/Cargo.toml +++ b/rust/periodic_tasks/timer/Cargo.toml @@ -1,15 +1,15 @@ [package] +edition = "2021" name = "timer" version = "1.0.0" -edition = "2021" [lib] crate-type = ["cdylib"] [dependencies] -candid = "0.10.0" +candid = "0.10" # Base Rust CDK crate provides support for heartbeats only. -ic-cdk = "0.12.0" +ic-cdk = "0.12" # The timers library is required for multiple and periodic timers. -ic-cdk-timers = "0.6.0" -ic-cdk-macros = "0.8.2" +ic-cdk-macros = "0.8" +ic-cdk-timers = "0.6" diff --git a/rust/periodic_tasks/timer/timer.did b/rust/periodic_tasks/timer/timer.did index 81af22721..b88683925 100644 --- a/rust/periodic_tasks/timer/timer.did +++ b/rust/periodic_tasks/timer/timer.did @@ -1,6 +1,6 @@ service : (nat64) -> { - "counter": () -> (nat32) query; - "start_with_interval_secs": (nat64) -> (); - "stop": () -> (); - "cycles_used": () -> (nat64) query; -} + "counter" : () -> (nat32) query; + "start_with_interval_secs" : (nat64) -> (); + "stop" : () -> (); + "cycles_used" : () -> (nat64) query; +};