Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported V1 MsgVote #364

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@terra-money/terra.js",
"version": "3.1.10",
"version": "3.1.11",
"description": "The JavaScript SDK for Terra",
"license": "MIT",
"author": "Terraform Labs, PTE.",
Expand Down Expand Up @@ -28,6 +28,7 @@
"node": ">=14"
},
"scripts": {
"buildBasic": "tsc --module commonjs",
"build": "tsc --module commonjs && webpack --mode production",
"test": "jest --runInBand",
"format": "prettier --check ./src/**/*.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/core/Msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export namespace Msg {
case '/cosmos.gov.v1beta1.MsgSubmitProposal':
return MsgSubmitProposal.fromData(data, isClassic);
case '/cosmos.gov.v1beta1.MsgVote':
case '/cosmos.gov.v1.MsgVote':
return MsgVote.fromData(data, isClassic);
case '/cosmos.gov.v1beta1.MsgVoteWeighted':
return MsgVoteWeighted.fromData(data, isClassic);
Expand Down Expand Up @@ -467,6 +468,7 @@ export namespace Msg {
case '/cosmos.gov.v1beta1.MsgSubmitProposal':
return MsgSubmitProposal.unpackAny(proto, isClassic);
case '/cosmos.gov.v1beta1.MsgVote':
case '/cosmos.gov.v1.MsgVote':
return MsgVote.unpackAny(proto, isClassic);

// market
Expand Down
11 changes: 10 additions & 1 deletion src/core/gov/msgs/MsgVote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,21 @@ export namespace MsgVote {
};
}

export interface Data {
export interface DataV1Beta1 {
'@type': '/cosmos.gov.v1beta1.MsgVote';
proposal_id: string;
voter: AccAddress;
option: Option;
}

export interface DataV1 {
'@type': '/cosmos.gov.v1.MsgVote';
proposal_id: string;
voter: AccAddress;
option: Option;
}

export type Data = DataV1Beta1 | DataV1;

export type Proto = MsgVote_pb;
}