diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 47eda7ac..fb9be897 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -6,25 +6,27 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install latest nightly + - name: Install compatible nightly toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly + toolchain: nightly-2023-02-07 target: x86_64-unknown-linux-gnu components: rustfmt, clippy - name: Install dependencies run: | - rustup target add wasm32-unknown-unknown --toolchain nightly - rustup component add rust-src --toolchain nightly-unknown-linux-gnu + rustup target add wasm32-unknown-unknown --toolchain nightly-2023-02-07 + rustup component add rust-src --toolchain nightly-2023-02-07-unknown-linux-gnu sudo apt-get install binaryen - cargo install cargo-contract --version ^0.14 --force --locked + cargo install cargo-dylint + cargo install dylint-link + cargo install cargo-contract --version 1.5.0 --force --locked - name: Run tests run: | - RUSTFLAGS=-Awarnings cargo test + RUSTFLAGS=-Awarnings cargo +nightly-2023-02-07 test - name: Build contract run: | - cargo contract build --release --manifest-path bucket/Cargo.toml + cargo +nightly-2023-02-07 contract build --release --manifest-path bucket/Cargo.toml - name: Create names linked to commit run: | ddc_contract_name=ddc.${GITHUB_SHA:0:7}.contract diff --git a/bucket/ddc_bucket/bucket/entity.rs b/bucket/ddc_bucket/bucket/entity.rs index f8bdc589..00335ac9 100644 --- a/bucket/ddc_bucket/bucket/entity.rs +++ b/bucket/ddc_bucket/bucket/entity.rs @@ -26,6 +26,8 @@ pub struct Bucket { pub resource_consumption_cap: Resource, } +// https://use.ink/3.x/ink-vs-solidity#nested-mappings--custom--advanced-structures +#[allow(unconditional_recursion)] impl ink_storage::traits::PackedAllocate for Bucket { fn allocate_packed(&mut self, at: &Key) { PackedAllocate::allocate_packed(&mut *self, at) diff --git a/bucket/ddc_bucket/cdn_cluster/entity.rs b/bucket/ddc_bucket/cdn_cluster/entity.rs index a1d23dab..8b12f810 100644 --- a/bucket/ddc_bucket/cdn_cluster/entity.rs +++ b/bucket/ddc_bucket/cdn_cluster/entity.rs @@ -25,6 +25,8 @@ pub struct CdnCluster { pub usd_per_gb: Balance, } +// https://use.ink/3.x/ink-vs-solidity#nested-mappings--custom--advanced-structures +#[allow(unconditional_recursion)] impl ink_storage::traits::PackedAllocate for CdnCluster { fn allocate_packed(&mut self, at: &Key) { PackedAllocate::allocate_packed(&mut *self, at) diff --git a/bucket/ddc_bucket/cdn_node/entity.rs b/bucket/ddc_bucket/cdn_node/entity.rs index 578e2ac9..32584cb7 100644 --- a/bucket/ddc_bucket/cdn_node/entity.rs +++ b/bucket/ddc_bucket/cdn_node/entity.rs @@ -17,6 +17,8 @@ pub struct CdnNode { pub undistributed_payment: Balance, } +// https://use.ink/3.x/ink-vs-solidity#nested-mappings--custom--advanced-structures +#[allow(unconditional_recursion)] impl ink_storage::traits::PackedAllocate for CdnNode { fn allocate_packed(&mut self, at: &Key) { PackedAllocate::allocate_packed(&mut *self, at) diff --git a/bucket/ddc_bucket/cluster/entity.rs b/bucket/ddc_bucket/cluster/entity.rs index 84cd6d3b..35e435d9 100644 --- a/bucket/ddc_bucket/cluster/entity.rs +++ b/bucket/ddc_bucket/cluster/entity.rs @@ -29,6 +29,8 @@ pub struct Cluster { pub total_rent: Balance, } +// https://use.ink/3.x/ink-vs-solidity#nested-mappings--custom--advanced-structures +#[allow(unconditional_recursion)] impl ink_storage::traits::PackedAllocate for Cluster { fn allocate_packed(&mut self, at: &Key) { PackedAllocate::allocate_packed(&mut *self, at) diff --git a/bucket/ddc_bucket/node/entity.rs b/bucket/ddc_bucket/node/entity.rs index 75efa26d..b7f5a8a8 100644 --- a/bucket/ddc_bucket/node/entity.rs +++ b/bucket/ddc_bucket/node/entity.rs @@ -22,6 +22,8 @@ pub struct Node { pub node_tag: NodeTag, } +// https://use.ink/3.x/ink-vs-solidity#nested-mappings--custom--advanced-structures +#[allow(unconditional_recursion)] impl ink_storage::traits::PackedAllocate for Node { fn allocate_packed(&mut self, at: &Key) { PackedAllocate::allocate_packed(&mut *self, at)