From bb9e52215a9905415f11d66eadfdfbc4457bb933 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 24 May 2023 00:25:10 +0200 Subject: [PATCH 1/2] Upgrade cosmjs-types to 0.8.0 --- .pnp.cjs | 16 ++-- ...-types-npm-0.7.2-655e4f4384-4a0b730a7f.zip | 3 - ...-types-npm-0.8.0-4c175fd383-99714ec956.zip | 3 + CHANGELOG.md | 2 + packages/cli/package.json | 2 +- packages/cosmwasm-stargate/package.json | 2 +- packages/proto-signing/package.json | 2 +- packages/stargate/package.json | 2 +- .../stargate/src/modules/bank/queries.spec.ts | 80 ++++++++++--------- yarn.lock | 16 ++-- 10 files changed, 67 insertions(+), 61 deletions(-) delete mode 100644 .yarn/cache/cosmjs-types-npm-0.7.2-655e4f4384-4a0b730a7f.zip create mode 100644 .yarn/cache/cosmjs-types-npm-0.8.0-4c175fd383-99714ec956.zip diff --git a/.pnp.cjs b/.pnp.cjs index b293dc37..79e39426 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -1040,7 +1040,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ],\ [\ "cosmjs-types",\ - "npm:0.7.2"\ + "npm:0.8.0"\ ],\ [\ "cross-spawn",\ @@ -3240,7 +3240,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["axios", "npm:0.21.4"],\ ["babylon", "npm:6.18.0"],\ ["chalk", "npm:4.1.2"],\ - ["cosmjs-types", "npm:0.7.2"],\ + ["cosmjs-types", "npm:0.8.0"],\ ["diff", "npm:4.0.2"],\ ["eslint", "npm:7.26.0"],\ ["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],\ @@ -3286,7 +3286,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/pako", "npm:1.0.1"],\ ["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.54.0"],\ ["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.54.0"],\ - ["cosmjs-types", "npm:0.7.2"],\ + ["cosmjs-types", "npm:0.8.0"],\ ["eslint", "npm:7.26.0"],\ ["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],\ ["eslint-import-resolver-node", "npm:0.3.4"],\ @@ -3659,7 +3659,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/node", "npm:18.15.11"],\ ["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.54.0"],\ ["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.54.0"],\ - ["cosmjs-types", "npm:0.7.2"],\ + ["cosmjs-types", "npm:0.8.0"],\ ["eslint", "npm:7.26.0"],\ ["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],\ ["eslint-import-resolver-node", "npm:0.3.4"],\ @@ -3760,7 +3760,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/node", "npm:18.15.11"],\ ["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.54.0"],\ ["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.54.0"],\ - ["cosmjs-types", "npm:0.7.2"],\ + ["cosmjs-types", "npm:0.8.0"],\ ["eslint", "npm:7.26.0"],\ ["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],\ ["eslint-import-resolver-node", "npm:0.3.4"],\ @@ -6992,10 +6992,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { }]\ ]],\ ["cosmjs-types", [\ - ["npm:0.7.2", {\ - "packageLocation": "./.yarn/cache/cosmjs-types-npm-0.7.2-655e4f4384-4a0b730a7f.zip/node_modules/cosmjs-types/",\ + ["npm:0.8.0", {\ + "packageLocation": "./.yarn/cache/cosmjs-types-npm-0.8.0-4c175fd383-99714ec956.zip/node_modules/cosmjs-types/",\ "packageDependencies": [\ - ["cosmjs-types", "npm:0.7.2"],\ + ["cosmjs-types", "npm:0.8.0"],\ ["long", "npm:4.0.0"],\ ["protobufjs", "npm:6.11.3"]\ ],\ diff --git a/.yarn/cache/cosmjs-types-npm-0.7.2-655e4f4384-4a0b730a7f.zip b/.yarn/cache/cosmjs-types-npm-0.7.2-655e4f4384-4a0b730a7f.zip deleted file mode 100644 index 77d1b890..00000000 --- a/.yarn/cache/cosmjs-types-npm-0.7.2-655e4f4384-4a0b730a7f.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:175b22a10012a3a71aaedcbc0d0d91f48186d3d393ca3ef8a7915a4cd670493b -size 1141753 diff --git a/.yarn/cache/cosmjs-types-npm-0.8.0-4c175fd383-99714ec956.zip b/.yarn/cache/cosmjs-types-npm-0.8.0-4c175fd383-99714ec956.zip new file mode 100644 index 00000000..6fa9b74c --- /dev/null +++ b/.yarn/cache/cosmjs-types-npm-0.8.0-4c175fd383-99714ec956.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e13a216c190d35403482b571ccbd193228085a05f0583919b363800bf5614333 +size 1513560 diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d8827d..15a65711 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to ### Changed +- all: upgrade cosmjs-types to 0.8.0 to include Cosmos SDK 0.46/0.47 and IBC v7 + types. - @cosmjs/cosmwasm-stargate: Implement auto-detection for Tendermint 0.34/37 ([#1411]). - @cosmjs/cosmwasm-stargate: Remove structured `searchTx` queries. Only raw diff --git a/packages/cli/package.json b/packages/cli/package.json index a9467517..94036f05 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -54,7 +54,7 @@ "axios": "^0.21.2", "babylon": "^6.18.0", "chalk": "^4", - "cosmjs-types": "^0.7.1", + "cosmjs-types": "^0.8.0", "diff": "^4", "recast": "^0.20", "ts-node": "^8", diff --git a/packages/cosmwasm-stargate/package.json b/packages/cosmwasm-stargate/package.json index 85d18171..9396765c 100644 --- a/packages/cosmwasm-stargate/package.json +++ b/packages/cosmwasm-stargate/package.json @@ -46,7 +46,7 @@ "@cosmjs/stargate": "workspace:^", "@cosmjs/tendermint-rpc": "workspace:^", "@cosmjs/utils": "workspace:^", - "cosmjs-types": "^0.7.1", + "cosmjs-types": "^0.8.0", "long": "^4.0.0", "pako": "^2.0.2" }, diff --git a/packages/proto-signing/package.json b/packages/proto-signing/package.json index 2b9baf5d..a081e742 100644 --- a/packages/proto-signing/package.json +++ b/packages/proto-signing/package.json @@ -44,7 +44,7 @@ "@cosmjs/encoding": "workspace:^", "@cosmjs/math": "workspace:^", "@cosmjs/utils": "workspace:^", - "cosmjs-types": "^0.7.1", + "cosmjs-types": "^0.8.0", "long": "^4.0.0" }, "devDependencies": { diff --git a/packages/stargate/package.json b/packages/stargate/package.json index 0bcb34c0..e40a9a47 100644 --- a/packages/stargate/package.json +++ b/packages/stargate/package.json @@ -46,7 +46,7 @@ "@cosmjs/stream": "workspace:^", "@cosmjs/tendermint-rpc": "workspace:^", "@cosmjs/utils": "workspace:^", - "cosmjs-types": "^0.7.1", + "cosmjs-types": "^0.8.0", "long": "^4.0.0", "protobufjs": "~6.11.3", "xstream": "^11.14.0" diff --git a/packages/stargate/src/modules/bank/queries.spec.ts b/packages/stargate/src/modules/bank/queries.spec.ts index 7f7b96ff..94ad3544 100644 --- a/packages/stargate/src/modules/bank/queries.spec.ts +++ b/packages/stargate/src/modules/bank/queries.spec.ts @@ -150,25 +150,27 @@ describe("BankExtension", () => { const [client, tmClient] = await makeClientWithBank(simapp.tendermintUrl); const metadata = await client.bank.denomMetadata("ucosm"); - expect(metadata).toEqual({ - description: "The fee token of this test chain", - denomUnits: [ - { - denom: "ucosm", - exponent: 0, - aliases: [], - }, - { - denom: "COSM", - exponent: 6, - aliases: [], - }, - ], - base: "ucosm", - display: "COSM", - name: "", - symbol: "", - }); + expect(metadata).toEqual( + jasmine.objectContaining({ + description: "The fee token of this test chain", + denomUnits: [ + { + denom: "ucosm", + exponent: 0, + aliases: [], + }, + { + denom: "COSM", + exponent: 6, + aliases: [], + }, + ], + base: "ucosm", + display: "COSM", + name: "", + symbol: "", + }), + ); tmClient.disconnect(); }); @@ -190,25 +192,27 @@ describe("BankExtension", () => { const metadatas = await client.bank.denomsMetadata(); expect(metadatas.length).toEqual(1); - expect(metadatas[0]).toEqual({ - description: "The fee token of this test chain", - denomUnits: [ - { - denom: "ucosm", - exponent: 0, - aliases: [], - }, - { - denom: "COSM", - exponent: 6, - aliases: [], - }, - ], - base: "ucosm", - display: "COSM", - name: "", - symbol: "", - }); + expect(metadatas[0]).toEqual( + jasmine.objectContaining({ + description: "The fee token of this test chain", + denomUnits: [ + { + denom: "ucosm", + exponent: 0, + aliases: [], + }, + { + denom: "COSM", + exponent: 6, + aliases: [], + }, + ], + base: "ucosm", + display: "COSM", + name: "", + symbol: "", + }), + ); tmClient.disconnect(); }); diff --git a/yarn.lock b/yarn.lock index 1e460405..09da7746 100644 --- a/yarn.lock +++ b/yarn.lock @@ -362,7 +362,7 @@ __metadata: axios: ^0.21.2 babylon: ^6.18.0 chalk: ^4 - cosmjs-types: ^0.7.1 + cosmjs-types: ^0.8.0 diff: ^4 eslint: ^7.5 eslint-config-prettier: ^8.3.0 @@ -408,7 +408,7 @@ __metadata: "@types/pako": ^1.0.1 "@typescript-eslint/eslint-plugin": ^5.54.0 "@typescript-eslint/parser": ^5.54.0 - cosmjs-types: ^0.7.1 + cosmjs-types: ^0.8.0 eslint: ^7.5 eslint-config-prettier: ^8.3.0 eslint-import-resolver-node: ^0.3.4 @@ -767,7 +767,7 @@ __metadata: "@types/node": ^18 "@typescript-eslint/eslint-plugin": ^5.54.0 "@typescript-eslint/parser": ^5.54.0 - cosmjs-types: ^0.7.1 + cosmjs-types: ^0.8.0 eslint: ^7.5 eslint-config-prettier: ^8.3.0 eslint-import-resolver-node: ^0.3.4 @@ -864,7 +864,7 @@ __metadata: "@types/node": ^18 "@typescript-eslint/eslint-plugin": ^5.54.0 "@typescript-eslint/parser": ^5.54.0 - cosmjs-types: ^0.7.1 + cosmjs-types: ^0.8.0 eslint: ^7.5 eslint-config-prettier: ^8.3.0 eslint-import-resolver-node: ^0.3.4 @@ -2982,13 +2982,13 @@ __metadata: languageName: unknown linkType: soft -"cosmjs-types@npm:^0.7.1": - version: 0.7.2 - resolution: "cosmjs-types@npm:0.7.2" +"cosmjs-types@npm:^0.8.0": + version: 0.8.0 + resolution: "cosmjs-types@npm:0.8.0" dependencies: long: ^4.0.0 protobufjs: ~6.11.2 - checksum: 4a0b730a7f1ae8efa8bd044f9ebdd7921f26319ff2abf36ac7e2f93ef6f3e73d90c1775ce2325611d47c4ccc72a708a63e31e89d9d80ad75c1107c7228e09bc8 + checksum: 99714ec956d2cb2e521d39896c9c9a24cf9df0d370265c203646ea015b51e86472efc0cb11f67a80f0649d178b0bcff77ac659e67fdfc8b2437cd7a42018577f languageName: node linkType: hard From 94cce4cbe6ecd4eb211059e6a6cac7c9306c78fa Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 4 Apr 2023 10:38:39 +0200 Subject: [PATCH 2/2] Fix proto-signing testing --- packages/proto-signing/src/decode.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/proto-signing/src/decode.spec.ts b/packages/proto-signing/src/decode.spec.ts index 4a783ace..e4f39cfa 100644 --- a/packages/proto-signing/src/decode.spec.ts +++ b/packages/proto-signing/src/decode.spec.ts @@ -33,7 +33,7 @@ describe("decode", () => { const decoded = decodeTxRaw(fromHex(testVector.outputs.signedTxBytes)); expect(decoded).toEqual({ - authInfo: { + authInfo: jasmine.objectContaining({ signerInfos: [ { publicKey: { @@ -55,7 +55,7 @@ describe("decode", () => { granter: "", amount: [{ amount: "2000", denom: "ucosm" }], }, - }, + }), body: { memo: "", timeoutHeight: Long.UZERO,