diff --git a/Taskfile.yml b/Taskfile.yml index 1b786be0d2..0fc7def1dd 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -233,3 +233,8 @@ tasks: desc: Runs tests for cw-schema cmds: - cmd: cargo {{.TOOLCHAIN}} test -p cw-schema + + update-schemas: + desc: Updates schemas for all contracts + cmds: + - cmd: ./devtools/update-schemas.sh diff --git a/contracts/hackatom/schema/cw_schema/hackatom.json b/contracts/hackatom/schema/cw_schema/hackatom.json index 8af0a7ddb9..10438be690 100644 --- a/contracts/hackatom/schema/cw_schema/hackatom.json +++ b/contracts/hackatom/schema/cw_schema/hackatom.json @@ -160,7 +160,7 @@ "definitions": [ { "name": "hackatom_msg_SudoMsg", - "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call.\nThis is showing how we can expose \"admin\" functionality than can not be called by\nexternal users or contracts, but only trusted (native/Go) code in the blockchain", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call.\nThis is showing how we can expose \"admin\" functionality that can not be called by\nexternal users or contracts, but only trusted (native/Go) code in the blockchain", "type": "enum", "cases": { "steal_funds": { diff --git a/contracts/hackatom/schema/cw_schema/raw/sudo.json b/contracts/hackatom/schema/cw_schema/raw/sudo.json index 648844ea51..9a57cde6fc 100644 --- a/contracts/hackatom/schema/cw_schema/raw/sudo.json +++ b/contracts/hackatom/schema/cw_schema/raw/sudo.json @@ -4,7 +4,7 @@ "definitions": [ { "name": "hackatom_msg_SudoMsg", - "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call.\nThis is showing how we can expose \"admin\" functionality than can not be called by\nexternal users or contracts, but only trusted (native/Go) code in the blockchain", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call.\nThis is showing how we can expose \"admin\" functionality that can not be called by\nexternal users or contracts, but only trusted (native/Go) code in the blockchain", "type": "enum", "cases": { "steal_funds": { diff --git a/contracts/hackatom/schema/hackatom.json b/contracts/hackatom/schema/hackatom.json index feeee3e96d..707ee9da9d 100644 --- a/contracts/hackatom/schema/hackatom.json +++ b/contracts/hackatom/schema/hackatom.json @@ -238,7 +238,7 @@ "sudo": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SudoMsg", - "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality than can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality that can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", "oneOf": [ { "type": "object", diff --git a/contracts/hackatom/schema/raw/sudo.json b/contracts/hackatom/schema/raw/sudo.json index a57dc6c7b9..f75740e274 100644 --- a/contracts/hackatom/schema/raw/sudo.json +++ b/contracts/hackatom/schema/raw/sudo.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SudoMsg", - "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality than can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", + "description": "SudoMsg is only exposed for internal Cosmos SDK modules to call. This is showing how we can expose \"admin\" functionality that can not be called by external users or contracts, but only trusted (native/Go) code in the blockchain", "oneOf": [ { "type": "object", diff --git a/contracts/reflect/schema/cw_schema/raw/query.json b/contracts/reflect/schema/cw_schema/raw/query.json index 55e118fac0..225eab50c4 100644 --- a/contracts/reflect/schema/cw_schema/raw/query.json +++ b/contracts/reflect/schema/cw_schema/raw/query.json @@ -262,7 +262,7 @@ "type": "named", "properties": { "address": { - "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", + "description": "The validator's address (e.g. cosmosvaloper1...)", "value": 1 } } diff --git a/contracts/reflect/schema/cw_schema/reflect.json b/contracts/reflect/schema/cw_schema/reflect.json index 34c6baca58..8b94deda84 100644 --- a/contracts/reflect/schema/cw_schema/reflect.json +++ b/contracts/reflect/schema/cw_schema/reflect.json @@ -943,7 +943,7 @@ "type": "named", "properties": { "address": { - "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", + "description": "The validator's address (e.g. cosmosvaloper1...)", "value": 1 } } diff --git a/contracts/reflect/schema/raw/query.json b/contracts/reflect/schema/raw/query.json index f23bac0c54..44793b3caf 100644 --- a/contracts/reflect/schema/raw/query.json +++ b/contracts/reflect/schema/raw/query.json @@ -662,7 +662,7 @@ ], "properties": { "address": { - "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", + "description": "The validator's address (e.g. cosmosvaloper1...)", "type": "string" } }, diff --git a/contracts/reflect/schema/reflect.json b/contracts/reflect/schema/reflect.json index 2040734060..80c8ac7533 100644 --- a/contracts/reflect/schema/reflect.json +++ b/contracts/reflect/schema/reflect.json @@ -1806,7 +1806,7 @@ ], "properties": { "address": { - "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", + "description": "The validator's address (e.g. cosmosvaloper1...)", "type": "string" } }, diff --git a/devtools/update-schemas.sh b/devtools/update-schemas.sh new file mode 100755 index 0000000000..055dbe538f --- /dev/null +++ b/devtools/update-schemas.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail + +msg() { + echo -e "\e[1;34m$1\e[0m \e[1;32m$2\e[0m" +} + +check_contract() { + ( + contract_dir=$1 + contract="$(basename "$contract_dir" | tr - _)" + + msg "CHANGE DIRECTORY" "$contract_dir" + cd "$contract_dir" || exit 1 + + msg "UPDATE SCHEMA" "$contract" + cargo +"$2" run --bin schema --locked + ) +} + +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 +toolchain_nightly=nightly-2024-09-01 + +for dir in "${contracts_stable[@]}"; do + check_contract "$dir" "$toolchain_stable" +done +for dir in "${contracts_nightly[@]}"; do + check_contract "$dir" "$toolchain_nightly" +done