From 4f9f09e3f8ac4dc8ec3f17b7ed676140d45fdec1 Mon Sep 17 00:00:00 2001 From: Milan Steiner Date: Fri, 4 Feb 2022 15:27:21 +0100 Subject: [PATCH 1/5] Adding new messages to defaultRegistryTypes --- packages/stargate/src/signingstargateclient.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 0d34e1c7..9089f4b4 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -14,6 +14,7 @@ import { } from "@cosmjs/proto-signing"; import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; import { assert, assertDefined } from "@cosmjs/utils"; +import { MsgExec, MsgGrant, MsgRevoke } from "cosmjs-types/authz/staking/v1beta1/tx"; import { MsgMultiSend } from "cosmjs-types/cosmos/bank/v1beta1/tx"; import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin"; import { @@ -22,6 +23,7 @@ import { MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, } from "cosmjs-types/cosmos/distribution/v1beta1/tx"; +import { MsgGrantAllowance, MsgRevokeAllowance} from "cosmjs-types/cosmos/feegrant/v1beta1/tx"; import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx"; import { MsgBeginRedelegate, @@ -85,6 +87,11 @@ export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], + ["/cosmos.authz.v1beta1.MsgGrant", MsgGrant], + ["/cosmos.authz.v1beta1.MsgExec", MsgExec], + ["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke], + ["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], + ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], ["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], From 532dd70400e621b8f980c86f32533c8456c3cdfc Mon Sep 17 00:00:00 2001 From: Milan Steiner Date: Mon, 7 Feb 2022 09:07:36 +0100 Subject: [PATCH 2/5] Fix imports --- packages/stargate/src/signingstargateclient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 9089f4b4..e86834c6 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -14,7 +14,7 @@ import { } from "@cosmjs/proto-signing"; import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; import { assert, assertDefined } from "@cosmjs/utils"; -import { MsgExec, MsgGrant, MsgRevoke } from "cosmjs-types/authz/staking/v1beta1/tx"; +import { MsgExec, MsgGrant, MsgRevoke } from "cosmjs-types/cosmos/authz/v1beta1/tx"; import { MsgMultiSend } from "cosmjs-types/cosmos/bank/v1beta1/tx"; import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin"; import { @@ -23,7 +23,7 @@ import { MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, } from "cosmjs-types/cosmos/distribution/v1beta1/tx"; -import { MsgGrantAllowance, MsgRevokeAllowance} from "cosmjs-types/cosmos/feegrant/v1beta1/tx"; +import { MsgGrantAllowance, MsgRevokeAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/tx"; import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx"; import { MsgBeginRedelegate, From 7aad55177bb814069ef1869154da20bb7d188df5 Mon Sep 17 00:00:00 2001 From: Milan Steiner Date: Mon, 7 Feb 2022 14:18:56 +0100 Subject: [PATCH 3/5] Alphabetically sorting defaultRegistryTypes --- .../stargate/src/signingstargateclient.ts | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/stargate/src/signingstargateclient.ts b/packages/stargate/src/signingstargateclient.ts index 9a9d457a..f485fc29 100644 --- a/packages/stargate/src/signingstargateclient.ts +++ b/packages/stargate/src/signingstargateclient.ts @@ -74,13 +74,18 @@ import { calculateFee, GasPrice } from "./fee"; import { DeliverTxResponse, StargateClient } from "./stargateclient"; export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ - ["/cosmos.base.v1beta1.Coin", Coin], - ["/cosmos.bank.v1beta1.MsgSend", MsgSend], + ["/cosmos.authz.v1beta1.MsgExec", MsgExec], + ["/cosmos.authz.v1beta1.MsgGrant", MsgGrant], + ["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], + ["/cosmos.bank.v1beta1.MsgSend", MsgSend], + ["/cosmos.base.v1beta1.Coin", Coin], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], + ["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], + ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit], ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.gov.v1beta1.MsgVote", MsgVote], @@ -89,30 +94,25 @@ export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [ ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], - ["/cosmos.authz.v1beta1.MsgGrant", MsgGrant], - ["/cosmos.authz.v1beta1.MsgExec", MsgExec], - ["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke], - ["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], - ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], - ["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], - ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], + ["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], + ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement], + ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], + ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], - ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], - ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], + ["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], + ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], - ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement], ["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], + ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], - ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], - ["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], - ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm], - ["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], + ["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], + ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ]; function createDefaultRegistry(): Registry { From cae8d10bff7ae358b168b295c1cabc64e988942e Mon Sep 17 00:00:00 2001 From: Milan Steiner Date: Mon, 7 Feb 2022 14:21:40 +0100 Subject: [PATCH 4/5] Add changes to CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6268a8f1..1991f8f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ and this project adheres to - @cosmjs/proto-signing: `Registry`'s constructor can now override default types. ([#994]) - @cosmjs/tendermint-rpc: The property `evidence` in the interface `Block` is now non-optional. ([#1011]) +- @cosmjs/stargate: Added the following message types to stargate's `defaultRegistryTypes`: + - cosmos.authz.v1beta1.MsgGrant + - cosmos.authz.v1beta1.MsgExec + - cosmos.authz.v1beta1.MsgRevoke + - cosmos.feegrant.v1beta1.MsgGrantAllowance + - cosmos.feegrant.v1beta1.MsgRevokeAllowance + [#989]: https://github.com/cosmos/cosmjs/issues/989 [#994]: https://github.com/cosmos/cosmjs/issues/994 From c8dd256b00009f32b0deb94e6d762ae40ac01269 Mon Sep 17 00:00:00 2001 From: Milan Steiner Date: Mon, 7 Feb 2022 14:23:03 +0100 Subject: [PATCH 5/5] Linked issue to changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1991f8f2..16d5ef5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to - @cosmjs/proto-signing: `Registry`'s constructor can now override default types. ([#994]) - @cosmjs/tendermint-rpc: The property `evidence` in the interface `Block` is now non-optional. ([#1011]) -- @cosmjs/stargate: Added the following message types to stargate's `defaultRegistryTypes`: +- @cosmjs/stargate: Added the following message types to stargate's `defaultRegistryTypes`: ([#1026]) - cosmos.authz.v1beta1.MsgGrant - cosmos.authz.v1beta1.MsgExec - cosmos.authz.v1beta1.MsgRevoke @@ -28,6 +28,7 @@ and this project adheres to [#989]: https://github.com/cosmos/cosmjs/issues/989 [#994]: https://github.com/cosmos/cosmjs/issues/994 [#1011]: https://github.com/cosmos/cosmjs/issues/1011 +[#1026]: https://github.com/cosmos/cosmjs/issues/1026 ### Removed