diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 6d4d8593f..dd811a614 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -40,3 +40,17 @@ jobs: # Get latest version from https://autofix.ci/setup - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a + + autofix-toml: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install taplo + run: | + curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \ + | gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo + - run: | + taplo fmt + + # Get latest version from https://autofix.ci/setup + - uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a diff --git a/.github/workflows/toml.yml b/.github/workflows/toml.yml new file mode 100644 index 000000000..d7b946439 --- /dev/null +++ b/.github/workflows/toml.yml @@ -0,0 +1,26 @@ +name: "TOML checks" + +on: + merge_group: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + fmt-check: + name: "Formatting" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install taplo + run: | + curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \ + | gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo + - run: | + taplo fmt + CHANGES_IN_REPO=$(git status --porcelain) + if [[ -n "$CHANGES_IN_REPO" ]]; then + exit 1 + fi diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 000000000..a1e06c200 --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,3 @@ +[formatting] +indent_string = " " +reorder_arrays = true diff --git a/Cargo.toml b/Cargo.toml index 60d10efe1..752817200 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,10 @@ version = "2.1.3" [workspace.dependencies] schemars = "0.8.4" -serde = { version = "1.0.192", default-features = false, features = ["derive", "alloc"] } +serde = { version = "1.0.192", default-features = false, features = [ + "alloc", + "derive", +] } [workspace.metadata.release] shared-version = true diff --git a/_typos.toml b/_typos.toml index 072077d74..4f5c86948 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,10 +1,5 @@ [default] -extend-ignore-re = [ - "(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", -] +extend-ignore-re = ["(?Rm)^.*(#|//)\\s*spellchecker:disable-line$"] [files] -extend-exclude = [ - "contracts/**/schema/**", - "packages/crypto/**/*.json", -] +extend-exclude = ["contracts/**/schema/**", "packages/crypto/**/*.json"] diff --git a/contracts/burner/Cargo.toml b/contracts/burner/Cargo.toml index 7d4afecd2..c0fc78e9c 100644 --- a/contracts/burner/Cargo.toml +++ b/contracts/burner/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "burner" version = "0.0.0" -authors = ["Ethan Frey ", "Simon Warta "] +authors = [ + "Ethan Frey ", + "Simon Warta ", +] edition = "2021" publish = false license = "Apache-2.0" @@ -31,9 +34,14 @@ cranelift = ["cosmwasm-vm/cranelift"] [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = ["iterator", "cosmwasm_1_4"] } +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 d19b2bfc0..1685e094b 100644 --- a/contracts/crypto-verify/Cargo.toml +++ b/contracts/crypto-verify/Cargo.toml @@ -31,9 +31,15 @@ cranelift = ["cosmwasm-vm/cranelift"] [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,5 +47,7 @@ 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 413b30538..108c3b83b 100644 --- a/contracts/cyberpunk/Cargo.toml +++ b/contracts/cyberpunk/Cargo.toml @@ -28,7 +28,11 @@ cranelift = ["cosmwasm-vm/cranelift"] [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "abort", "cosmwasm_1_3"] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ + "abort", + "cosmwasm_1_3", + "std", +] } rust-argon2 = "2.1" thiserror = "1.0.26" diff --git a/contracts/empty/Cargo.toml b/contracts/empty/Cargo.toml index 305529682..4061b2dd9 100644 --- a/contracts/empty/Cargo.toml +++ b/contracts/empty/Cargo.toml @@ -34,4 +34,6 @@ 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 223626ce7..59328a74e 100644 --- a/contracts/floaty/Cargo.toml +++ b/contracts/floaty/Cargo.toml @@ -36,4 +36,6 @@ 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 fd77d71fa..d7ad3fc14 100644 --- a/contracts/hackatom/Cargo.toml +++ b/contracts/hackatom/Cargo.toml @@ -30,7 +30,11 @@ cranelift = ["cosmwasm-vm/cranelift"] [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "abort", "cosmwasm_2_2"] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ + "abort", + "cosmwasm_2_2", + "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 f45204c68..a4f220637 100644 --- a/contracts/ibc-callbacks/Cargo.toml +++ b/contracts/ibc-callbacks/Cargo.toml @@ -29,9 +29,15 @@ cranelift = ["cosmwasm-vm/cranelift"] [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 1ac2c78b1..735c5c2cf 100644 --- a/contracts/ibc-reflect-send/Cargo.toml +++ b/contracts/ibc-reflect-send/Cargo.toml @@ -30,9 +30,16 @@ cranelift = ["cosmwasm-vm/cranelift"] [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 afbd2a1dd..4e97cda26 100644 --- a/contracts/ibc-reflect/Cargo.toml +++ b/contracts/ibc-reflect/Cargo.toml @@ -30,12 +30,16 @@ cranelift = ["cosmwasm-vm/cranelift"] [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", features = ["iterator", "stargate", "cosmwasm_2_2"] } +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", + "iterator", + "stargate", ] } diff --git a/contracts/queue/Cargo.toml b/contracts/queue/Cargo.toml index 4bf9b194c..c1202c537 100644 --- a/contracts/queue/Cargo.toml +++ b/contracts/queue/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "queue" version = "0.0.0" -authors = ["Simon Warta ", "Ethan Frey "] +authors = [ + "Ethan Frey ", + "Simon Warta ", +] edition = "2021" publish = false license = "Apache-2.0" @@ -33,9 +36,14 @@ library = [] [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 = ["iterator", "cosmwasm_1_4"] } +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 055502444..0534d386b 100644 --- a/contracts/reflect/Cargo.toml +++ b/contracts/reflect/Cargo.toml @@ -31,10 +31,17 @@ cranelift = ["cosmwasm-vm/cranelift"] [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "staking", "stargate", "cosmwasm_2_2"] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ + "cosmwasm_2_2", + "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/staking/Cargo.toml b/contracts/staking/Cargo.toml index 9049990c9..a22fc820f 100644 --- a/contracts/staking/Cargo.toml +++ b/contracts/staking/Cargo.toml @@ -30,10 +30,15 @@ cranelift = ["cosmwasm-vm/cranelift"] [dependencies] cosmwasm-schema = { path = "../../packages/schema" } -cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "staking"] } +cosmwasm-std = { path = "../../packages/std", default-features = false, features = [ + "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 df76b16ed..d71c033b2 100644 --- a/contracts/virus/Cargo.toml +++ b/contracts/virus/Cargo.toml @@ -36,4 +36,6 @@ 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/deny.toml b/deny.toml index 2fa6930cc..a295a491d 100644 --- a/deny.toml +++ b/deny.toml @@ -70,8 +70,8 @@ unlicensed = "deny" # See https://spdx.org/licenses/ for list of possible licenses # [possible values: any SPDX 3.11 short identifier (+ optional exception)]. allow = [ - "Apache-2.0", "Apache-2.0 WITH LLVM-exception", + "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "CC0-1.0", @@ -128,8 +128,8 @@ exceptions = [ # and the crate will be checked normally, which may produce warnings or errors # depending on the rest of your configuration #license-files = [ - # Each entry is a crate relative path, and the (opaque) hash of its contents - #{ path = "LICENSE", hash = 0xbd0eed23 } +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } #] [licenses.private] diff --git a/packages/crypto/Cargo.toml b/packages/crypto/Cargo.toml index 8b02c5c5c..49a1680e0 100644 --- a/packages/crypto/Cargo.toml +++ b/packages/crypto/Cargo.toml @@ -18,7 +18,7 @@ ark-ff = { version = "0.4.2", features = ["asm", "parallel"] } ark-serialize = "0.4.2" cosmwasm-core = { version = "2.1.3", path = "../core" } digest = "0.10" -ecdsa = "0.16.2" # Not used directly, but needed to bump transitive dependency, see: https://github.com/CosmWasm/cosmwasm/pull/1899 for details. +ecdsa = "0.16.2" # Not used directly, but needed to bump transitive dependency, see: https://github.com/CosmWasm/cosmwasm/pull/1899 for details. ed25519-zebra = { version = "4.0.3", default-features = false } k256 = { version = "0.13.3", default-features = false, features = ["ecdsa"] } num-traits = "0.2.18" @@ -36,7 +36,10 @@ base64 = "0.22.0" base64-serde = "0.7.0" criterion = "0.5.1" rand_core = { version = "0.6", features = ["getrandom"] } -serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] } +serde = { version = "1.0.103", default-features = false, features = [ + "alloc", + "derive", +] } serde_json = "1.0.40" sha2 = "0.10" sha3 = "0.10" diff --git a/packages/go-gen/Cargo.toml b/packages/go-gen/Cargo.toml index a1f56e50d..8a8be8954 100644 --- a/packages/go-gen/Cargo.toml +++ b/packages/go-gen/Cargo.toml @@ -10,9 +10,9 @@ release = false [dependencies] cosmwasm-std = { version = "2.1.3", path = "../std", features = [ - "cosmwasm_2_2", - "staking", - "stargate", + "cosmwasm_2_2", + "staking", + "stargate", ] } cosmwasm-schema = { version = "2.1.3", path = "../schema" } anyhow = "1" diff --git a/packages/schema/Cargo.toml b/packages/schema/Cargo.toml index c3dec849f..e1b4a31f7 100644 --- a/packages/schema/Cargo.toml +++ b/packages/schema/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "cosmwasm-schema" version.workspace = true -authors = ["Simon Warta ", "Ethan Frey "] +authors = [ + "Ethan Frey ", + "Simon Warta ", +] edition = "2021" description = "A dev-dependency for CosmWasm contracts to generate JSON Schema files." repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/schema" diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index fe5e9990b..02120af31 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -9,10 +9,10 @@ license = "Apache-2.0" readme = "README.md" [package.metadata.docs.rs] -features = ["abort", "stargate", "staking", "cosmwasm_2_2"] +features = ["abort", "cosmwasm_2_2", "staking", "stargate"] [features] -default = ["iterator", "abort", "std"] +default = ["abort", "iterator", "std"] abort = [] std = [] # iterator allows us to iterate over all DB items in a given range @@ -57,12 +57,16 @@ base64 = "0.22.0" bnum = "0.11.0" cosmwasm-core = { version = "2.1.3", path = "../core" } cosmwasm-derive = { version = "2.1.3", path = "../derive" } -derive_more = { version = "1.0.0-beta.6", default-features = false, features = ["debug"] } +derive_more = { version = "1.0.0-beta.6", default-features = false, features = [ + "debug", +] } hex = "0.4" schemars = { workspace = true } sha2 = "0.10.3" serde = { workspace = true, features = ["std"] } -serde-json-wasm = { version = "1.0.1", default-features = false, features = ["std"] } +serde-json-wasm = { version = "1.0.1", default-features = false, features = [ + "std", +] } static_assertions = "1.1.0" thiserror = "1.0.26" rmp-serde = "1.3.0" @@ -76,7 +80,10 @@ rand_core = { version = "0.6.4", features = ["getrandom"] } cosmwasm-core = { path = "../core", version = "2.1.3" } cosmwasm-schema = { version = "2.1.3", 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" serde_json = "1.0.81" diff --git a/packages/vm/Cargo.toml b/packages/vm/Cargo.toml index acfdc1dfa..03ac890db 100644 --- a/packages/vm/Cargo.toml +++ b/packages/vm/Cargo.toml @@ -8,19 +8,17 @@ repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/vm" license = "Apache-2.0" [package.metadata.release] -pre-release-hook = [ - "../../devtools/release_checks.sh" -] +pre-release-hook = ["../../devtools/release_checks.sh"] pre-release-replacements = [ - { file="../../CHANGELOG.md", search="## \\[Unreleased\\]", replace="## [{{version}}] - {{date}}", exactly=1 }, - { file="../../CHANGELOG.md", search="(U|u)nreleased", replace="{{version}}" }, - { file="../../CHANGELOG.md", search="", replace="\n\n## [Unreleased]", exactly=1 }, - { file="../../CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1 }, - { file="../../CHANGELOG.md", search="\n", replace="\n\n[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/{{tag_name}}...HEAD", exactly=1 }, + { file = "../../CHANGELOG.md", search = "## \\[Unreleased\\]", replace = "## [{{version}}] - {{date}}", exactly = 1 }, + { file = "../../CHANGELOG.md", search = "(U|u)nreleased", replace = "{{version}}" }, + { file = "../../CHANGELOG.md", search = "", replace = "\n\n## [Unreleased]", exactly = 1 }, + { file = "../../CHANGELOG.md", search = "\n", replace = "\n\n[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/{{tag_name}}...HEAD", exactly = 1 }, + { file = "../../CHANGELOG.md", search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}", exactly = 1 }, ] [features] -default = ["staking", "iterator"] +default = ["iterator", "staking"] # iterator allows us to iterate over all DB items in a given range # this must be enabled to support cosmwasm contracts compiled with the 'iterator' feature # optional as some merkle stores (like tries) don't support this @@ -46,7 +44,9 @@ crc32fast = "1.3.2" bech32 = "0.11.0" # Uses the path when built locally; uses the given version from crates.io when published cosmwasm-core = { version = "2.1.3", path = "../core" } -cosmwasm-std = { version = "2.1.3", path = "../std", default-features = false, features = ["std"] } +cosmwasm-std = { version = "2.1.3", path = "../std", default-features = false, features = [ + "std", +] } cosmwasm-crypto = { version = "2.1.3", path = "../crypto" } derivative = "2" hex = "0.4" @@ -56,7 +56,9 @@ serde = { workspace = true } serde_json = "1.0.40" sha2 = "0.10.3" thiserror = "1.0.26" -wasmer = { version = "=4.3.3", default-features = false, features = ["singlepass"] } +wasmer = { version = "=4.3.3", default-features = false, features = [ + "singlepass", +] } wasmer-middlewares = "=4.3.3" strum = { version = "0.26.2", default-features = false, features = ["derive"] } # For heap profiling. Only used in the "heap_profiling" example. This has to be a non-dev dependency