Merge pull request #1131 from cosmos/upgrade-cosmjs-types

Upgrade cosmjs-types to 0.5.0 and adapt code
This commit is contained in:
Simon Warta 2022-06-13 16:51:35 +02:00 committed by GitHub
commit 3348c2854a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 38 additions and 29 deletions

16
.pnp.cjs generated
View File

@ -1031,7 +1031,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
],
[
"cosmjs-types",
"npm:0.4.0"
"npm:0.5.0"
],
[
"cross-spawn",
@ -3227,7 +3227,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.4.0"],
["cosmjs-types", "npm:0.5.0"],
["diff", "npm:4.0.2"],
["eslint", "npm:7.26.0"],
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
@ -3273,7 +3273,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@types/pako", "npm:1.0.1"],
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.13.0"],
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.13.0"],
["cosmjs-types", "npm:0.4.0"],
["cosmjs-types", "npm:0.5.0"],
["eslint", "npm:7.26.0"],
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
["eslint-import-resolver-node", "npm:0.3.4"],
@ -3646,7 +3646,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@types/node", "npm:15.3.1"],
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.13.0"],
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.13.0"],
["cosmjs-types", "npm:0.4.0"],
["cosmjs-types", "npm:0.5.0"],
["eslint", "npm:7.26.0"],
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
["eslint-import-resolver-node", "npm:0.3.4"],
@ -3747,7 +3747,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@types/node", "npm:15.3.1"],
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.13.0"],
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:5.13.0"],
["cosmjs-types", "npm:0.4.0"],
["cosmjs-types", "npm:0.5.0"],
["eslint", "npm:7.26.0"],
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
["eslint-import-resolver-node", "npm:0.3.4"],
@ -6886,10 +6886,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]
]],
["cosmjs-types", [
["npm:0.4.0", {
"packageLocation": "./.yarn/cache/cosmjs-types-npm-0.4.0-accb450c96-ffc3e6451e.zip/node_modules/cosmjs-types/",
["npm:0.5.0", {
"packageLocation": "./.yarn/cache/cosmjs-types-npm-0.5.0-f6798779ac-caface3c6d.zip/node_modules/cosmjs-types/",
"packageDependencies": [
["cosmjs-types", "npm:0.4.0"],
["cosmjs-types", "npm:0.5.0"],
["long", "npm:4.0.0"],
["protobufjs", "npm:6.11.2"]
],

Binary file not shown.

BIN
.yarn/cache/cosmjs-types-npm-0.5.0-f6798779ac-caface3c6d.zip (Stored with Git LFS) vendored Normal file

Binary file not shown.

View File

@ -15,9 +15,11 @@ and this project adheres to
### Changed
- all: Upgrade cosmjs-types to 0.5 ([#1131]).
- @cosmjs/stargate: Change `packetCommitment` parameter `sequence` type from
`Long` to `number` ([#1168]).
[#1131]: https://github.com/cosmos/cosmjs/pull/1131
[#1168]: https://github.com/cosmos/cosmjs/pull/1168
## [0.28.6] - 2022-06-08

View File

@ -53,7 +53,7 @@
"axios": "^0.21.2",
"babylon": "^6.18.0",
"chalk": "^4",
"cosmjs-types": "^0.4.0",
"cosmjs-types": "^0.5.0",
"diff": "^4",
"recast": "^0.20",
"ts-node": "^8",

View File

@ -46,7 +46,7 @@
"@cosmjs/stargate": "workspace:packages/stargate",
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
"@cosmjs/utils": "workspace:packages/utils",
"cosmjs-types": "^0.4.0",
"cosmjs-types": "^0.5.0",
"long": "^4.0.0",
"pako": "^2.0.2"
},

View File

@ -210,12 +210,14 @@ describe("WasmExtension", () => {
const { contractInfo } = await client.wasm.getContractInfo(myAddress);
assert(contractInfo);
expect({ ...contractInfo }).toEqual({
expect(contractInfo).toEqual({
codeId: Long.fromNumber(hackatomCodeId, true),
creator: alice.address0,
label: "my escrow",
admin: "",
ibcPortId: "",
created: undefined,
extension: undefined,
});
expect(contractInfo.admin).toEqual("");
});

View File

@ -44,7 +44,7 @@
"@cosmjs/encoding": "workspace:packages/encoding",
"@cosmjs/math": "workspace:packages/math",
"@cosmjs/utils": "workspace:packages/utils",
"cosmjs-types": "^0.4.0",
"cosmjs-types": "^0.5.0",
"long": "^4.0.0"
},
"devDependencies": {

View File

@ -44,6 +44,7 @@ describe("decode", () => {
single: {
mode: SignMode.SIGN_MODE_DIRECT,
},
multi: undefined,
},
sequence: Long.UZERO,
},

View File

@ -46,7 +46,7 @@
"@cosmjs/stream": "workspace:packages/stream",
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
"@cosmjs/utils": "workspace:packages/utils",
"cosmjs-types": "^0.4.0",
"cosmjs-types": "^0.5.0",
"long": "^4.0.0",
"protobufjs": "~6.11.3",
"xstream": "^11.14.0"

View File

@ -28,7 +28,7 @@ describe("AuthExtension", () => {
expect(account.typeUrl).toEqual("/cosmos.auth.v1beta1.BaseAccount");
expect(BaseAccount.decode(account.value)).toEqual({
address: unused.address,
// pubKey not set
pubKey: undefined,
accountNumber: Long.fromNumber(unused.accountNumber, true),
sequence: Long.UZERO,
});

View File

@ -18,6 +18,7 @@ import {
QueryConnectionChannelsResponse,
QueryNextSequenceReceiveResponse,
QueryPacketAcknowledgementResponse,
QueryPacketAcknowledgementsRequest,
QueryPacketAcknowledgementsResponse,
QueryPacketCommitmentResponse,
QueryPacketCommitmentsResponse,
@ -303,22 +304,25 @@ export function setupIbcExtension(base: QueryClient): IbcExtension {
channelId: channelId,
sequence: Long.fromNumber(sequence, true),
}),
packetAcknowledgements: async (portId: string, channelId: string, paginationKey?: Uint8Array) =>
channelQueryService.PacketAcknowledgements({
packetAcknowledgements: async (portId: string, channelId: string, paginationKey?: Uint8Array) => {
const request = QueryPacketAcknowledgementsRequest.fromPartial({
portId: portId,
channelId: channelId,
pagination: createPagination(paginationKey),
}),
});
return channelQueryService.PacketAcknowledgements(request);
},
allPacketAcknowledgements: async (portId: string, channelId: string) => {
const acknowledgements = [];
let response: QueryPacketAcknowledgementsResponse;
let key: Uint8Array | undefined;
do {
response = await channelQueryService.PacketAcknowledgements({
const request = QueryPacketAcknowledgementsRequest.fromPartial({
channelId: channelId,
portId: portId,
pagination: createPagination(key),
});
response = await channelQueryService.PacketAcknowledgements(request);
acknowledgements.push(...response.acknowledgements);
key = response.pagination?.nextKey;
} while (key && key.length);

View File

@ -362,7 +362,7 @@ __metadata:
axios: ^0.21.2
babylon: ^6.18.0
chalk: ^4
cosmjs-types: ^0.4.0
cosmjs-types: ^0.5.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.13.0
"@typescript-eslint/parser": ^5.13.0
cosmjs-types: ^0.4.0
cosmjs-types: ^0.5.0
eslint: ^7.5
eslint-config-prettier: ^8.3.0
eslint-import-resolver-node: ^0.3.4
@ -767,7 +767,7 @@ __metadata:
"@types/node": ^15.0.1
"@typescript-eslint/eslint-plugin": ^5.13.0
"@typescript-eslint/parser": ^5.13.0
cosmjs-types: ^0.4.0
cosmjs-types: ^0.5.0
eslint: ^7.5
eslint-config-prettier: ^8.3.0
eslint-import-resolver-node: ^0.3.4
@ -864,7 +864,7 @@ __metadata:
"@types/node": ^15.0.1
"@typescript-eslint/eslint-plugin": ^5.13.0
"@typescript-eslint/parser": ^5.13.0
cosmjs-types: ^0.4.0
cosmjs-types: ^0.5.0
eslint: ^7.5
eslint-config-prettier: ^8.3.0
eslint-import-resolver-node: ^0.3.4
@ -2903,13 +2903,13 @@ __metadata:
languageName: unknown
linkType: soft
"cosmjs-types@npm:^0.4.0":
version: 0.4.0
resolution: "cosmjs-types@npm:0.4.0"
"cosmjs-types@npm:^0.5.0":
version: 0.5.0
resolution: "cosmjs-types@npm:0.5.0"
dependencies:
long: ^4.0.0
protobufjs: ~6.11.2
checksum: ffc3e6451e85023f81e17ae55cc221d2be77fa01ac65cbd51ec69b695c49a7fba5ddd50a913e519db8aae821f02f0c1a231a2d20337d4646ca520bb3584631a1
checksum: caface3c6d1fa1d2a848b13629fc1e1fe9afbd231bbea09a2b81ab3a7585937e139101bda6f1e85bff55ad5f7136356eff08b897d484c7f875de0d5da5b23dc0
languageName: node
linkType: hard