Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #72 from Cerebellum-Network/fix/build-and-push-wor…
Browse files Browse the repository at this point in the history
…kflow

Workflow for "build-and-push" is fixed for `ink! 3.4.0`
  • Loading branch information
yahortsaryk authored May 24, 2023
2 parents f7f70f6 + d362ba0 commit d3bd72b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions bucket/ddc_bucket/bucket/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions bucket/ddc_bucket/cdn_cluster/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions bucket/ddc_bucket/cdn_node/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions bucket/ddc_bucket/cluster/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions bucket/ddc_bucket/node/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d3bd72b

Please sign in to comment.