Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion contracts/hackatom/schema/cw_schema/hackatom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/hackatom/schema/cw_schema/raw/sudo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/hackatom/schema/hackatom.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion contracts/hackatom/schema/raw/sudo.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion contracts/reflect/schema/cw_schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/reflect/schema/cw_schema/reflect.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/reflect/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down
2 changes: 1 addition & 1 deletion contracts/reflect/schema/reflect.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down
52 changes: 52 additions & 0 deletions devtools/update-schemas.sh
Original file line number Diff line number Diff line change
@@ -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