From c90ee6dc3bc81e0df7dd340085a234ec4844e8cd Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 8 May 2025 14:36:38 +0700 Subject: [PATCH 1/4] chore(api/examples/fungible): bump drink version --- pop-api/examples/fungibles/Cargo.toml | 2 +- pop-api/examples/fungibles/tests.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pop-api/examples/fungibles/Cargo.toml b/pop-api/examples/fungibles/Cargo.toml index b636d1234..e1d88397f 100644 --- a/pop-api/examples/fungibles/Cargo.toml +++ b/pop-api/examples/fungibles/Cargo.toml @@ -11,7 +11,7 @@ pop-api = { path = "../../../pop-api", default-features = false, features = [ ] } [dev-dependencies] -drink = { package = "pop-drink", git = "https://github.com/r0gue-io/pop-drink" } +drink = { package = "pop-drink", git = "https://github.com/r0gue-io/pop-drink", branch = "chungquantin/chore-stable2503", features = [ "devnet" ] } env_logger = { version = "0.11.3" } serde_json = "1.0.114" diff --git a/pop-api/examples/fungibles/tests.rs b/pop-api/examples/fungibles/tests.rs index b41f177d2..1fcc6c4dd 100644 --- a/pop-api/examples/fungibles/tests.rs +++ b/pop-api/examples/fungibles/tests.rs @@ -3,7 +3,7 @@ use drink::{ devnet::{ account_id_from_slice, error::{ - v0::{ApiError::*, ArithmeticError::*, Error}, + v0::{ApiError::*, ArithmeticError::*, Error, TokenError::UnknownAsset}, Assets, AssetsError::*, }, @@ -557,7 +557,7 @@ fn mint_fails_with_token_not_live(mut session: Session) { // Token is not live, i.e. frozen or being destroyed. assert_ok!(session.sandbox().start_destroy(&TOKEN)); // `pallet-assets` returns `AssetNotLive` error. - assert_err!(mint(&mut session, ALICE, AMOUNT), Error::Module(Assets(AssetNotLive))); + assert_err!(mint(&mut session, ALICE, AMOUNT), Error::Raw(Token(UnknownAsset))); } #[drink::test(sandbox = Pop)] From ccc6d987e314e15a27b233596b64369ce497dc2c Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 8 May 2025 14:52:28 +0700 Subject: [PATCH 2/4] chore(ci): test contract in examples --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdbb31c88..538221f0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,7 +166,7 @@ jobs: working-directory: pop-api run: cargo test --release --locked --all-features - api-examples: + api-examples-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -176,15 +176,15 @@ jobs: - name: Install `cargo-contract` run: cargo install --force --locked cargo-contract - - name: Check example contracts + - name: Test example contracts working-directory: pop-api/examples shell: bash run: | set -e for example in */ ; do if [ -d "$example" ]; then - echo "Checking contract in $example" - (cd "$example" && cargo contract check) + echo "Test contract in $example" + (cd "$example" && cargo test --release) fi done From 80eaa4547371f7d9989ec8354f50651498a8eed6 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 12 May 2025 13:58:57 +0700 Subject: [PATCH 3/4] chore: update drink dependency branch --- pop-api/examples/fungibles/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pop-api/examples/fungibles/Cargo.toml b/pop-api/examples/fungibles/Cargo.toml index e1d88397f..21ebc0cf5 100644 --- a/pop-api/examples/fungibles/Cargo.toml +++ b/pop-api/examples/fungibles/Cargo.toml @@ -11,7 +11,7 @@ pop-api = { path = "../../../pop-api", default-features = false, features = [ ] } [dev-dependencies] -drink = { package = "pop-drink", git = "https://github.com/r0gue-io/pop-drink", branch = "chungquantin/chore-stable2503", features = [ "devnet" ] } +drink = { package = "pop-drink", git = "https://github.com/r0gue-io/pop-drink", features = [ "devnet" ] } env_logger = { version = "0.11.3" } serde_json = "1.0.114" From dff975846c527a8b86ae23a454ed62b9369de2e8 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 15 May 2025 10:36:53 +0700 Subject: [PATCH 4/4] chore: resolve review comments --- .github/workflows/ci.yml | 3 --- pop-api/examples/fungibles/tests.rs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 538221f0b..b238bd4e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -173,9 +173,6 @@ jobs: - uses: "./.github/actions/init" - - name: Install `cargo-contract` - run: cargo install --force --locked cargo-contract - - name: Test example contracts working-directory: pop-api/examples shell: bash diff --git a/pop-api/examples/fungibles/tests.rs b/pop-api/examples/fungibles/tests.rs index 1fcc6c4dd..dc963a620 100644 --- a/pop-api/examples/fungibles/tests.rs +++ b/pop-api/examples/fungibles/tests.rs @@ -556,7 +556,7 @@ fn mint_fails_with_token_not_live(mut session: Session) { session.set_actor(ALICE); // Token is not live, i.e. frozen or being destroyed. assert_ok!(session.sandbox().start_destroy(&TOKEN)); - // `pallet-assets` returns `AssetNotLive` error. + // `pallet-assets` returns `UnknownAsset` error. assert_err!(mint(&mut session, ALICE, AMOUNT), Error::Raw(Token(UnknownAsset))); }