mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Upgrade cosmjs-types to 0.3.0 and adapt code
This commit is contained in:
parent
f8bd2e3783
commit
09b94d77dc
16
.pnp.js
generated
16
.pnp.js
generated
@ -1032,7 +1032,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
"cosmjs-types",
|
"cosmjs-types",
|
||||||
"npm:0.2.1"
|
"npm:0.3.0"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"create-hash",
|
"create-hash",
|
||||||
@ -3276,7 +3276,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||||||
["axios", "npm:0.21.4"],
|
["axios", "npm:0.21.4"],
|
||||||
["babylon", "npm:6.18.0"],
|
["babylon", "npm:6.18.0"],
|
||||||
["colors", "npm:1.4.0"],
|
["colors", "npm:1.4.0"],
|
||||||
["cosmjs-types", "npm:0.2.1"],
|
["cosmjs-types", "npm:0.3.0"],
|
||||||
["diff", "npm:4.0.2"],
|
["diff", "npm:4.0.2"],
|
||||||
["eslint", "npm:7.26.0"],
|
["eslint", "npm:7.26.0"],
|
||||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||||
@ -3322,7 +3322,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||||||
["@types/pako", "npm:1.0.1"],
|
["@types/pako", "npm:1.0.1"],
|
||||||
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||||
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||||
["cosmjs-types", "npm:0.2.1"],
|
["cosmjs-types", "npm:0.3.0"],
|
||||||
["eslint", "npm:7.26.0"],
|
["eslint", "npm:7.26.0"],
|
||||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||||
["eslint-import-resolver-node", "npm:0.3.4"],
|
["eslint-import-resolver-node", "npm:0.3.4"],
|
||||||
@ -3760,7 +3760,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||||||
["@types/node", "npm:15.3.1"],
|
["@types/node", "npm:15.3.1"],
|
||||||
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||||
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||||
["cosmjs-types", "npm:0.2.1"],
|
["cosmjs-types", "npm:0.3.0"],
|
||||||
["eslint", "npm:7.26.0"],
|
["eslint", "npm:7.26.0"],
|
||||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||||
["eslint-import-resolver-node", "npm:0.3.4"],
|
["eslint-import-resolver-node", "npm:0.3.4"],
|
||||||
@ -3864,7 +3864,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||||||
["@types/node", "npm:15.3.1"],
|
["@types/node", "npm:15.3.1"],
|
||||||
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
["@typescript-eslint/eslint-plugin", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||||
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
["@typescript-eslint/parser", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:4.28.4"],
|
||||||
["cosmjs-types", "npm:0.2.1"],
|
["cosmjs-types", "npm:0.3.0"],
|
||||||
["eslint", "npm:7.26.0"],
|
["eslint", "npm:7.26.0"],
|
||||||
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
["eslint-config-prettier", "virtual:4f1584ad4aba8733a24be7c8aebbffafef25607f2d00f4b314cf96717145c692763628a31c2b85d4686fbb091ff21ebffa3cc337399c042c19a32b9bdb786464#npm:8.3.0"],
|
||||||
["eslint-import-resolver-node", "npm:0.3.4"],
|
["eslint-import-resolver-node", "npm:0.3.4"],
|
||||||
@ -6990,10 +6990,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
|||||||
}]
|
}]
|
||||||
]],
|
]],
|
||||||
["cosmjs-types", [
|
["cosmjs-types", [
|
||||||
["npm:0.2.1", {
|
["npm:0.3.0", {
|
||||||
"packageLocation": "./.yarn/cache/cosmjs-types-npm-0.2.1-484eba1129-01baa0822f.zip/node_modules/cosmjs-types/",
|
"packageLocation": "./.yarn/cache/cosmjs-types-npm-0.3.0-7e874d3092-1587522225.zip/node_modules/cosmjs-types/",
|
||||||
"packageDependencies": [
|
"packageDependencies": [
|
||||||
["cosmjs-types", "npm:0.2.1"],
|
["cosmjs-types", "npm:0.3.0"],
|
||||||
["long", "npm:4.0.0"],
|
["long", "npm:4.0.0"],
|
||||||
["protobufjs", "npm:6.11.2"]
|
["protobufjs", "npm:6.11.2"]
|
||||||
],
|
],
|
||||||
|
BIN
.yarn/cache/cosmjs-types-npm-0.2.1-484eba1129-01baa0822f.zip
(Stored with Git LFS)
vendored
BIN
.yarn/cache/cosmjs-types-npm-0.2.1-484eba1129-01baa0822f.zip
(Stored with Git LFS)
vendored
Binary file not shown.
BIN
.yarn/cache/cosmjs-types-npm-0.3.0-7e874d3092-1587522225.zip
(Stored with Git LFS)
vendored
Normal file
BIN
.yarn/cache/cosmjs-types-npm-0.3.0-7e874d3092-1587522225.zip
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
@ -54,7 +54,7 @@
|
|||||||
"axios": "^0.21.2",
|
"axios": "^0.21.2",
|
||||||
"babylon": "^6.18.0",
|
"babylon": "^6.18.0",
|
||||||
"colors": "^1.3.3",
|
"colors": "^1.3.3",
|
||||||
"cosmjs-types": "^0.2.0",
|
"cosmjs-types": "^0.3.0",
|
||||||
"diff": "^4",
|
"diff": "^4",
|
||||||
"recast": "^0.20",
|
"recast": "^0.20",
|
||||||
"ts-node": "^8",
|
"ts-node": "^8",
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
"@cosmjs/stargate": "workspace:packages/stargate",
|
"@cosmjs/stargate": "workspace:packages/stargate",
|
||||||
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
|
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
|
||||||
"@cosmjs/utils": "workspace:packages/utils",
|
"@cosmjs/utils": "workspace:packages/utils",
|
||||||
"cosmjs-types": "^0.2.0",
|
"cosmjs-types": "^0.3.0",
|
||||||
"long": "^4.0.0",
|
"long": "^4.0.0",
|
||||||
"pako": "^2.0.2",
|
"pako": "^2.0.2",
|
||||||
"protobufjs": "~6.10.2"
|
"protobufjs": "~6.10.2"
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"@cosmjs/amino": "workspace:packages/amino",
|
"@cosmjs/amino": "workspace:packages/amino",
|
||||||
"@cosmjs/crypto": "workspace:packages/crypto",
|
"@cosmjs/crypto": "workspace:packages/crypto",
|
||||||
"@cosmjs/math": "workspace:packages/math",
|
"@cosmjs/math": "workspace:packages/math",
|
||||||
"cosmjs-types": "^0.2.0",
|
"cosmjs-types": "^0.3.0",
|
||||||
"long": "^4.0.0",
|
"long": "^4.0.0",
|
||||||
"protobufjs": "~6.10.2"
|
"protobufjs": "~6.10.2"
|
||||||
},
|
},
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
"@cosmjs/stream": "workspace:packages/stream",
|
"@cosmjs/stream": "workspace:packages/stream",
|
||||||
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
|
"@cosmjs/tendermint-rpc": "workspace:packages/tendermint-rpc",
|
||||||
"@cosmjs/utils": "workspace:packages/utils",
|
"@cosmjs/utils": "workspace:packages/utils",
|
||||||
"cosmjs-types": "^0.2.0",
|
"cosmjs-types": "^0.3.0",
|
||||||
"long": "^4.0.0",
|
"long": "^4.0.0",
|
||||||
"protobufjs": "~6.10.2",
|
"protobufjs": "~6.10.2",
|
||||||
"xstream": "^11.14.0"
|
"xstream": "^11.14.0"
|
||||||
|
@ -3,7 +3,7 @@ import { toAscii } from "@cosmjs/encoding";
|
|||||||
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
|
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
|
||||||
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
|
||||||
import { assert, sleep } from "@cosmjs/utils";
|
import { assert, sleep } from "@cosmjs/utils";
|
||||||
import { ProposalStatus, TextProposal, VoteOption } from "cosmjs-types/cosmos/gov/v1beta1/gov";
|
import { ProposalStatus, TextProposal, Vote, VoteOption } from "cosmjs-types/cosmos/gov/v1beta1/gov";
|
||||||
import { Any } from "cosmjs-types/google/protobuf/any";
|
import { Any } from "cosmjs-types/google/protobuf/any";
|
||||||
import Long from "long";
|
import Long from "long";
|
||||||
|
|
||||||
@ -328,16 +328,16 @@ describe("GovExtension", () => {
|
|||||||
const response = await client.gov.votes(proposalId);
|
const response = await client.gov.votes(proposalId);
|
||||||
expect(response.votes).toEqual([
|
expect(response.votes).toEqual([
|
||||||
// why is vote 2 first?
|
// why is vote 2 first?
|
||||||
{
|
Vote.fromPartial({
|
||||||
proposalId: longify(proposalId),
|
proposalId: longify(proposalId),
|
||||||
voter: voter2Address,
|
voter: voter2Address,
|
||||||
option: VoteOption.VOTE_OPTION_NO_WITH_VETO,
|
option: VoteOption.VOTE_OPTION_NO_WITH_VETO,
|
||||||
},
|
}),
|
||||||
{
|
Vote.fromPartial({
|
||||||
proposalId: longify(proposalId),
|
proposalId: longify(proposalId),
|
||||||
voter: voter1Address,
|
voter: voter1Address,
|
||||||
option: VoteOption.VOTE_OPTION_YES,
|
option: VoteOption.VOTE_OPTION_YES,
|
||||||
},
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
tmClient.disconnect();
|
tmClient.disconnect();
|
||||||
@ -351,11 +351,13 @@ describe("GovExtension", () => {
|
|||||||
const [client, tmClient] = await makeClientWithGov(simapp.tendermintUrl);
|
const [client, tmClient] = await makeClientWithGov(simapp.tendermintUrl);
|
||||||
|
|
||||||
const response = await client.gov.vote(proposalId, voter1Address);
|
const response = await client.gov.vote(proposalId, voter1Address);
|
||||||
expect(response.vote).toEqual({
|
expect(response.vote).toEqual(
|
||||||
|
Vote.fromPartial({
|
||||||
voter: voter1Address,
|
voter: voter1Address,
|
||||||
proposalId: longify(proposalId),
|
proposalId: longify(proposalId),
|
||||||
option: VoteOption.VOTE_OPTION_YES,
|
option: VoteOption.VOTE_OPTION_YES,
|
||||||
});
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
tmClient.disconnect();
|
tmClient.disconnect();
|
||||||
});
|
});
|
||||||
|
@ -23,12 +23,12 @@ export function toAccAddress(address: string): Uint8Array {
|
|||||||
*/
|
*/
|
||||||
export function createPagination(paginationKey?: Uint8Array): PageRequest | undefined {
|
export function createPagination(paginationKey?: Uint8Array): PageRequest | undefined {
|
||||||
return paginationKey
|
return paginationKey
|
||||||
? {
|
? PageRequest.fromPartial({
|
||||||
key: paginationKey,
|
key: paginationKey,
|
||||||
offset: Long.fromNumber(0, true),
|
offset: Long.fromNumber(0, true),
|
||||||
limit: Long.fromNumber(0, true),
|
limit: Long.fromNumber(0, true),
|
||||||
countTotal: false,
|
countTotal: false,
|
||||||
}
|
})
|
||||||
: undefined;
|
: undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
yarn.lock
16
yarn.lock
@ -367,7 +367,7 @@ __metadata:
|
|||||||
axios: ^0.21.2
|
axios: ^0.21.2
|
||||||
babylon: ^6.18.0
|
babylon: ^6.18.0
|
||||||
colors: ^1.3.3
|
colors: ^1.3.3
|
||||||
cosmjs-types: ^0.2.0
|
cosmjs-types: ^0.3.0
|
||||||
diff: ^4
|
diff: ^4
|
||||||
eslint: ^7.5
|
eslint: ^7.5
|
||||||
eslint-config-prettier: ^8.3.0
|
eslint-config-prettier: ^8.3.0
|
||||||
@ -413,7 +413,7 @@ __metadata:
|
|||||||
"@types/pako": ^1.0.1
|
"@types/pako": ^1.0.1
|
||||||
"@typescript-eslint/eslint-plugin": ^4.28
|
"@typescript-eslint/eslint-plugin": ^4.28
|
||||||
"@typescript-eslint/parser": ^4.28
|
"@typescript-eslint/parser": ^4.28
|
||||||
cosmjs-types: ^0.2.0
|
cosmjs-types: ^0.3.0
|
||||||
eslint: ^7.5
|
eslint: ^7.5
|
||||||
eslint-config-prettier: ^8.3.0
|
eslint-config-prettier: ^8.3.0
|
||||||
eslint-import-resolver-node: ^0.3.4
|
eslint-import-resolver-node: ^0.3.4
|
||||||
@ -835,7 +835,7 @@ __metadata:
|
|||||||
"@types/node": ^15.0.1
|
"@types/node": ^15.0.1
|
||||||
"@typescript-eslint/eslint-plugin": ^4.28
|
"@typescript-eslint/eslint-plugin": ^4.28
|
||||||
"@typescript-eslint/parser": ^4.28
|
"@typescript-eslint/parser": ^4.28
|
||||||
cosmjs-types: ^0.2.0
|
cosmjs-types: ^0.3.0
|
||||||
eslint: ^7.5
|
eslint: ^7.5
|
||||||
eslint-config-prettier: ^8.3.0
|
eslint-config-prettier: ^8.3.0
|
||||||
eslint-import-resolver-node: ^0.3.4
|
eslint-import-resolver-node: ^0.3.4
|
||||||
@ -935,7 +935,7 @@ __metadata:
|
|||||||
"@types/node": ^15.0.1
|
"@types/node": ^15.0.1
|
||||||
"@typescript-eslint/eslint-plugin": ^4.28
|
"@typescript-eslint/eslint-plugin": ^4.28
|
||||||
"@typescript-eslint/parser": ^4.28
|
"@typescript-eslint/parser": ^4.28
|
||||||
cosmjs-types: ^0.2.0
|
cosmjs-types: ^0.3.0
|
||||||
eslint: ^7.5
|
eslint: ^7.5
|
||||||
eslint-config-prettier: ^8.3.0
|
eslint-config-prettier: ^8.3.0
|
||||||
eslint-import-resolver-node: ^0.3.4
|
eslint-import-resolver-node: ^0.3.4
|
||||||
@ -3011,13 +3011,13 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"cosmjs-types@npm:^0.2.0":
|
"cosmjs-types@npm:^0.3.0":
|
||||||
version: 0.2.1
|
version: 0.3.0
|
||||||
resolution: "cosmjs-types@npm:0.2.1"
|
resolution: "cosmjs-types@npm:0.3.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
long: ^4.0.0
|
long: ^4.0.0
|
||||||
protobufjs: ~6.11.2
|
protobufjs: ~6.11.2
|
||||||
checksum: 01baa0822fa2409ac6f87b682784b9aa3408cdd028c5da6215719f6ea2329ff473c9731e19cf5cbea06b1a18905f03a352830d933b0e261c285ffa6de98fb0db
|
checksum: 15875222256af17bb1e88d2dad5d189e2c2288821587459c3b099c15139170b4083fbebb47d1e8e0ebcee128edc3f233ee2f2470eb85c3752fde69d459db0773
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user