Skip to content

Commit f1b656e

Browse files
authored
Updated schemas. (#2544)
1 parent 2b3baf6 commit f1b656e

File tree

10 files changed

+65
-8
lines changed

10 files changed

+65
-8
lines changed

Taskfile.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,8 @@ tasks:
233233
desc: Runs tests for cw-schema
234234
cmds:
235235
- cmd: cargo {{.TOOLCHAIN}} test -p cw-schema
236+
237+
update-schemas:
238+
desc: Updates schemas for all contracts
239+
cmds:
240+
- cmd: ./devtools/update-schemas.sh

contracts/hackatom/schema/cw_schema/hackatom.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"definitions": [
161161
{
162162
"name": "hackatom_msg_SudoMsg",
163-
"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",
163+
"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",
164164
"type": "enum",
165165
"cases": {
166166
"steal_funds": {

contracts/hackatom/schema/cw_schema/raw/sudo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"definitions": [
55
{
66
"name": "hackatom_msg_SudoMsg",
7-
"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",
7+
"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",
88
"type": "enum",
99
"cases": {
1010
"steal_funds": {

contracts/hackatom/schema/hackatom.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
"sudo": {
239239
"$schema": "http://json-schema.org/draft-07/schema#",
240240
"title": "SudoMsg",
241-
"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",
241+
"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",
242242
"oneOf": [
243243
{
244244
"type": "object",

contracts/hackatom/schema/raw/sudo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"title": "SudoMsg",
4-
"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",
4+
"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",
55
"oneOf": [
66
{
77
"type": "object",

contracts/reflect/schema/cw_schema/raw/query.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
"type": "named",
263263
"properties": {
264264
"address": {
265-
"description": "The validator's address (e.g. (e.g. cosmosvaloper1...))",
265+
"description": "The validator's address (e.g. cosmosvaloper1...)",
266266
"value": 1
267267
}
268268
}

contracts/reflect/schema/cw_schema/reflect.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@
943943
"type": "named",
944944
"properties": {
945945
"address": {
946-
"description": "The validator's address (e.g. (e.g. cosmosvaloper1...))",
946+
"description": "The validator's address (e.g. cosmosvaloper1...)",
947947
"value": 1
948948
}
949949
}

contracts/reflect/schema/raw/query.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@
662662
],
663663
"properties": {
664664
"address": {
665-
"description": "The validator's address (e.g. (e.g. cosmosvaloper1...))",
665+
"description": "The validator's address (e.g. cosmosvaloper1...)",
666666
"type": "string"
667667
}
668668
},

contracts/reflect/schema/reflect.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@
18061806
],
18071807
"properties": {
18081808
"address": {
1809-
"description": "The validator's address (e.g. (e.g. cosmosvaloper1...))",
1809+
"description": "The validator's address (e.g. cosmosvaloper1...)",
18101810
"type": "string"
18111811
}
18121812
},

devtools/update-schemas.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit -o nounset -o pipefail
4+
5+
msg() {
6+
echo -e "\e[1;34m$1\e[0m \e[1;32m$2\e[0m"
7+
}
8+
9+
check_contract() {
10+
(
11+
contract_dir=$1
12+
contract="$(basename "$contract_dir" | tr - _)"
13+
14+
msg "CHANGE DIRECTORY" "$contract_dir"
15+
cd "$contract_dir" || exit 1
16+
17+
msg "UPDATE SCHEMA" "$contract"
18+
cargo +"$2" run --bin schema --locked
19+
)
20+
}
21+
22+
contracts_stable=(
23+
contracts/burner
24+
contracts/crypto-verify
25+
contracts/cyberpunk
26+
contracts/empty
27+
contracts/hackatom
28+
contracts/ibc2
29+
contracts/ibc-callbacks
30+
contracts/ibc-reflect
31+
contracts/ibc-reflect-send
32+
contracts/nested-contracts
33+
contracts/queue
34+
contracts/reflect
35+
contracts/replier
36+
contracts/staking
37+
contracts/virus
38+
)
39+
40+
contracts_nightly=(
41+
contracts/floaty
42+
)
43+
44+
toolchain_stable=1.82.0
45+
toolchain_nightly=nightly-2024-09-01
46+
47+
for dir in "${contracts_stable[@]}"; do
48+
check_contract "$dir" "$toolchain_stable"
49+
done
50+
for dir in "${contracts_nightly[@]}"; do
51+
check_contract "$dir" "$toolchain_nightly"
52+
done

0 commit comments

Comments
 (0)