Skip to content

Commit

Permalink
Support Cosmos SDK v0.50 and more (#133)
Browse files Browse the repository at this point in the history
* Make 'y' the default answer of askQuestion()

* Update cosmjs to v0.32.3 (support SDK v0.50 chains)

* Add null safety check for config.deploy.ism

* config.example.yaml: exchange_rate cannot be a floating point

This is because in the contract it's a Uint128: https://github.com/many-things/cw-hyperlane/blob/f6a428a/packages/interface/src/igp/oracle.rs#L14
  • Loading branch information
assafmo authored Jun 25, 2024
1 parent f10ba02 commit eb791b5
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 102 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ deploy:
# token: "uosmo" # or default to gas token (in this case, uosmo will be set)
# configs:
# 5:
# exchange_rate: 1.0
# exchange_rate: 1
# gas_price: 40000
# 420:
# exchange_rate: 1.4
# exchange_rate: 2
# gas_price: 10322
# ...

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"author": "",
"license": "ISC",
"dependencies": {
"@cosmjs/cosmwasm-stargate": "^0.32.2",
"@cosmjs/crypto": "^0.32.2",
"@cosmjs/encoding": "^0.32.2",
"@cosmjs/proto-signing": "^0.32.2",
"@cosmjs/stargate": "^0.32.2",
"@cosmjs/tendermint-rpc": "^0.32.2",
"@cosmjs/cosmwasm-stargate": "^0.32.3",
"@cosmjs/crypto": "^0.32.3",
"@cosmjs/encoding": "^0.32.3",
"@cosmjs/proto-signing": "^0.32.3",
"@cosmjs/stargate": "^0.32.3",
"@cosmjs/tendermint-rpc": "^0.32.3",
"@hyperlane-xyz/sdk": "^3.7.0",
"@hyperlane-xyz/utils": "^3.7.0",
"axios": "^1.6.7",
Expand Down
2 changes: 1 addition & 1 deletion script/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const deployIsms = async (
ctx: Context,
client: Client,
): Promise<ContextDeployments['isms']> => {
if (!config.deploy.ism) {
if (!config?.deploy?.ism) {
throw new Error('ISM deployment config not found');
}

Expand Down
2 changes: 1 addition & 1 deletion script/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function handleMigrate(_: object, cmd: Command) {
);
}

if (!(await askQuestion('Do you want to proceed? (y/n)'))) {
if (!(await askQuestion('Do you want to proceed?'))) {
console.log('Aborted.');
return;
}
Expand Down
2 changes: 1 addition & 1 deletion script/commands/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async function upload({
return;
}

if (!(await askQuestion('Do you want to proceed? (y/n)'))) {
if (!(await askQuestion('Do you want to proceed?'))) {
console.log('Aborted.');
return;
}
Expand Down
2 changes: 1 addition & 1 deletion script/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function askQuestion(query: string) {
return new Promise((resolve) =>
rl.question(`${query} [Y/n] `, (ans) => {
rl.close();
resolve(ans.toLowerCase() == 'y' ? true : false);
resolve(ans.toLowerCase() == 'y' || ans == '' ? true : false);
}),
);
}
Expand Down
180 changes: 90 additions & 90 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1544,15 +1544,15 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/amino@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/amino@npm:0.32.2"
"@cosmjs/amino@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/amino@npm:0.32.3"
dependencies:
"@cosmjs/crypto": "npm:^0.32.2"
"@cosmjs/encoding": "npm:^0.32.2"
"@cosmjs/math": "npm:^0.32.2"
"@cosmjs/utils": "npm:^0.32.2"
checksum: 10c0/306ec4a08713d0173af134e45d26647f0d456c0cfacf55779c159a7556d9614e763a70518a7b3aaa3c18e9f71ff33f30e5badaed1c50aa26dd37313f68267083
"@cosmjs/crypto": "npm:^0.32.3"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/math": "npm:^0.32.3"
"@cosmjs/utils": "npm:^0.32.3"
checksum: 10c0/6f3da2ba6d88257d6717898af798aad9f2a51bb2c0d0b61cd40cf103c86a1431f4fa5086df350f81371d3282b8a28bcbc4f97c6d9eb83a9831fad473ae1ab492
languageName: node
linkType: hard

Expand All @@ -1575,21 +1575,21 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/cosmwasm-stargate@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/cosmwasm-stargate@npm:0.32.2"
"@cosmjs/cosmwasm-stargate@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/cosmwasm-stargate@npm:0.32.3"
dependencies:
"@cosmjs/amino": "npm:^0.32.2"
"@cosmjs/crypto": "npm:^0.32.2"
"@cosmjs/encoding": "npm:^0.32.2"
"@cosmjs/math": "npm:^0.32.2"
"@cosmjs/proto-signing": "npm:^0.32.2"
"@cosmjs/stargate": "npm:^0.32.2"
"@cosmjs/tendermint-rpc": "npm:^0.32.2"
"@cosmjs/utils": "npm:^0.32.2"
"@cosmjs/amino": "npm:^0.32.3"
"@cosmjs/crypto": "npm:^0.32.3"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/math": "npm:^0.32.3"
"@cosmjs/proto-signing": "npm:^0.32.3"
"@cosmjs/stargate": "npm:^0.32.3"
"@cosmjs/tendermint-rpc": "npm:^0.32.3"
"@cosmjs/utils": "npm:^0.32.3"
cosmjs-types: "npm:^0.9.0"
pako: "npm:^2.0.2"
checksum: 10c0/3ffa482661d2d31ffbf0b6a1651f0c567ea65018bedc91bb8b02f7cbc12e5da9e17bd53bbbe3f5dabac6cfc0667e3c01dc84b20fabd80e916e5e0a4efcc26343
checksum: 10c0/e33110be3004a462134c21f356066d16ba478664b4bbccd834c9d8b3f8156b6f94c14df8cf235803f13237f1408c12dcf5f9f64f4011dcca9a49298857c0c74c
languageName: node
linkType: hard

Expand All @@ -1608,18 +1608,18 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/crypto@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/crypto@npm:0.32.2"
"@cosmjs/crypto@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/crypto@npm:0.32.3"
dependencies:
"@cosmjs/encoding": "npm:^0.32.2"
"@cosmjs/math": "npm:^0.32.2"
"@cosmjs/utils": "npm:^0.32.2"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/math": "npm:^0.32.3"
"@cosmjs/utils": "npm:^0.32.3"
"@noble/hashes": "npm:^1"
bn.js: "npm:^5.2.0"
elliptic: "npm:^6.5.4"
libsodium-wrappers-sumo: "npm:^0.7.11"
checksum: 10c0/cd89f8f450daf6eca1d625cb226da179c82fb97d108f1a3ab36c132f9c47fb4930c276f827d82d91b9c818360a4141cbd24e61a4026bb24b77c883b3fb825351
checksum: 10c0/6925ee15c31d2ed6dfbda666834b188f81706d9c83b9afef27d88e4330cf516addcfcb7f9374dc4513bfea27c5fc717ff49679de9c45b282e601c93b67ac7c98
languageName: node
linkType: hard

Expand All @@ -1634,14 +1634,14 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/encoding@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/encoding@npm:0.32.2"
"@cosmjs/encoding@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/encoding@npm:0.32.3"
dependencies:
base64-js: "npm:^1.3.0"
bech32: "npm:^1.1.4"
readonly-date: "npm:^1.0.0"
checksum: 10c0/fe179c7c60c122da0bf7b8b0a76b729dc6a15280d9c32addc7a9efac0b86bbae13e2e51af2d968f72b1235d6f3e50da1ae06e77f96d7b2655be67a6ab23a934c
checksum: 10c0/3c3d4b610093c2c8ca13437664e4736d60cdfb309bf2671f492388c59a9bca20f1a75ab4686a7b73d48aa6208f454bee56c84c0fe780015473ea53353a70266a
languageName: node
linkType: hard

Expand All @@ -1655,13 +1655,13 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/json-rpc@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/json-rpc@npm:0.32.2"
"@cosmjs/json-rpc@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/json-rpc@npm:0.32.3"
dependencies:
"@cosmjs/stream": "npm:^0.32.2"
"@cosmjs/stream": "npm:^0.32.3"
xstream: "npm:^11.14.0"
checksum: 10c0/d3a70993d23356f3c1a840ba628ee890da6c1bf81a68a3f94ed74132e8a5b37d6ffba3327e562086552c7b01bd9dde2844761fbd8168e0c693011329c1cab53a
checksum: 10c0/8074cab7b9fcdd27c86329d820edf8be27e5cf12f99b845acb9d2fd8263b9a26557ee0729d293c8965c75117fcccd440d4c32eb314c03eef0d3c4273408302df
languageName: node
linkType: hard

Expand All @@ -1674,12 +1674,12 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/math@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/math@npm:0.32.2"
"@cosmjs/math@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/math@npm:0.32.3"
dependencies:
bn.js: "npm:^5.2.0"
checksum: 10c0/be6590c61b1d8488c9405666b365892d8ad9a6c7d0e67fced18386c6fe3e0dd180db4b55e3c7009f4659123a531459916357218f4f153569a9a740d8fd749064
checksum: 10c0/cad8b13a0db739ef4a416b334e39ea9f55874315ebdf91dc38772676c2ead6caccaf8a28b9e8803fc48680a72cf5a9fde97564f5efbfbe9a9073c95665f31294
languageName: node
linkType: hard

Expand All @@ -1698,17 +1698,17 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/proto-signing@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/proto-signing@npm:0.32.2"
"@cosmjs/proto-signing@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/proto-signing@npm:0.32.3"
dependencies:
"@cosmjs/amino": "npm:^0.32.2"
"@cosmjs/crypto": "npm:^0.32.2"
"@cosmjs/encoding": "npm:^0.32.2"
"@cosmjs/math": "npm:^0.32.2"
"@cosmjs/utils": "npm:^0.32.2"
"@cosmjs/amino": "npm:^0.32.3"
"@cosmjs/crypto": "npm:^0.32.3"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/math": "npm:^0.32.3"
"@cosmjs/utils": "npm:^0.32.3"
cosmjs-types: "npm:^0.9.0"
checksum: 10c0/351ae9d4e91b04926429dafd9342793958d2bfa2d84804a9195a1ba60ddb33491f66baa4dd17a4418bb53a7fb3a1ae6d4f4bb6f3a60b5f23bdcf62e70e987de2
checksum: 10c0/d44511d3a50489c1a3f61f28f68ca8cac87d6bdbb69e434cb0916dfc1d79e6a68ca0c09e074d4be73624f26fbb215024848225b862201b7f8d1d6a44014fd819
languageName: node
linkType: hard

Expand All @@ -1724,15 +1724,15 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/socket@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/socket@npm:0.32.2"
"@cosmjs/socket@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/socket@npm:0.32.3"
dependencies:
"@cosmjs/stream": "npm:^0.32.2"
"@cosmjs/stream": "npm:^0.32.3"
isomorphic-ws: "npm:^4.0.1"
ws: "npm:^7"
xstream: "npm:^11.14.0"
checksum: 10c0/5e9c1cb8f7a181cc380f82d50f4ec5b23ac9940e02ea51d813e26e87a7a9d2889de5297b42b45edfb7b6af8fc2fa1ce5cef7efdf52f266e6821b6f7ed1fb3dea
checksum: 10c0/25a82bd503d6f41adc3fa0b8c350b21bc4838efb0f1322966d6ebffefee61b5f5220d2fe3795b95932873f17937ceae45b25c5d1de92ed72b13abb7309cbace9
languageName: node
linkType: hard

Expand All @@ -1756,21 +1756,21 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/stargate@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/stargate@npm:0.32.2"
"@cosmjs/stargate@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/stargate@npm:0.32.3"
dependencies:
"@confio/ics23": "npm:^0.6.8"
"@cosmjs/amino": "npm:^0.32.2"
"@cosmjs/encoding": "npm:^0.32.2"
"@cosmjs/math": "npm:^0.32.2"
"@cosmjs/proto-signing": "npm:^0.32.2"
"@cosmjs/stream": "npm:^0.32.2"
"@cosmjs/tendermint-rpc": "npm:^0.32.2"
"@cosmjs/utils": "npm:^0.32.2"
"@cosmjs/amino": "npm:^0.32.3"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/math": "npm:^0.32.3"
"@cosmjs/proto-signing": "npm:^0.32.3"
"@cosmjs/stream": "npm:^0.32.3"
"@cosmjs/tendermint-rpc": "npm:^0.32.3"
"@cosmjs/utils": "npm:^0.32.3"
cosmjs-types: "npm:^0.9.0"
xstream: "npm:^11.14.0"
checksum: 10c0/70cf7e509f0cce9bd28bafa830260cfb4ddd6c3c3e60836aae93276a59c7ae6571971eeb6dd0a9e898295cbde17fba94d7253c3ce0b2f03de875d7b9dd074b12
checksum: 10c0/c82db0355f4b15ca988f0452f8142102b44840319fe48d44c8dc9c1a316cbe3c9e765eb90970348bd5b5fddd6d9452d5a556e14dbbbd93eda6a6c92ceb616241
languageName: node
linkType: hard

Expand All @@ -1783,12 +1783,12 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/stream@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/stream@npm:0.32.2"
"@cosmjs/stream@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/stream@npm:0.32.3"
dependencies:
xstream: "npm:^11.14.0"
checksum: 10c0/3cd66d55f63bf9b1ab1b0298b1ab9d79d132cc7fff26064832507a95adf82bd082793c09b2f5e7e864b29827fda81095ba9a619db9f5a5720438c7eba8cdab19
checksum: 10c0/963abad76c044265e6961add2a66060134dd610ced9397edcd331669e5aca2a157cc08db658590110233038c38fc5812a9e8d156babbf524eb291200a3708b3a
languageName: node
linkType: hard

Expand All @@ -1810,21 +1810,21 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/tendermint-rpc@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/tendermint-rpc@npm:0.32.2"
"@cosmjs/tendermint-rpc@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/tendermint-rpc@npm:0.32.3"
dependencies:
"@cosmjs/crypto": "npm:^0.32.2"
"@cosmjs/encoding": "npm:^0.32.2"
"@cosmjs/json-rpc": "npm:^0.32.2"
"@cosmjs/math": "npm:^0.32.2"
"@cosmjs/socket": "npm:^0.32.2"
"@cosmjs/stream": "npm:^0.32.2"
"@cosmjs/utils": "npm:^0.32.2"
"@cosmjs/crypto": "npm:^0.32.3"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/json-rpc": "npm:^0.32.3"
"@cosmjs/math": "npm:^0.32.3"
"@cosmjs/socket": "npm:^0.32.3"
"@cosmjs/stream": "npm:^0.32.3"
"@cosmjs/utils": "npm:^0.32.3"
axios: "npm:^1.6.0"
readonly-date: "npm:^1.0.0"
xstream: "npm:^11.14.0"
checksum: 10c0/a668d311c7bb088d63316698b99ec0938da61c35a7f423c7b4b06ba27a819787359a34b6b859d9deb03034864edb7e1d196f861f313f66b15db5d57e358cd3ca
checksum: 10c0/9ccde526456e9c4be7a2562c3def25a016267404a057e807ecc0f520aeb0cbfc5bf04bfca58ceecd6f7bf61b7089924c7949c13a7d685efc7ad946b71388c3df
languageName: node
linkType: hard

Expand All @@ -1835,10 +1835,10 @@ __metadata:
languageName: node
linkType: hard

"@cosmjs/utils@npm:^0.32.2":
version: 0.32.2
resolution: "@cosmjs/utils@npm:0.32.2"
checksum: 10c0/53789110c65106ee2d200f59f37d7732e7027b8bfc042072e3ca0336e2cf9b288cbe4f3e4945515a3d0f6907a7586dc83e96b49ddfc8a10c26377e52b7c609e6
"@cosmjs/utils@npm:^0.32.3":
version: 0.32.3
resolution: "@cosmjs/utils@npm:0.32.3"
checksum: 10c0/e21cb0387d135142fdebe64fadfe2f7c9446b8b974b9d0dff7a02f04e17e79fcfc3946258ad79af1db35b252058d97c38e1f90f2f14e903a37d85316f31efde6
languageName: node
linkType: hard

Expand Down Expand Up @@ -2908,12 +2908,12 @@ __metadata:
version: 0.0.0-use.local
resolution: "@many-things/cw-hyperlane@workspace:."
dependencies:
"@cosmjs/cosmwasm-stargate": "npm:^0.32.2"
"@cosmjs/crypto": "npm:^0.32.2"
"@cosmjs/encoding": "npm:^0.32.2"
"@cosmjs/proto-signing": "npm:^0.32.2"
"@cosmjs/stargate": "npm:^0.32.2"
"@cosmjs/tendermint-rpc": "npm:^0.32.2"
"@cosmjs/cosmwasm-stargate": "npm:^0.32.3"
"@cosmjs/crypto": "npm:^0.32.3"
"@cosmjs/encoding": "npm:^0.32.3"
"@cosmjs/proto-signing": "npm:^0.32.3"
"@cosmjs/stargate": "npm:^0.32.3"
"@cosmjs/tendermint-rpc": "npm:^0.32.3"
"@cosmwasm/ts-codegen": "npm:^0.35.7"
"@hyperlane-xyz/sdk": "npm:^3.7.0"
"@hyperlane-xyz/utils": "npm:^3.7.0"
Expand Down

0 comments on commit eb791b5

Please sign in to comment.