Skip to content

Commit

Permalink
Merge pull request #2148 from CosmWasm/cosmwasm_2_1-capability
Browse files Browse the repository at this point in the history
Add `cosmwasm_2_1` capability
  • Loading branch information
chipshort authored May 23, 2024
2 parents 7b9354c + fcf571e commit f8505e8
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,15 +438,15 @@ jobs:
- run:
name: Build library for native target (all features)
working_directory: ~/project/packages/std
command: cargo build --locked --features abort,iterator,staking,stargate,cosmwasm_2_0
command: cargo build --locked --all-features
- run:
name: Build library for wasm target (all features)
working_directory: ~/project/packages/std
command: cargo wasm --locked --features abort,iterator,staking,stargate,cosmwasm_2_0
command: cargo wasm --locked --all-features
- run:
name: Run unit tests (all features)
working_directory: ~/project/packages/std
command: cargo test --locked --features abort,iterator,staking,stargate,cosmwasm_2_0
command: cargo test --locked --all-features
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down Expand Up @@ -1037,7 +1037,7 @@ jobs:
- run:
name: Clippy linting on std (all feature flags)
working_directory: ~/project/packages/std
command: cargo clippy --all-targets --tests --features abort,iterator,staking,stargate,cosmwasm_2_0 -- -D warnings
command: cargo clippy --all-targets --tests --all-features -- -D warnings
- run:
name: Clippy linting on vm (no feature flags)
working_directory: ~/project/packages/vm
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"abort",
"stargate",
"staking",
"cosmwasm_2_0"
"cosmwasm_2_1"
]
}
2 changes: 2 additions & 0 deletions docs/CAPABILITIES-BUILT-IN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ might define others.
`1.4.0` or higher support this.
- `cosmwasm_2_0` enables `CosmosMsg::Any` and `QueryRequest::Grpc`. Only chains
running CosmWasm `2.0.0` or higher support this.
- `cosmwasm_2_1` enables `IbcMsg::WriteAcknowledgement`. Only chains running
CosmWasm `2.1.0` or higher support this.
2 changes: 1 addition & 1 deletion packages/check/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use cosmwasm_vm::capabilities_from_csv;
use cosmwasm_vm::internals::{check_wasm, compile, make_compiling_engine};

const DEFAULT_AVAILABLE_CAPABILITIES: &str =
"iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0";
"iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1";

pub fn main() {
let matches = Command::new("Contract checking")
Expand Down
2 changes: 1 addition & 1 deletion packages/go-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
publish = false

[dependencies]
cosmwasm-std = { version = "2.0.1", path = "../std", features = ["cosmwasm_2_0", "staking", "stargate"] }
cosmwasm-std = { version = "2.0.1", path = "../std", features = ["cosmwasm_2_1", "staking", "stargate"] }
cosmwasm-schema = { version = "2.0.1", path = "../schema" }
anyhow = "1"
Inflector = "0.11.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "Apache-2.0"
readme = "README.md"

[package.metadata.docs.rs]
features = ["abort", "stargate", "staking", "cosmwasm_2_0"]
features = ["abort", "stargate", "staking", "cosmwasm_2_1"]

[features]
default = ["iterator", "abort"]
Expand Down
4 changes: 4 additions & 0 deletions packages/std/src/exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ extern "C" fn requires_cosmwasm_1_4() -> () {}
#[no_mangle]
extern "C" fn requires_cosmwasm_2_0() -> () {}

#[cfg(feature = "cosmwasm_2_1")]
#[no_mangle]
extern "C" fn requires_cosmwasm_2_1() -> () {}

/// interface_version_* exports mark which Wasm VM interface level this contract is compiled for.
/// They can be checked by cosmwasm_vm.
/// Update this whenever the Wasm VM interface breaks.
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/examples/heap_profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ fn app(runtime: u64) {

let options = CacheOptions::new(
TempDir::new().unwrap().into_path(),
capabilities_from_csv("iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0"),
capabilities_from_csv("iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1"),
MEMORY_CACHE_SIZE,
DEFAULT_MEMORY_LIMIT,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/testing/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl MockInstanceOptions<'_> {
fn default_capabilities() -> HashSet<String> {
#[allow(unused_mut)]
let mut out = capabilities_from_csv(
"iterator,staking,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0",
"iterator,staking,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1",
);
#[cfg(feature = "stargate")]
out.insert("stargate".to_string());
Expand Down

0 comments on commit f8505e8

Please sign in to comment.