diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 405ab83c8a..e35591dd62 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -1,6 +1,6 @@ name: contracts -on: [ push ] +on: [ pull_request_review ] env: TOOLCHAIN_STABLE: 1.82.0 # toolchain for building contracts in stable channel diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 48b660f683..064b60a723 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -1,6 +1,6 @@ name: packages -on: [ push ] +on: [ pull_request_review ] env: TOOLCHAIN_STABLE: 1.82.0 # toolchain for building packages diff --git a/Cargo.toml b/Cargo.toml index f562f9d64a..cde35c9788 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,7 @@ version = "3.0.1" [workspace.dependencies] schemars = "0.8.4" -serde = { version = "1.0.192", default-features = false, features = [ - "alloc", - "derive", -] } +serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] } [workspace.metadata.release] shared-version = true diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000000..4b9db612bf --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,54 @@ +version: '3' + +silent: true + +vars: + COSMWASM_CHECK_VERSION: 3.0.1 + +tasks: + + all: + desc: Runs all checks + summary: | + Runs all viable checks for cosmwasm. + Execute this task before pushing any changes. + This task takes a significant amount of time to complete. + cmds: + - task: clean + + install-cosmwasm-check: + desc: Installs cosmwasm-check tool (released version and currently developed version) + cmds: + # Install recently released cosmwasm-check and rename it to cosmwasm-check-release + - cmd: cargo +1.88.0 install cosmwasm-check@{{.COSMWASM_CHECK_VERSION}} --locked --force + - cmd: mv ~/.cargo/bin/cosmwasm-check ~/.cargo/bin/cosmwasm-check-release + # Install currently developed version of cosmwasm-check + - cmd: cargo +1.88.0 install --path ./packages/check --locked --force + + check-contracts: + desc: Performs checks for all contracts + cmds: + - task: install-cosmwasm-check + - cmd: ./task-actions/check-contracts.sh + + check-contracts-parallel: + desc: Performs checks in parallel for all contracts + cmds: + - task: install-cosmwasm-check + - cmd: ./task-actions/check-contracts.sh parallel + + check-contracts-fast: + desc: Performs checks for all contracts without reinstalling cosmwasm-check tool + cmds: + - cmd: ./task-actions/check-contracts.sh + + check-contracts-fast-parallel: + desc: Performs checks in parallel for all contracts without reinstalling cosmwasm-check tool + cmds: + - cmd: ./task-actions/check-contracts.sh parallel + + clean: + desc: Removes all compiled artifacts + cmds: + - cmd: cargo clean + - cmd: ./task-actions/clean-contracts.sh diff --git a/contracts/burner/Cargo.toml b/contracts/burner/Cargo.toml index bc1912910a..f93b2becbf 100644 --- a/contracts/burner/Cargo.toml +++ b/contracts/burner/Cargo.toml @@ -9,8 +9,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -27,14 +25,9 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = [ - "cosmwasm_1_4", - "iterator", -] } +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_1_4", "iterator"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/crypto-verify/Cargo.toml b/contracts/crypto-verify/Cargo.toml index 1ce4df7b6e..bebf079d03 100644 --- a/contracts/crypto-verify/Cargo.toml +++ b/contracts/crypto-verify/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -25,15 +23,9 @@ overflow-checks = true [dependencies] base64 = "0.22.0" cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = [ - "cosmwasm_2_1", - "iterator", -] } +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_2_1", "iterator"] } hex = "0.4" -p256 = { version = "0.13.2", default-features = false, features = [ - "alloc", - "ecdsa", -] } +p256 = { version = "0.13.2", default-features = false, features = ["alloc", "ecdsa"] } rlp = "0.5" schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } @@ -41,7 +33,5 @@ sha2 = "0.10" sha3 = "0.10" [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } hex-literal = "0.4.1" diff --git a/contracts/cyberpunk/Cargo.toml b/contracts/cyberpunk/Cargo.toml index ca09a2fe60..9f6046091c 100644 --- a/contracts/cyberpunk/Cargo.toml +++ b/contracts/cyberpunk/Cargo.toml @@ -22,11 +22,7 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ - "cosmwasm_1_3", - "exports", - "std", -] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_1_3", "exports", "std"] } rust-argon2 = "2.1" thiserror = "1.0.26" diff --git a/contracts/empty/Cargo.toml b/contracts/empty/Cargo.toml index d5aae3aee8..70bcb40346 100644 --- a/contracts/empty/Cargo.toml +++ b/contracts/empty/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -28,6 +26,4 @@ cosmwasm-std = { path = "../../packages/std", features = ["iterator"] } schemars = "0.8.12" [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/floaty/Cargo.toml b/contracts/floaty/Cargo.toml index f34c78e2bc..ed724bb220 100644 --- a/contracts/floaty/Cargo.toml +++ b/contracts/floaty/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -30,6 +28,4 @@ serde = { version = "1.0.103", default-features = false, features = ["derive"] } rand_chacha = { version = "0.3.1", default-features = false } [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/hackatom/Cargo.toml b/contracts/hackatom/Cargo.toml index ab9947800c..84e4405319 100644 --- a/contracts/hackatom/Cargo.toml +++ b/contracts/hackatom/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -24,11 +22,7 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ - "cosmwasm_2_2", - "exports", - "std", -] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_2_2", "exports", "std"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } sha2 = "0.10" diff --git a/contracts/ibc-callbacks/Cargo.toml b/contracts/ibc-callbacks/Cargo.toml index d839475e2c..5bca3e1c52 100644 --- a/contracts/ibc-callbacks/Cargo.toml +++ b/contracts/ibc-callbacks/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -24,15 +22,9 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = [ - "iterator", - "stargate", -] } +cosmwasm-std = { path = "../../packages/std", features = ["iterator", "stargate"] } schemars = "0.8.3" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", - "stargate", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator", "stargate"] } diff --git a/contracts/ibc-reflect-send/Cargo.toml b/contracts/ibc-reflect-send/Cargo.toml index 1982024b8c..eab39b4e6c 100644 --- a/contracts/ibc-reflect-send/Cargo.toml +++ b/contracts/ibc-reflect-send/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -24,16 +22,9 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = [ - "iterator", - "staking", - "stargate", -] } +cosmwasm-std = { path = "../../packages/std", features = ["iterator", "staking", "stargate"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", - "stargate", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator", "stargate"] } diff --git a/contracts/ibc-reflect/Cargo.toml b/contracts/ibc-reflect/Cargo.toml index 08c444a8fe..e2f13e8b42 100644 --- a/contracts/ibc-reflect/Cargo.toml +++ b/contracts/ibc-reflect/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -24,16 +22,9 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = [ - "cosmwasm_2_2", - "iterator", - "stargate", -] } +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_2_2", "iterator", "stargate"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", - "stargate", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator", "stargate"] } diff --git a/contracts/ibc2/Cargo.lock b/contracts/ibc2/Cargo.lock index 5e657c1084..bf5f9229f5 100644 --- a/contracts/ibc2/Cargo.lock +++ b/contracts/ibc2/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", @@ -45,7 +45,7 @@ dependencies = [ "ark-std", "educe", "fnv", - "hashbrown 0.15.2", + "hashbrown 0.15.4", "itertools", "num-bigint", "num-integer", @@ -110,7 +110,7 @@ dependencies = [ "ark-std", "educe", "fnv", - "hashbrown 0.15.2", + "hashbrown 0.15.4", ] [[package]] @@ -157,9 +157,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "base16ct" @@ -202,9 +202,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "const-oid" @@ -254,7 +254,7 @@ version = "3.0.1" dependencies = [ "cosmwasm-schema-derive", "cw-schema", - "schemars 0.8.21", + "schemars 0.8.22", "serde", "serde_json", "thiserror", @@ -284,7 +284,7 @@ dependencies = [ "hex", "rand_core", "rmp-serde", - "schemars 0.8.21", + "schemars 0.8.22", "serde", "serde_json", "sha2", @@ -437,9 +437,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "zeroize", @@ -480,9 +480,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feeef44e73baff3a26d371801df019877a9866a8c493d315ab00177843314f35" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "ecdsa" @@ -535,9 +535,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -585,9 +585,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ "rand_core", "subtle", @@ -618,9 +618,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", @@ -650,9 +650,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "allocator-api2", ] @@ -665,9 +665,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hex" @@ -690,7 +690,7 @@ version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "schemars 0.8.21", + "schemars 0.8.22", "serde", "thiserror", ] @@ -703,12 +703,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.15.4", ] [[package]] @@ -739,9 +739,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "k256" @@ -757,15 +757,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "num-bigint" @@ -797,15 +797,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "owo-colors" -version = "4.2.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" dependencies = [ "supports-color 2.1.0", "supports-color 3.0.2", @@ -831,9 +831,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] @@ -849,18 +849,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -977,18 +977,18 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schemars" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" dependencies = [ "dyn-clone", - "schemars_derive 0.8.21", + "schemars_derive 0.8.22", "serde", "serde_json", ] @@ -1008,9 +1008,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" dependencies = [ "proc-macro2", "quote", @@ -1045,24 +1045,24 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -1082,9 +1082,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" dependencies = [ "itoa", "memchr", @@ -1094,9 +1094,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" dependencies = [ "serde", "serde_derive", @@ -1105,9 +1105,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" dependencies = [ "darling", "proc-macro2", @@ -1117,9 +1117,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -1181,9 +1181,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -1218,15 +1218,15 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-xid" @@ -1242,9 +1242,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "windows-sys" @@ -1321,19 +1321,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", diff --git a/contracts/nested-contracts/Cargo.lock b/contracts/nested-contracts/Cargo.lock index 9487879fd0..db6f6fbb4e 100644 --- a/contracts/nested-contracts/Cargo.lock +++ b/contracts/nested-contracts/Cargo.lock @@ -647,7 +647,7 @@ dependencies = [ [[package]] name = "inner-contract" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -708,7 +708,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "nested-contracts" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", diff --git a/contracts/nested-contracts/Cargo.toml b/contracts/nested-contracts/Cargo.toml index 724f0fb01d..c379153d1d 100644 --- a/contracts/nested-contracts/Cargo.toml +++ b/contracts/nested-contracts/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "nested-contracts" -version = "0.1.0" +version = "0.0.0" authors = ["Aumetra Weisman "] edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +publish = false +license = "Apache-2.0" [lib] crate-type = ["cdylib", "rlib"] @@ -29,17 +29,12 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] cosmwasm-schema = "2.1.0" -cosmwasm-std = { version = "2.1.0", features = [ - "cosmwasm_1_4", - # Enable this if you only deploy to chains that have CosmWasm 2.0 or higher - # "cosmwasm_2_0", -] } +cosmwasm-std = { version = "2.1.0", features = ["cosmwasm_1_4"] } cw-storage-plus = "2.0.0" cw2 = "2.0.0" schemars = "0.8.16" serde = { version = "1.0.197", default-features = false, features = ["derive"] } thiserror = { version = "1.0.58" } - inner-contract = { path = "./inner-contract" } [dev-dependencies] diff --git a/contracts/nested-contracts/inner-contract/Cargo.lock b/contracts/nested-contracts/inner-contract/Cargo.lock index 0dbf36487d..94d11f2ce4 100644 --- a/contracts/nested-contracts/inner-contract/Cargo.lock +++ b/contracts/nested-contracts/inner-contract/Cargo.lock @@ -645,7 +645,7 @@ dependencies = [ [[package]] name = "inner-contract" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", diff --git a/contracts/nested-contracts/inner-contract/Cargo.toml b/contracts/nested-contracts/inner-contract/Cargo.toml index a7c1247ece..d8c7867e40 100644 --- a/contracts/nested-contracts/inner-contract/Cargo.toml +++ b/contracts/nested-contracts/inner-contract/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "inner-contract" -version = "0.1.0" +version = "0.0.0" authors = ["Aumetra Weisman "] edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +publish = false +license = "Apache-2.0" [lib] crate-type = ["cdylib", "rlib"] @@ -29,11 +29,7 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] cosmwasm-schema = "2.1.0" -cosmwasm-std = { version = "2.1.0", features = [ - "cosmwasm_1_4", - # Enable this if you only deploy to chains that have CosmWasm 2.0 or higher - # "cosmwasm_2_0", -] } +cosmwasm-std = { version = "2.1.0", features = ["cosmwasm_1_4"] } cw-storage-plus = "2.0.0" cw2 = "2.0.0" schemars = "0.8.16" diff --git a/contracts/nested-contracts/inner-contract/schema/inner-contract.json b/contracts/nested-contracts/inner-contract/schema/inner-contract.json index 42a8aa50c4..ea234f4c81 100644 --- a/contracts/nested-contracts/inner-contract/schema/inner-contract.json +++ b/contracts/nested-contracts/inner-contract/schema/inner-contract.json @@ -1,6 +1,6 @@ { "contract_name": "inner-contract", - "contract_version": "0.1.0", + "contract_version": "0.0.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/contracts/nested-contracts/schema/nested-contracts.json b/contracts/nested-contracts/schema/nested-contracts.json index abf797ff3d..222280e9dc 100644 --- a/contracts/nested-contracts/schema/nested-contracts.json +++ b/contracts/nested-contracts/schema/nested-contracts.json @@ -1,6 +1,6 @@ { "contract_name": "nested-contracts", - "contract_version": "0.1.0", + "contract_version": "0.0.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/contracts/queue/Cargo.toml b/contracts/queue/Cargo.toml index accfb6e004..6058e82513 100644 --- a/contracts/queue/Cargo.toml +++ b/contracts/queue/Cargo.toml @@ -9,8 +9,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -28,14 +26,9 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } # cosmwasm_1_4 is enabled here for more efficient `range_keys` and `range_values` -cosmwasm-std = { path = "../../packages/std", features = [ - "cosmwasm_1_4", - "iterator", -] } +cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_1_4", "iterator"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/contracts/reflect/Cargo.toml b/contracts/reflect/Cargo.toml index 39b13b2bdf..4d7280302f 100644 --- a/contracts/reflect/Cargo.toml +++ b/contracts/reflect/Cargo.toml @@ -7,8 +7,6 @@ publish = false description = "Reflect messages to use for test cases - based on cw-mask" license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -25,18 +23,10 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ - "cosmwasm_2_2", - "exports", - "staking", - "stargate", - "std", -] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_2_2", "exports", "staking", "stargate", "std"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } thiserror = "1.0.26" [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "stargate", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["stargate"] } diff --git a/contracts/replier/Cargo.toml b/contracts/replier/Cargo.toml index 191c789c91..bb9f4aa2ab 100644 --- a/contracts/replier/Cargo.toml +++ b/contracts/replier/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -24,11 +22,6 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ - "cosmwasm_1_4", - "exports", - "iterator", - "std", -] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["cosmwasm_1_4", "exports", "iterator", "std"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/contracts/staking/Cargo.toml b/contracts/staking/Cargo.toml index c13a0e9046..8087900bca 100644 --- a/contracts/staking/Cargo.toml +++ b/contracts/staking/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -24,16 +22,10 @@ overflow-checks = true [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ - "exports", - "staking", - "std", -] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["exports", "staking", "std"] } schemars = "0.8.12" serde = { version = "1.0.103", default-features = false, features = ["derive"] } snafu = "0.8.2" [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "staking", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["staking"] } diff --git a/contracts/virus/Cargo.toml b/contracts/virus/Cargo.toml index 590bfde860..14f3bea06d 100644 --- a/contracts/virus/Cargo.toml +++ b/contracts/virus/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" publish = false license = "Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [lib] crate-type = ["cdylib", "rlib"] @@ -30,6 +28,4 @@ serde = { version = "1.0.103", default-features = false, features = ["derive"] } thiserror = "1.0.26" [dev-dependencies] -cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [ - "iterator", -] } +cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] } diff --git a/docs/CHECKS.md b/docs/CHECKS.md new file mode 100644 index 0000000000..2f9b24339b --- /dev/null +++ b/docs/CHECKS.md @@ -0,0 +1,58 @@ +# Checks in GitHub workflows + +## Packages + +List of checks performed in `packages.yml` workflow: + +| Package | channel | fmt | linter | build | tests | wasm | thumbv7em | +|----------------------------|:-------------:|:---:|:------:|:-----:|:-----:|:----:|:---------:| +| **cosmwasm-check** | 1.82.0 stable | + | + | + | + | | | +| **cosmwasm-core** | 1.82.0 stable | + | + | + | + | + | + | +| **cosmwasm-crypto** | 1.82.0 stable | + | + | + | + | | | +| **cw-schema** | 1.82.0 stable | + | + | + | + | | | +| **cw-schema-derive** | 1.82.0 stable | + | + | + | + | | | +| **cosmwasm-derive** | 1.82.0 stable | + | + | + | + | | | +| **cosmwasm-schema** | 1.82.0 stable | + | + | + | + | | | +| **cosmwasm-schema-derive** | 1.82.0 stable | + | + | + | + | | | +| **cosmwasm-std** | 1.82.0 stable | + | + | + | + | + | | +| **cosmwasm-vm** | 1.82.0 stable | + | + | + | + | | | +| **cosmwasm-vm-derive** | 1.82.0 stable | + | + | + | + | | | + +## Contracts + +List of checks performed in `contracts.yml` workflow: + +| Contract | channel | fmt | unit
tests | wasm | linter | integration
tests | schema | check
released | check
current | +|----------------------|:--------------:|:---:|:--------------:|:----:|:------:|:---------------------:|:------:|:------------------:|:-----------------:| +| **burner** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **crypto-verify** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **cyberpunk** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **empty** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **floaty** | 1.82.0 nightly | + | + | + | + | + | + | + | + | +| **hackatom** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **ibc2** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **ibc-callbacks** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **ibc-reflect** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **ibc-reflect-send** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **nested-contracts** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **queue** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **reflect** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **replier** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **staking** | 1.82.0 stable | + | + | + | + | + | + | + | + | +| **virus** | 1.82.0 stable | + | + | + | + | + | + | + | + | + +Legend: + +- **channel** - Rust channel used to run the checks. Possible values are **stable** or **nightly**. + Most of the contracts use **stable** channel, but in some cases **nightly** channel is required. +- **fmt** - Checks code formatting against Rust formatting rules. +- **unit tests** - Runs all unit tests provided by the contract. +- **wasm** - Checks building the WASM binary for the contract. +- **linter** - Check the code correctness against Rust clippy rules. +- **integration tests** - Runs all integration tests provided by the contract. +- **schema** - Checks if there are no changes in contract interface (schema). +- **check released** - Checks the WASM binary using recently released version of `cosmwasm-check` tool. +- **check current** - Checks the WASM binary using currently developed version of `cosmwasm-check` tool. + +> All checks are executed on standard [GitHub runner images](https://github.com/actions/runner-images): +> `ubuntu-latest` (x86_64), `macos-latest` (arm64) and `windows-latest` (x86_64). diff --git a/docs/idl.md b/docs/IDL.md similarity index 100% rename from docs/idl.md rename to docs/IDL.md diff --git a/docs/simulate_riffle_shuffle.py b/docs/simulate_riffle_shuffle.py deleted file mode 100644 index e8f280bfc5..0000000000 --- a/docs/simulate_riffle_shuffle.py +++ /dev/null @@ -1,57 +0,0 @@ -import functools - -# Create a function that executed f recursively n times, i.e. f**n -def power(f, n): - functions = [f for _ in range(n)] - def compose2(f, g): - return lambda x: f(g(x)) - return functools.reduce(compose2, functions, lambda x: x) - -# Rotate input to the left by n positions -def rotate_left(input, n): - return input[n:] + input[0:n] - -def riffle_shuffle(input): - left = input[0:len(input)//2] - right = input[len(input)//2:] - i = 0 - out = "" - while i < len(input)//2: - out += right[i] + left[i] - i += 1 - return out - -values = [ - "alice123----------------", # 0 - "alice485----------------", # 1 - "aliceimwunderland521----", # 2 - "bob1--------------------", # 3 - "bob123------------------", # 4 - "bob485------------------", # 5 - "bob511------------------", # 6 - "creator-----------------", # 7 -] - -def digit_sum(input): - def value(char): - if char == "-": - return 0 - else: - return ord(char) - return sum([value(c) for c in input]) - -shuffle = power(riffle_shuffle, 18) -rotated = [rotate_left(v, digit_sum(v) % 24) for v in values] -rotated_shuffled = [shuffle(r) for r in rotated] -shuffled = [shuffle(v) for v in values] - -print("Original:\n" + "\n".join(sorted(values))) -print() -# digit_sums = [str(digit_sum(v) % 24) for v in values] -# print("Digit sums:\n" + "\n".join(digit_sums)) -# print() -print("Rotated:\n" + "\n".join(sorted(rotated))) -print() -print("Shuffled:\n" + "\n".join(sorted(shuffled))) -print() -print("Rotated+Shuffled:\n" + "\n".join(sorted(rotated_shuffled))) diff --git a/packages/cw-schema/Cargo.toml b/packages/cw-schema/Cargo.toml index 9a2d71db83..b5c1d20ed0 100644 --- a/packages/cw-schema/Cargo.toml +++ b/packages/cw-schema/Cargo.toml @@ -12,9 +12,7 @@ cw-schema-derive = { version = "=3.0.1", path = "../cw-schema-derive" } indexmap = { version = "2.3.0", default-features = false } schemars = { version = "1.0.4", optional = true } serde = { version = "1.0.204", features = ["derive"] } -serde_with = { version = "3.9.0", default-features = false, features = [ - "macros", -] } +serde_with = { version = "3.9.0", default-features = false, features = ["macros"] } siphasher = { version = "1.0.1", default-features = false } typeid = "1.0.3" diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 73d594fed8..a4138d11ed 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -84,14 +84,8 @@ rand_core = { version = "0.6.4", features = ["getrandom"] } cosmwasm-core = { path = "../core", version = "3.0.1" } cosmwasm-schema = { version = "3.0.1", path = "../schema" } # The chrono dependency is only used in an example, which Rust compiles for us. If this causes trouble, remove it. -chrono = { version = "0.4", default-features = false, features = [ - "alloc", - "std", -] } +chrono = { version = "0.4", default-features = false, features = ["alloc", "std"] } crc32fast = "1.3.2" hex-literal = "0.4.1" paste = "1.0.15" -proptest = { version = "1.5.0", default-features = false, features = [ - "attr-macro", - "std", -] } +proptest = { version = "1.5.0", default-features = false, features = ["attr-macro", "std"] } diff --git a/task-actions/check-contracts.sh b/task-actions/check-contracts.sh new file mode 100755 index 0000000000..b157c68249 --- /dev/null +++ b/task-actions/check-contracts.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +if [[ "${1:-}" == "parallel" ]]; then + parallel=1 +else + parallel=0 +fi + +msg() { + if (( !parallel )); then + echo -e "\e[1;34m$1\e[0m \e[1;32m$2\e[0m" + fi +} + +check_contract() { + ( + contract_dir=$1 + contract="$(basename "$contract_dir" | tr - _)" + wasm="./target/wasm32-unknown-unknown/release/$contract.wasm" + + msg "CHANGE DIRECTORY" "$contract_dir" + cd "$contract_dir" || exit 1 + + msg "CHECK FORMATTING" "$contract" + cargo +"$2" fmt -- --check + + msg "RUN UNIT TESTS" "$contract" + cargo +"$2" test --lib --locked + + msg "BUILD WASM" "$contract" + RUSTFLAGS="$3" cargo +"$2" build --release --lib --locked --target wasm32-unknown-unknown + + msg "RUN LINTER" "$contract" + cargo +"$2" clippy --all-targets --tests -- -D warnings + + msg "RUN INTEGRATION TESTS" "$contract" + cargo +"$2" test --test integration --locked + + msg "GENERATE SCHEMA" "$contract" + cargo +"$2" run --bin schema --locked + + msg "ENSURE SCHEMA IS UP-TO-DATE" "$contract" + git diff --quiet ./schema + + msg "cosmwasm-check (release)" "$contract" + cosmwasm-check-release "$wasm" + + msg "cosmwasm-check (develop)" "$contract" + cosmwasm-check "$wasm" + ) +} + +contracts_stable=( + contracts/burner + contracts/crypto-verify + contracts/cyberpunk + contracts/empty + contracts/hackatom + contracts/ibc2 + contracts/ibc-callbacks + contracts/ibc-reflect + contracts/ibc-reflect-send + contracts/nested-contracts + contracts/queue + contracts/reflect + contracts/replier + contracts/staking + contracts/virus +) + +contracts_nightly=( + contracts/floaty +) + +toolchain_stable=1.82.0 +rustflags_stable="" + +toolchain_nightly=nightly-2024-09-01 +rustflags_nightly="-C target-feature=+nontrapping-fptoint" + +if (( parallel )); then + for dir in "${contracts_stable[@]}"; do + check_contract "$dir" "$toolchain_stable" "$rustflags_stable" > /dev/null & + done + for dir in "${contracts_nightly[@]}"; do + check_contract "$dir" "$toolchain_nightly" "$rustflags_nightly" > /dev/null & + done + wait +else + for dir in "${contracts_stable[@]}"; do + check_contract "$dir" "$toolchain_stable" "$rustflags_stable" + done + for dir in "${contracts_nightly[@]}"; do + check_contract "$dir" "$toolchain_nightly" "$rustflags_nightly" + done +fi diff --git a/task-actions/clean-contracts.sh b/task-actions/clean-contracts.sh new file mode 100755 index 0000000000..ffac27d82c --- /dev/null +++ b/task-actions/clean-contracts.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +for dir in contracts/*/; do + ( + contract="$(basename "$dir" | tr - _)" + echo -e "\e[1;34mClean contract\e[0m \e[1;32m$contract\e[0m" + cd "$dir" || exit 1 + cargo clean + ) +done