diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdbb31c88..b238bd4e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,25 +166,22 @@ 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 - uses: "./.github/actions/init" - - 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 diff --git a/pop-api/examples/fungibles/Cargo.toml b/pop-api/examples/fungibles/Cargo.toml index b636d1234..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" } +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" diff --git a/pop-api/examples/fungibles/tests.rs b/pop-api/examples/fungibles/tests.rs index b41f177d2..dc963a620 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::*, }, @@ -556,8 +556,8 @@ 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. - assert_err!(mint(&mut session, ALICE, AMOUNT), Error::Module(Assets(AssetNotLive))); + // `pallet-assets` returns `UnknownAsset` error. + assert_err!(mint(&mut session, ALICE, AMOUNT), Error::Raw(Token(UnknownAsset))); } #[drink::test(sandbox = Pop)]