From 9536c0e8a68566f0004e2c4d7ee50497002421c7 Mon Sep 17 00:00:00 2001 From: Kishan Dhakan Date: Sat, 3 Feb 2024 01:37:47 +0530 Subject: [PATCH] feat: fix cosmwasm-mock compile issues, and add CI step to check compilation --- .github/workflows/Basic.yml | 9 +++++++++ contracts/injective-cosmwasm-mock/Cargo.toml | 20 +++++++++++--------- contracts/injective-cosmwasm-mock/src/lib.rs | 2 ++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Basic.yml b/.github/workflows/Basic.yml index ea7a9648..c573b186 100644 --- a/.github/workflows/Basic.yml +++ b/.github/workflows/Basic.yml @@ -28,6 +28,15 @@ jobs: target: wasm32-unknown-unknown override: true + - name: Compile contracts + run: | + for dir in contracts/*/ + do + cd "$dir" + RUSTFLAGS='-C link-arg=-s' cargo wasm + cd - + done + - name: Run unit tests uses: actions-rs/cargo@v1 with: diff --git a/contracts/injective-cosmwasm-mock/Cargo.toml b/contracts/injective-cosmwasm-mock/Cargo.toml index f1fc193b..99be9837 100644 --- a/contracts/injective-cosmwasm-mock/Cargo.toml +++ b/contracts/injective-cosmwasm-mock/Cargo.toml @@ -29,13 +29,15 @@ optimize = """docker run --rm -v "$(pwd)":/code \ """ [dependencies] -cosmwasm-std = { version = "1.5.0", features = [ "abort", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "iterator", "stargate" ] } -cw-storage-plus = "1.2.0" -cw2 = "0.16.0" -injective-cosmwasm = { path = "../../packages/injective-cosmwasm" } -injective-math = { path = "../../packages/injective-math" } -injective-std = { version = "0.1.5" } +cosmwasm-std = { version = "1.5.0", features = [ "abort", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "iterator", "stargate" ] } +cw-storage-plus = "1.2.0" +cw2 = "0.16.0" +injective-cosmwasm = { path = "../../packages/injective-cosmwasm" } +injective-math = { path = "../../packages/injective-math" } +injective-std = { version = "0.1.5" } +schemars = "0.8.8" +serde = { version = "1.0.137", default-features = false, features = [ "derive" ] } +thiserror = { version = "1.0.31" } + +[dev-dependencies] injective-test-tube = "1.1.6" -schemars = "0.8.8" -serde = { version = "1.0.137", default-features = false, features = [ "derive" ] } -thiserror = { version = "1.0.31" } diff --git a/contracts/injective-cosmwasm-mock/src/lib.rs b/contracts/injective-cosmwasm-mock/src/lib.rs index 39d14d52..213e21b9 100644 --- a/contracts/injective-cosmwasm-mock/src/lib.rs +++ b/contracts/injective-cosmwasm-mock/src/lib.rs @@ -3,6 +3,8 @@ mod error; pub mod msg; #[cfg(test)] mod testing; + +#[cfg(test)] pub mod utils; pub use crate::error::ContractError;