diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb8877f3..73da62f25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Released +### v1.2.5 +- Backport `GovRepenChannel` tx and `GovCloseChannel` proposal +- Add Logic to handle pending delegations on `regen-1` post upgrade once channel are open. +- Upgrade Handler: + - Fix `EpochProvisions` value + - Set DistributionProportions params + ### v1.2.4 - Bump Tendermint to v0.34.26 (informalsystems/tendermint) - Bump Cosmos-SDK to v0.46.10 diff --git a/app/upgrades.go b/app/upgrades.go index a11451816..7880da2b0 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -7,6 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + minttypes "github.com/ingenuity-build/quicksilver/x/mint/types" ) // upgrade name consts: vMMmmppUpgradeName (M=Major, m=minor, p=patch) @@ -16,12 +18,14 @@ const ( DevnetChainID = "quicktest-1" v010204UpgradeName = "v1.2.4" + v010205UpgradeName = "v1.2.5" v010300UpgradeName = "v1.3.0" // retained for testy ) func setUpgradeHandlers(app *Quicksilver) { app.UpgradeKeeper.SetUpgradeHandler(v010300UpgradeName, noOpUpgradeHandler(app)) // retained for testy app.UpgradeKeeper.SetUpgradeHandler(v010204UpgradeName, v010204UpgradeHandler(app)) + app.UpgradeKeeper.SetUpgradeHandler(v010205UpgradeName, v010205UpgradeHandler(app)) // When a planned update height is reached, the old binary will panic // writing on disk the height and name of the update that triggered it @@ -78,3 +82,23 @@ func v010204UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler { return app.mm.RunMigrations(ctx, app.configurator, fromVM) } } + +func v010205UpgradeHandler(app *Quicksilver) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + // update minter epoch-provisions + minter := app.MintKeeper.GetMinter(ctx) + minter.EpochProvisions = sdk.NewDec(50_000_000_000_000).Quo(sdk.NewDec(365)) + app.MintKeeper.SetMinter(ctx, minter) + + // update params + params := app.MintKeeper.GetParams(ctx) + params.DistributionProportions = minttypes.DistributionProportions{ + Staking: sdk.NewDecWithPrec(80, 2), + PoolIncentives: sdk.NewDecWithPrec(17, 2), + ParticipationRewards: sdk.NewDec(0), + CommunityPool: sdk.NewDecWithPrec(3, 2), + } + app.MintKeeper.SetParams(ctx, params) + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + } +} diff --git a/app/upgrades_test.go b/app/upgrades_test.go index 631dc6c1c..468f48c88 100644 --- a/app/upgrades_test.go +++ b/app/upgrades_test.go @@ -1,5 +1,20 @@ package app +import ( + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ibctesting "github.com/cosmos/ibc-go/v5/testing" + "github.com/ingenuity-build/quicksilver/utils" + icskeeper "github.com/ingenuity-build/quicksilver/x/interchainstaking/keeper" + icstypes "github.com/ingenuity-build/quicksilver/x/interchainstaking/types" + minttypes "github.com/ingenuity-build/quicksilver/x/mint/types" + tokenfactorytypes "github.com/ingenuity-build/quicksilver/x/tokenfactory/types" + "github.com/stretchr/testify/suite" + "testing" + "time" +) + // TODO: this test runs in isolation, but fails as part of `make test`. // In the `make test` context, MintCoins() seems to have no effect. Why is this? // func TestReplaceZone(t *testing.T) { @@ -67,3 +82,223 @@ package app // require.False(t, app.AirdropKeeper.GetZoneDropAccountBalance(ctx, "osmotest-4").Amount.Equal(sdk.NewInt(1000000))) // require.True(t, app.AirdropKeeper.GetZoneDropAccountBalance(ctx, "osmo-test-4").Amount.Equal(sdk.NewInt(1000000))) // } + +func init() { + ibctesting.DefaultTestingAppInit = SetupTestingApp +} + +// TestKeeperTestSuite runs all the tests within this package. +func TestAppTestSuite(t *testing.T) { + suite.Run(t, new(AppTestSuite)) +} + +func newQuicksilverPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { + path := ibctesting.NewPath(chainA, chainB) + path.EndpointA.ChannelConfig.PortID = ibctesting.TransferPort + path.EndpointB.ChannelConfig.PortID = ibctesting.TransferPort + + return path +} + +type AppTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + + // testing chains used for convenience and readability + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain + + path *ibctesting.Path +} + +func (s *AppTestSuite) GetQuicksilverApp(chain *ibctesting.TestChain) *Quicksilver { + app, ok := chain.App.(*Quicksilver) + if !ok { + panic("not quicksilver app") + } + + return app +} + +// SetupTest creates a coordinator with 2 test chains. +func (suite *AppTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) // initializes 2 test chains + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) // convenience and readability + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) // convenience and readability + + suite.path = newQuicksilverPath(suite.chainA, suite.chainB) + suite.coordinator.SetupConnections(suite.path) + + suite.coordinator.CurrentTime = time.Now().UTC() + suite.coordinator.UpdateTime() + + suite.initTestZone() +} + +func (suite *AppTestSuite) initTestZone() { + // test zone + zone := icstypes.Zone{ + ConnectionId: suite.path.EndpointA.ConnectionID, + ChainId: suite.chainB.ChainID, + AccountPrefix: "bcosmos", + LocalDenom: "uqatom", + BaseDenom: "uatom", + MultiSend: false, + LiquidityModule: true, + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetZone(suite.chainA.GetContext(), &zone) + + // cosmos zone + zone = icstypes.Zone{ + ConnectionId: "connection-77001", + ChainId: "cosmoshub-4", + AccountPrefix: "cosmos", + LocalDenom: "uqatom", + BaseDenom: "uatom", + MultiSend: false, + LiquidityModule: false, + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetZone(suite.chainA.GetContext(), &zone) + + // osmosis zone + zone = icstypes.Zone{ + ConnectionId: "connection-77002", + ChainId: "osmosis-1", + AccountPrefix: "osmo", + LocalDenom: "uqosmo", + BaseDenom: "uosmo", + MultiSend: false, + LiquidityModule: true, + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetZone(suite.chainA.GetContext(), &zone) + // uni-5 zone + zone = icstypes.Zone{ + ConnectionId: "connection-77003", + ChainId: "uni-5", + AccountPrefix: "juno", + LocalDenom: "uqjunox", + BaseDenom: "ujunox", + MultiSend: false, + LiquidityModule: true, + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetZone(suite.chainA.GetContext(), &zone) + + reciept := icstypes.Receipt{ + ChainId: "uni-5", + Sender: utils.GenerateAccAddressForTest().String(), + Txhash: "TestDeposit01", + Amount: sdk.NewCoins( + sdk.NewCoin( + "ujunox", + sdk.NewIntFromUint64(2000000), // 20% deposit + ), + ), + } + + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetReceipt(suite.chainA.GetContext(), reciept) + + ubRecord := icstypes.UnbondingRecord{ + ChainId: "uni-5", + EpochNumber: 1, + Validator: "junovaloper185hgkqs8q8ysnc8cvkgd8j2knnq2m0ah6ae73gntv9ampgwpmrxqlfzywn", + RelatedTxhash: []string{"ABC012"}, + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetUnbondingRecord(suite.chainA.GetContext(), ubRecord) + + rdRecord := icstypes.RedelegationRecord{ + ChainId: "uni-5", + EpochNumber: 1, + Source: "junovaloper185hgkqs8q8ysnc8cvkgd8j2knnq2m0ah6ae73gntv9ampgwpmrxqlfzywn", + Destination: "junovaloper1z89utvygweg5l56fsk8ak7t6hh88fd0aa9ywed", + Amount: 3000000, + CompletionTime: time.Time(suite.chainA.GetContext().BlockTime().Add(time.Hour)), + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetRedelegationRecord(suite.chainA.GetContext(), rdRecord) + + rdRecord = icstypes.RedelegationRecord{ + ChainId: "osmosis-1", + EpochNumber: 1, + Source: "osmovaloper1zxavllftfx3a3y5ldfyze7jnu5uyuktsfx2jcc", + Destination: "osmovaloper13eq5c99ym05jn02e78l8cac2fagzgdhh4294zk", + Amount: 3000000, + CompletionTime: time.Time{}, + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetRedelegationRecord(suite.chainA.GetContext(), rdRecord) + + delRecord := icstypes.Delegation{ + Amount: sdk.NewCoin(zone.BaseDenom, sdk.NewInt(17000)), + DelegationAddress: "juno1z89utvygweg5l56fsk8ak7t6hh88fd0azcjpz5", + Height: 10, + ValidatorAddress: "junovaloper185hgkqs8q8ysnc8cvkgd8j2knnq2m0ah6ae73gntv9ampgwpmrxqlfzywn", + RedelegationEnd: -62135596800, + } + + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetDelegation(suite.chainA.GetContext(), &zone, delRecord) + + wRecord := icstypes.WithdrawalRecord{ + ChainId: "uni-5", + Delegator: utils.GenerateAccAddressForTest().String(), + Distribution: []*icstypes.Distribution{ + {Valoper: "junovaloper185hgkqs8q8ysnc8cvkgd8j2knnq2m0ah6ae73gntv9ampgwpmrxqlfzywn", Amount: 1000000}, + {Valoper: "junovaloper1z89utvygweg5l56fsk8ak7t6hh88fd0aa9ywed", Amount: 1000000}, + }, + Recipient: "juno1z89utvygweg5l56fsk8ak7t6hh88fd0azcjpz5", + Amount: sdk.NewCoins(sdk.NewCoin("ujunox", sdk.NewInt(4000000))), + BurnAmount: sdk.NewCoin("ujunox", sdk.NewInt(4000000)), + Txhash: "7C8B95EEE82CB63771E02EBEB05E6A80076D70B2E0A1C457F1FD1A0EF2EA961D", + Status: icskeeper.WithdrawStatusQueued, + } + suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetWithdrawalRecord(suite.chainA.GetContext(), wRecord) + + err := suite.GetQuicksilverApp(suite.chainA).BankKeeper.MintCoins(suite.chainA.GetContext(), tokenfactorytypes.ModuleName, sdk.NewCoins(sdk.NewCoin("uqjunox", sdkmath.NewInt(202000000)))) + if err != nil { + return + } + addr1, err := utils.AccAddressFromBech32("quick17v9kk34km3w6hdjs2sn5s5qjdu2zrm0m3rgtmq", "quick") + if err != nil { + return + } + addr2, err := utils.AccAddressFromBech32("quick16x03wcp37kx5e8ehckjxvwcgk9j0cqnhcccnty", "quick") + if err != nil { + return + } + + err = suite.GetQuicksilverApp(suite.chainA).BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), tokenfactorytypes.ModuleName, addr1, sdk.NewCoins(sdk.NewCoin("uqjunox", sdkmath.NewInt(1600000)))) + if err != nil { + return + } + err = suite.GetQuicksilverApp(suite.chainA).BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), tokenfactorytypes.ModuleName, addr2, sdk.NewCoins(sdk.NewCoin("uqjunox", sdkmath.NewInt(200000000)))) + if err != nil { + return + } + err = suite.GetQuicksilverApp(suite.chainA).BankKeeper.SendCoinsFromModuleToModule(suite.chainA.GetContext(), tokenfactorytypes.ModuleName, icstypes.EscrowModuleAccount, sdk.NewCoins(sdk.NewCoin("uqjunox", sdkmath.NewInt(400000)))) + if err != nil { + return + } +} + +func (s *AppTestSuite) TestV010205UpgradeHandler() { + app := s.GetQuicksilverApp(s.chainA) + handler := v010205UpgradeHandler(app) + ctx := s.chainA.GetContext() + + expectedVal := sdk.NewDec(50_000_000_000_000).Quo(sdk.NewDec(365)) + expectedProportions := minttypes.DistributionProportions{ + Staking: sdk.NewDecWithPrec(80, 2), + PoolIncentives: sdk.NewDecWithPrec(17, 2), + ParticipationRewards: sdk.NewDec(0), + CommunityPool: sdk.NewDecWithPrec(3, 2), + } + _, err := handler(ctx, types.Plan{}, app.mm.GetVersionMap()) + s.Require().NoError(err) + + // assert EpochProvisions + minter := app.MintKeeper.GetMinter(ctx) + s.Require().Equal(expectedVal, minter.EpochProvisions) + + // assert DistributionProportions + params := app.MintKeeper.GetParams(ctx) + s.Require().Equal(expectedProportions, params.DistributionProportions) + +} diff --git a/go.mod b/go.mod index c2b7f32c7..3c676c032 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( cloud.google.com/go/compute/metadata v0.2.1 // indirect cloud.google.com/go/iam v0.7.0 // indirect cloud.google.com/go/storage v1.27.0 // indirect - cosmossdk.io/errors v1.0.0-beta.7 // indirect + cosmossdk.io/errors v1.0.0-beta.7 filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/proto/quicksilver/interchainstaking/v1/messages.proto b/proto/quicksilver/interchainstaking/v1/messages.proto index a2b345f1c..c8b2b02d3 100644 --- a/proto/quicksilver/interchainstaking/v1/messages.proto +++ b/proto/quicksilver/interchainstaking/v1/messages.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "quicksilver/interchainstaking/v1/interchainstaking.proto"; +import "quicksilver/interchainstaking/v1/proposals.proto"; import "google/api/annotations.proto"; option go_package = "github.com/ingenuity-build/quicksilver/x/interchainstaking/types"; @@ -28,6 +29,21 @@ service Msg { body : "*" }; }; + + rpc GovCloseChannel(MsgGovCloseChannel) returns (MsgGovCloseChannelResponse) { + option (google.api.http) = { + post : "/quicksilver/tx/v1/interchainstaking/close_channel" + body : "*" + }; + }; + + rpc GovReopenChannel(MsgGovReopenChannel) + returns (MsgGovReopenChannelResponse) { + option (google.api.http) = { + post : "/quicksilver/tx/v1/interchainstaking/reopen_channel" + body : "*" + }; + }; } // MsgRequestRedemption represents a message type to request a burn of qAssets diff --git a/proto/quicksilver/interchainstaking/v1/proposals.proto b/proto/quicksilver/interchainstaking/v1/proposals.proto index 4ed0bb649..3f24a6588 100644 --- a/proto/quicksilver/interchainstaking/v1/proposals.proto +++ b/proto/quicksilver/interchainstaking/v1/proposals.proto @@ -76,26 +76,34 @@ message UpdateZoneValue { string value = 2 [ (gogoproto.moretags) = "yaml:\"value\"" ]; } -// message ReopenChannel { -// option (gogoproto.equal) = false; -// option (gogoproto.goproto_getters) = false; -// option (gogoproto.goproto_stringer) = false; +message MsgGovReopenChannel { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string title = 1; + string description = 2; -// string title = 1; -// string description = 2; + string connection_id = 3 [ (gogoproto.moretags) = "yaml:\"connection_id\"" ]; + string port_id = 4 [ (gogoproto.moretags) = "yaml:\"port_id\"" ]; -// string connection_id = 3 [ (gogoproto.moretags) = "yaml:\"connection_id\"" -// ]; string channel_id = 4 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; -// } + string authority = 5 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} -// message CloseChannel { -// option (gogoproto.equal) = false; -// option (gogoproto.goproto_getters) = false; -// option (gogoproto.goproto_stringer) = false; +// MsgGovReopenChannelResponse defines the MsgGovReopenChannel response type. +message MsgGovReopenChannelResponse {} -// string title = 1; -// string description = 2; +message MsgGovCloseChannel { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string title = 1; + string description = 2; + + string channel_id = 3 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; + string port_id = 4 [ (gogoproto.moretags) = "yaml:\"port_id\"" ]; + + string authority = 5 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} -// string connection_id = 3 [ (gogoproto.moretags) = "yaml:\"connection_id\"" -// ]; string channel_id = 4 [ (gogoproto.moretags) = "yaml:\"channel_id\"" ]; -// } +// MsgGovCloseChannelResponse defines the MsgGovCloseChannel response type. +message MsgGovCloseChannelResponse {} diff --git a/x/interchainstaking/client/cli/tx.go b/x/interchainstaking/client/cli/tx.go index b4655e77f..6001b4933 100644 --- a/x/interchainstaking/client/cli/tx.go +++ b/x/interchainstaking/client/cli/tx.go @@ -32,6 +32,7 @@ func GetTxCmd() *cobra.Command { txCmd.AddCommand(GetSignalIntentTxCmd()) txCmd.AddCommand(GetRequestRedemptionTxCmd()) + txCmd.AddCommand(GetReopenChannelTxCmd()) return txCmd } @@ -93,6 +94,31 @@ func GetRequestRedemptionTxCmd() *cobra.Command { return cmd } +// GetReopenChannelTxCmd returns a CLI command handler for creating a Reopen ICA port transaction. +func GetReopenChannelTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "reopen [connection] [port]", + Short: `Reopen closed ICA port.`, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + connectionID := args[0] + port := args[1] + + msg := types.NewMsgGovReopenChannel(connectionID, port, clientCtx.GetFromAddress()) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + // GetCmdSubmitRegisterProposal implements the command to submit a register-zone proposal func GetCmdSubmitRegisterProposal() *cobra.Command { cmd := &cobra.Command{ @@ -178,7 +204,7 @@ func ParseZoneRegistrationProposal(cdc codec.JSONCodec, proposalFile string) (ty return proposal, nil } -// GetCmdSubmitRegisterProposal implements the command to submit a register-zone proposal +// GetCmdSubmitUpdateProposal implements the command to submit a register-zone proposal func GetCmdSubmitUpdateProposal() *cobra.Command { cmd := &cobra.Command{ Use: "update-zone [proposal-file]", diff --git a/x/interchainstaking/keeper/abci.go b/x/interchainstaking/keeper/abci.go index a743fa85c..6c549de8f 100644 --- a/x/interchainstaking/keeper/abci.go +++ b/x/interchainstaking/keeper/abci.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" tmtypes "github.com/cosmos/ibc-go/v5/modules/light-clients/07-tendermint/types" - "github.com/ingenuity-build/quicksilver/x/interchainstaking/types" ) @@ -16,7 +16,28 @@ type zoneItrFn func(index int64, zoneInfo types.Zone) (stop bool) // BeginBlocker of interchainstaking module func (k Keeper) BeginBlocker(ctx sdk.Context) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + // post upgrade-v1.2.5 processing + if ctx.BlockHeight() == 14540740 { + zone, found := k.GetZone(ctx, "regen-1") + if found { + k.IterateReceipts(ctx, func(_ int64, receiptInfo types.Receipt) (stop bool) { + if receiptInfo.ChainId == "regen-1" && receiptInfo.Completed == nil { + sendMsg := banktypes.MsgSend{ + FromAddress: "", + ToAddress: "", + Amount: receiptInfo.Amount, + } + err := k.handleSendToDelegate(ctx, &zone, &sendMsg, receiptInfo.Txhash) + if err != nil { + k.Logger(ctx).Error("error in processing Pending delegations for regen-1 ", "error", err) + } + } + return false + }) + } + + } if ctx.BlockHeight()%30 == 0 { if err := k.GCCompletedRedelegations(ctx); err != nil { k.Logger(ctx).Error("error in GCCompletedRedelegations", "error", err) diff --git a/x/interchainstaking/keeper/keeper.go b/x/interchainstaking/keeper/keeper.go index 73512cf60..1b08ef67a 100644 --- a/x/interchainstaking/keeper/keeper.go +++ b/x/interchainstaking/keeper/keeper.go @@ -18,6 +18,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" icacontrollerkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper" @@ -26,6 +27,7 @@ import ( ibctmtypes "github.com/cosmos/ibc-go/v5/modules/light-clients/07-tendermint/types" "github.com/tendermint/tendermint/libs/log" + config "github.com/ingenuity-build/quicksilver/cmd/config" "github.com/ingenuity-build/quicksilver/utils" claimsmanagerkeeper "github.com/ingenuity-build/quicksilver/x/claimsmanager/keeper" interchainquerykeeper "github.com/ingenuity-build/quicksilver/x/interchainquery/keeper" @@ -81,6 +83,10 @@ func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, accountKeeper auth } } +func (k *Keeper) GetGovAuthority(ctx sdk.Context) string { + return sdk.MustBech32ifyAddressBytes(config.Bech32Prefix, k.AccountKeeper.GetModuleAddress(govtypes.ModuleName)) +} + // Logger returns a module-specific logger. func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) diff --git a/x/interchainstaking/keeper/msg_server.go b/x/interchainstaking/keeper/msg_server.go index 80834800a..ad31579e5 100644 --- a/x/interchainstaking/keeper/msg_server.go +++ b/x/interchainstaking/keeper/msg_server.go @@ -8,16 +8,17 @@ import ( "errors" "fmt" "sort" + "strings" "time" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - lsmstakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" - "github.com/ingenuity-build/quicksilver/internal/multierror" "github.com/ingenuity-build/quicksilver/utils" "github.com/ingenuity-build/quicksilver/x/interchainstaking/types" + lsmstakingtypes "github.com/iqlusioninc/liquidity-staking-module/x/staking/types" ) type msgServer struct { @@ -317,3 +318,80 @@ func (k Keeper) EmitValsetRequery(ctx sdk.Context, connectionID string, chainID ) return nil } + +// GovReopenChannel reopens an ICA channel. +func (k msgServer) GovReopenChannel(goCtx context.Context, msg *types.MsgGovReopenChannel) (*types.MsgGovReopenChannelResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // remove leanding prefix icacontroller- if passed in msg + portID := strings.ReplaceAll(msg.PortId, "icacontroller-", "") + + // validate the zone exists, and the format is valid (e.g. quickgaia-1.delegate) + parts := strings.Split(portID, ".") + + if len(parts) != 2 { + return &types.MsgGovReopenChannelResponse{}, errors.New("invalid port format") + } + + if _, found := k.GetZone(ctx, parts[0]); !found { + return &types.MsgGovReopenChannelResponse{}, errors.New("invalid port format; zone not found") + } + + if parts[1] != "delegate" && parts[1] != "deposit" && parts[1] != "performance" && parts[1] != "withdrawal" { + return &types.MsgGovReopenChannelResponse{}, errors.New("invalid port format; unexpected account") + } + + if err := k.Keeper.registerInterchainAccount(ctx, msg.ConnectionId, portID); err != nil { + return &types.MsgGovReopenChannelResponse{}, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + sdk.NewEvent( + types.EventTypeReopenICA, + sdk.NewAttribute(types.AttributeKeyPortID, portID), + sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), + ), + }) + + return &types.MsgGovReopenChannelResponse{}, nil +} + +// GovCloseChannel closes an ICA channel. +func (k msgServer) GovCloseChannel(goCtx context.Context, msg *types.MsgGovCloseChannel) (*types.MsgGovCloseChannelResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // checking msg authority is the gov module address + if k.Keeper.GetGovAuthority(ctx) != msg.Authority { + return &types.MsgGovCloseChannelResponse{}, + govtypes.ErrInvalidSigner.Wrapf( + "invalid authority: expected %s, got %s", + k.Keeper.GetGovAuthority(ctx), msg.Authority, + ) + } + + _, cap, err := k.Keeper.IBCKeeper.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return &types.MsgGovCloseChannelResponse{}, err + } + + if err := k.IBCKeeper.ChannelKeeper.ChanCloseInit(ctx, msg.PortId, msg.ChannelId, cap); err != nil { + return &types.MsgGovCloseChannelResponse{}, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + sdk.NewEvent( + types.EventTypeReopenICA, + sdk.NewAttribute(types.AttributeKeyPortID, msg.PortId), + sdk.NewAttribute(types.AttributeKeyChannelID, msg.ChannelId), + ), + }) + + return &types.MsgGovCloseChannelResponse{}, nil +} diff --git a/x/interchainstaking/types/codec.go b/x/interchainstaking/types/codec.go index 0d9fe3615..a7e2c1088 100644 --- a/x/interchainstaking/types/codec.go +++ b/x/interchainstaking/types/codec.go @@ -29,6 +29,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgSignalIntent{}, &MsgRequestRedemption{}, + &MsgGovCloseChannel{}, + &MsgGovReopenChannel{}, ) registry.RegisterImplementations( diff --git a/x/interchainstaking/types/events.go b/x/interchainstaking/types/events.go index fcdf59dcb..03572ca5a 100644 --- a/x/interchainstaking/types/events.go +++ b/x/interchainstaking/types/events.go @@ -3,6 +3,8 @@ package types const ( EventTypeRegisterZone = "register_zone" EventTypeRedemptionRequest = "request_redemption" + EventTypeCloseICA = "close_ica_channel" + EventTypeReopenICA = "reopen_ica_channel" AttributeKeyConnectionID = "connection_id" AttributeKeyRecipientChain = "chain_id" @@ -10,6 +12,8 @@ const ( AttributeKeyBurnAmount = "burn_amount" AttributeKeyRedeemAmount = "redeem_amount" AttributeKeySourceAddress = "source" + AttributeKeyPortID = "port_name" + AttributeKeyChannelID = "channel_id" AttributeValueCategory = ModuleName ) diff --git a/x/interchainstaking/types/messages.pb.go b/x/interchainstaking/types/messages.pb.go index 2c9e86190..8563dca2c 100644 --- a/x/interchainstaking/types/messages.pb.go +++ b/x/interchainstaking/types/messages.pb.go @@ -199,42 +199,48 @@ func init() { } var fileDescriptor_ee484030fa140a82 = []byte{ - // 551 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xb1, 0x6f, 0xd3, 0x4e, - 0x14, 0xc7, 0x7d, 0xad, 0x7e, 0xbf, 0xb6, 0xd7, 0x8a, 0x0a, 0x27, 0x12, 0x49, 0x54, 0xd9, 0x91, - 0xa7, 0xaa, 0x50, 0x1f, 0x29, 0x52, 0x05, 0x41, 0x42, 0x10, 0x58, 0x32, 0x64, 0x71, 0xb7, 0x2e, - 0xd1, 0x25, 0x7e, 0x5c, 0x4f, 0xb5, 0xef, 0x52, 0xdf, 0x39, 0x6a, 0xd6, 0x4e, 0x8c, 0x48, 0xfc, - 0x03, 0xfd, 0x23, 0x2a, 0xfe, 0x01, 0x96, 0x8e, 0x15, 0x2c, 0x4c, 0x11, 0x4a, 0x18, 0x98, 0x18, - 0xf2, 0x17, 0xa0, 0xd8, 0x4e, 0x95, 0x90, 0x48, 0x81, 0x8a, 0xed, 0xce, 0xdf, 0xf7, 0x7d, 0xef, - 0xf3, 0xfc, 0xde, 0x61, 0x72, 0x16, 0xf3, 0xf6, 0xa9, 0xe2, 0x41, 0x17, 0x22, 0xc2, 0x85, 0x86, - 0xa8, 0x7d, 0x42, 0xb9, 0x50, 0x9a, 0x9e, 0x72, 0xc1, 0x48, 0xb7, 0x42, 0x42, 0x50, 0x8a, 0x32, - 0x50, 0x6e, 0x27, 0x92, 0x5a, 0x9a, 0xe5, 0x29, 0x83, 0x3b, 0x67, 0x70, 0xbb, 0x95, 0x52, 0x9e, - 0x49, 0x26, 0x93, 0x60, 0x32, 0x3e, 0xa5, 0xbe, 0x52, 0xb1, 0x2d, 0x55, 0x28, 0x55, 0x33, 0x15, - 0xd2, 0x4b, 0x26, 0x59, 0xe9, 0x8d, 0xb4, 0xa8, 0x02, 0xd2, 0xad, 0xb4, 0x40, 0xd3, 0x0a, 0x69, - 0x4b, 0x2e, 0x32, 0xfd, 0xe9, 0x52, 0xc6, 0x79, 0x8e, 0xd4, 0xb9, 0xc3, 0xa4, 0x64, 0x01, 0x10, - 0xda, 0xe1, 0x84, 0x0a, 0x21, 0x35, 0xd5, 0x5c, 0x8a, 0xac, 0xae, 0xf3, 0x13, 0xe1, 0x7c, 0x43, - 0x31, 0x0f, 0xce, 0x62, 0x50, 0xda, 0x03, 0x1f, 0xc2, 0xce, 0x58, 0x37, 0xdf, 0xe0, 0xff, 0xba, - 0x34, 0x88, 0xa1, 0x80, 0xca, 0x68, 0x77, 0xf3, 0xa0, 0xe8, 0x66, 0xb8, 0x63, 0x40, 0x37, 0x03, -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 0x97, 0xad, 0xb3, 0xbb, 0xa8, 0x70, 0xe9, 0xc5, 0xdd, 0x7c, 0xb7, - 0xc0, 0x87, 0x17, 0x5f, 0xbe, 0x7f, 0x58, 0x79, 0xec, 0x3c, 0x9c, 0x79, 0x7f, 0xfa, 0x7c, 0xe1, - 0x32, 0x93, 0x08, 0x7c, 0x80, 0xb0, 0x8a, 0xf6, 0xcc, 0x2b, 0x84, 0xb7, 0x66, 0xc6, 0x57, 0xf9, - 0x23, 0x90, 0x69, 0x4b, 0xe9, 0xd9, 0x5f, 0x5b, 0xee, 0x88, 0x9d, 0x2e, 0x41, 0x15, 0xed, 0xd5, - 0x8e, 0xaf, 0x07, 0x16, 0xba, 0x19, 0x58, 0xe8, 0xdb, 0xc0, 0x42, 0xef, 0x87, 0x96, 0x71, 0x33, - 0xb4, 0x8c, 0xaf, 0x43, 0xcb, 0x38, 0x7e, 0xc9, 0xb8, 0x3e, 0x89, 0x5b, 0x6e, 0x5b, 0x86, 0x84, - 0x0b, 0x06, 0x22, 0xe6, 0xba, 0xb7, 0xdf, 0x8a, 0x79, 0xe0, 0xcf, 0xd4, 0x38, 0x5f, 0x90, 0x5f, - 0xf7, 0x3a, 0xa0, 0x5a, 0xff, 0x27, 0x8f, 0xf9, 0xc9, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x82, - 0xaf, 0x48, 0xda, 0xca, 0x04, 0x00, 0x00, + // 641 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x4f, 0x13, 0x41, + 0x18, 0xc6, 0x3b, 0x10, 0xf9, 0x33, 0x10, 0xd1, 0x85, 0x44, 0x68, 0xc8, 0x96, 0xec, 0x89, 0xa8, + 0xec, 0x52, 0x50, 0x44, 0x14, 0xa2, 0xc5, 0x84, 0x70, 0xe0, 0xb2, 0xdc, 0xb8, 0x34, 0xd3, 0xdd, + 0xd7, 0x61, 0xc2, 0xee, 0xcc, 0xb2, 0x33, 0xbb, 0x81, 0xab, 0x27, 0x8f, 0x26, 0xfa, 0x01, 0xf8, + 0x10, 0xc4, 0x2f, 0xa0, 0x07, 0x8e, 0x44, 0x2f, 0x9e, 0x1a, 0x03, 0x1e, 0x3c, 0x79, 0xe0, 0x13, + 0x98, 0xfd, 0xd3, 0xa6, 0xa5, 0x4d, 0x5a, 0x1b, 0x6f, 0x33, 0x7d, 0xde, 0xdf, 0xfb, 0x3e, 0x4f, + 0x67, 0x66, 0xb1, 0x75, 0x1c, 0x31, 0xe7, 0x48, 0x32, 0x2f, 0x86, 0xd0, 0x62, 0x5c, 0x41, 0xe8, + 0x1c, 0x12, 0xc6, 0xa5, 0x22, 0x47, 0x8c, 0x53, 0x2b, 0x2e, 0x5b, 0x3e, 0x48, 0x49, 0x28, 0x48, + 0x33, 0x08, 0x85, 0x12, 0xda, 0x42, 0x0b, 0x60, 0x76, 0x00, 0x66, 0x5c, 0x2e, 0xce, 0x50, 0x41, + 0x45, 0x5a, 0x6c, 0x25, 0xab, 0x8c, 0x2b, 0xce, 0x39, 0x42, 0xfa, 0x42, 0x56, 0x33, 0x21, 0xdb, + 0xe4, 0x92, 0x9e, 0xed, 0xac, 0x1a, 0x91, 0x60, 0xc5, 0xe5, 0x1a, 0x28, 0x52, 0xb6, 0x1c, 0xc1, + 0x78, 0xae, 0xaf, 0xf7, 0xf4, 0xd8, 0xe9, 0x23, 0x23, 0x97, 0x7b, 0x92, 0x41, 0x28, 0x02, 0x21, + 0x89, 0xd7, 0xf0, 0x32, 0x4f, 0x85, 0xa0, 0x1e, 0x58, 0x24, 0x60, 0x16, 0xe1, 0x5c, 0x28, 0xa2, + 0x98, 0xe0, 0xb9, 0x6a, 0xfc, 0x41, 0x78, 0x66, 0x4f, 0x52, 0x1b, 0x8e, 0x23, 0x90, 0xca, 0x06, + 0x17, 0xfc, 0x20, 0xd1, 0xb5, 0x37, 0xf8, 0x4e, 0x4c, 0xbc, 0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x99, 0x8e, 0xf0, 0x2d, 0xc6, 0x29, 0xf0, 0x88, 0xa9, 0xd3, + 0xa5, 0x5a, 0xc4, 0x3c, 0xb7, 0x6d, 0xd6, 0x49, 0x97, 0x39, 0xea, 0x34, 0x00, 0x59, 0x1b, 0x49, + 0x3f, 0xaf, 0xab, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x8b, 0x53, 0xb9, 0x8e, 0x06, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -255,6 +261,8 @@ type MsgClient interface { // SignalIntent defines a method for signalling voting intent for one or more // validators. SignalIntent(ctx context.Context, in *MsgSignalIntent, opts ...grpc.CallOption) (*MsgSignalIntentResponse, error) + GovCloseChannel(ctx context.Context, in *MsgGovCloseChannel, opts ...grpc.CallOption) (*MsgGovCloseChannelResponse, error) + GovReopenChannel(ctx context.Context, in *MsgGovReopenChannel, opts ...grpc.CallOption) (*MsgGovReopenChannelResponse, error) } type msgClient struct { @@ -283,6 +291,24 @@ func (c *msgClient) SignalIntent(ctx context.Context, in *MsgSignalIntent, opts return out, nil } +func (c *msgClient) GovCloseChannel(ctx context.Context, in *MsgGovCloseChannel, opts ...grpc.CallOption) (*MsgGovCloseChannelResponse, error) { + out := new(MsgGovCloseChannelResponse) + err := c.cc.Invoke(ctx, "/quicksilver.interchainstaking.v1.Msg/GovCloseChannel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) GovReopenChannel(ctx context.Context, in *MsgGovReopenChannel, opts ...grpc.CallOption) (*MsgGovReopenChannelResponse, error) { + out := new(MsgGovReopenChannelResponse) + err := c.cc.Invoke(ctx, "/quicksilver.interchainstaking.v1.Msg/GovReopenChannel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // RequestRedemption defines a method for requesting burning of qAssets for @@ -291,6 +317,8 @@ type MsgServer interface { // SignalIntent defines a method for signalling voting intent for one or more // validators. SignalIntent(context.Context, *MsgSignalIntent) (*MsgSignalIntentResponse, error) + GovCloseChannel(context.Context, *MsgGovCloseChannel) (*MsgGovCloseChannelResponse, error) + GovReopenChannel(context.Context, *MsgGovReopenChannel) (*MsgGovReopenChannelResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -303,6 +331,12 @@ func (*UnimplementedMsgServer) RequestRedemption(ctx context.Context, req *MsgRe func (*UnimplementedMsgServer) SignalIntent(ctx context.Context, req *MsgSignalIntent) (*MsgSignalIntentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SignalIntent not implemented") } +func (*UnimplementedMsgServer) GovCloseChannel(ctx context.Context, req *MsgGovCloseChannel) (*MsgGovCloseChannelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovCloseChannel not implemented") +} +func (*UnimplementedMsgServer) GovReopenChannel(ctx context.Context, req *MsgGovReopenChannel) (*MsgGovReopenChannelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovReopenChannel not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -344,6 +378,42 @@ func _Msg_SignalIntent_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_GovCloseChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovCloseChannel) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovCloseChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/quicksilver.interchainstaking.v1.Msg/GovCloseChannel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovCloseChannel(ctx, req.(*MsgGovCloseChannel)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_GovReopenChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovReopenChannel) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovReopenChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/quicksilver.interchainstaking.v1.Msg/GovReopenChannel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovReopenChannel(ctx, req.(*MsgGovReopenChannel)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "quicksilver.interchainstaking.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -356,6 +426,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SignalIntent", Handler: _Msg_SignalIntent_Handler, }, + { + MethodName: "GovCloseChannel", + Handler: _Msg_GovCloseChannel_Handler, + }, + { + MethodName: "GovReopenChannel", + Handler: _Msg_GovReopenChannel_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "quicksilver/interchainstaking/v1/messages.proto", diff --git a/x/interchainstaking/types/messages.pb.gw.go b/x/interchainstaking/types/messages.pb.gw.go index 9b9d29d3a..9fcb2c478 100644 --- a/x/interchainstaking/types/messages.pb.gw.go +++ b/x/interchainstaking/types/messages.pb.gw.go @@ -101,6 +101,74 @@ func local_request_Msg_SignalIntent_0(ctx context.Context, marshaler runtime.Mar } +func request_Msg_GovCloseChannel_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgGovCloseChannel + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GovCloseChannel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_GovCloseChannel_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgGovCloseChannel + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GovCloseChannel(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Msg_GovReopenChannel_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgGovReopenChannel + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GovReopenChannel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_GovReopenChannel_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgGovReopenChannel + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GovReopenChannel(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". // UnaryRPC :call MsgServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -153,6 +221,52 @@ func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("POST", pattern_Msg_GovCloseChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Msg_GovCloseChannel_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_GovCloseChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Msg_GovReopenChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Msg_GovReopenChannel_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_GovReopenChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -234,6 +348,46 @@ func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("POST", pattern_Msg_GovCloseChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Msg_GovCloseChannel_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_GovCloseChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Msg_GovReopenChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Msg_GovReopenChannel_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_GovReopenChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -241,10 +395,18 @@ var ( pattern_Msg_RequestRedemption_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quicksilver", "tx", "v1", "interchainstaking", "redeem"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Msg_SignalIntent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quicksilver", "tx", "v1", "interchainstaking", "intent"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Msg_GovCloseChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quicksilver", "tx", "v1", "interchainstaking", "close_channel"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Msg_GovReopenChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"quicksilver", "tx", "v1", "interchainstaking", "reopen_channel"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Msg_RequestRedemption_0 = runtime.ForwardResponseMessage forward_Msg_SignalIntent_0 = runtime.ForwardResponseMessage + + forward_Msg_GovCloseChannel_0 = runtime.ForwardResponseMessage + + forward_Msg_GovReopenChannel_0 = runtime.ForwardResponseMessage ) diff --git a/x/interchainstaking/types/msgs.go b/x/interchainstaking/types/msgs.go index 8b72e6f1c..d6f67db2d 100644 --- a/x/interchainstaking/types/msgs.go +++ b/x/interchainstaking/types/msgs.go @@ -186,3 +186,41 @@ func (msg MsgSignalIntent) GetSigners() []sdk.AccAddress { fromAddress, _ := sdk.AccAddressFromBech32(msg.FromAddress) return []sdk.AccAddress{fromAddress} } + +// NewMsgGovCloseChannel - construct a msg to update signalled intent. +func NewMsgGovCloseChannel(channelID string, portName string, fromAddress sdk.Address) *MsgGovCloseChannel { + return &MsgGovCloseChannel{ChannelId: channelID, PortId: portName, Authority: fromAddress.String()} +} + +// GetSignBytes Implements Msg. +func (msg MsgGovCloseChannel) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +// GetSigners Implements Msg. +func (msg MsgGovCloseChannel) GetSigners() []sdk.AccAddress { + fromAddress, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{fromAddress} +} + +// ValidateBasic check channel id is correct format. validate port name? +func (msg MsgGovCloseChannel) ValidateBasic() error { return nil } + +// NewMsgGovReopenChannel - construct a msg to update signalled intent. +func NewMsgGovReopenChannel(connectionID string, portName string, fromAddress sdk.Address) *MsgGovReopenChannel { + return &MsgGovReopenChannel{ConnectionId: connectionID, PortId: portName, Authority: fromAddress.String()} +} + +// GetSignBytes Implements Msg. +func (msg MsgGovReopenChannel) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +// GetSigners Implements Msg. +func (msg MsgGovReopenChannel) GetSigners() []sdk.AccAddress { + fromAddress, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{fromAddress} +} + +// ValidateBasic check channel id is correct format. validate port name? +func (msg MsgGovReopenChannel) ValidateBasic() error { return nil } diff --git a/x/interchainstaking/types/proposals.pb.go b/x/interchainstaking/types/proposals.pb.go index 8610097e3..3cad2a197 100644 --- a/x/interchainstaking/types/proposals.pb.go +++ b/x/interchainstaking/types/proposals.pb.go @@ -247,12 +247,172 @@ func (m *UpdateZoneValue) GetValue() string { return "" } +type MsgGovReopenChannel struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ConnectionId string `protobuf:"bytes,3,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + PortId string `protobuf:"bytes,4,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + Authority string `protobuf:"bytes,5,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgGovReopenChannel) Reset() { *m = MsgGovReopenChannel{} } +func (m *MsgGovReopenChannel) String() string { return proto.CompactTextString(m) } +func (*MsgGovReopenChannel) ProtoMessage() {} +func (*MsgGovReopenChannel) Descriptor() ([]byte, []int) { + return fileDescriptor_04d034c830a7acfe, []int{5} +} +func (m *MsgGovReopenChannel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovReopenChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovReopenChannel.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGovReopenChannel) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovReopenChannel.Merge(m, src) +} +func (m *MsgGovReopenChannel) XXX_Size() int { + return m.Size() +} +func (m *MsgGovReopenChannel) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovReopenChannel.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovReopenChannel proto.InternalMessageInfo + +// MsgGovReopenChannelResponse defines the MsgGovReopenChannel response type. +type MsgGovReopenChannelResponse struct { +} + +func (m *MsgGovReopenChannelResponse) Reset() { *m = MsgGovReopenChannelResponse{} } +func (m *MsgGovReopenChannelResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGovReopenChannelResponse) ProtoMessage() {} +func (*MsgGovReopenChannelResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_04d034c830a7acfe, []int{6} +} +func (m *MsgGovReopenChannelResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovReopenChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovReopenChannelResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGovReopenChannelResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovReopenChannelResponse.Merge(m, src) +} +func (m *MsgGovReopenChannelResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGovReopenChannelResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovReopenChannelResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovReopenChannelResponse proto.InternalMessageInfo + +type MsgGovCloseChannel struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + PortId string `protobuf:"bytes,4,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + Authority string `protobuf:"bytes,5,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgGovCloseChannel) Reset() { *m = MsgGovCloseChannel{} } +func (m *MsgGovCloseChannel) String() string { return proto.CompactTextString(m) } +func (*MsgGovCloseChannel) ProtoMessage() {} +func (*MsgGovCloseChannel) Descriptor() ([]byte, []int) { + return fileDescriptor_04d034c830a7acfe, []int{7} +} +func (m *MsgGovCloseChannel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovCloseChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovCloseChannel.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGovCloseChannel) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovCloseChannel.Merge(m, src) +} +func (m *MsgGovCloseChannel) XXX_Size() int { + return m.Size() +} +func (m *MsgGovCloseChannel) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovCloseChannel.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovCloseChannel proto.InternalMessageInfo + +// MsgGovCloseChannelResponse defines the MsgGovCloseChannel response type. +type MsgGovCloseChannelResponse struct { +} + +func (m *MsgGovCloseChannelResponse) Reset() { *m = MsgGovCloseChannelResponse{} } +func (m *MsgGovCloseChannelResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGovCloseChannelResponse) ProtoMessage() {} +func (*MsgGovCloseChannelResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_04d034c830a7acfe, []int{8} +} +func (m *MsgGovCloseChannelResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovCloseChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovCloseChannelResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGovCloseChannelResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovCloseChannelResponse.Merge(m, src) +} +func (m *MsgGovCloseChannelResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGovCloseChannelResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovCloseChannelResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovCloseChannelResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*RegisterZoneProposal)(nil), "quicksilver.interchainstaking.v1.RegisterZoneProposal") proto.RegisterType((*RegisterZoneProposalWithDeposit)(nil), "quicksilver.interchainstaking.v1.RegisterZoneProposalWithDeposit") proto.RegisterType((*UpdateZoneProposal)(nil), "quicksilver.interchainstaking.v1.UpdateZoneProposal") proto.RegisterType((*UpdateZoneProposalWithDeposit)(nil), "quicksilver.interchainstaking.v1.UpdateZoneProposalWithDeposit") proto.RegisterType((*UpdateZoneValue)(nil), "quicksilver.interchainstaking.v1.UpdateZoneValue") + proto.RegisterType((*MsgGovReopenChannel)(nil), "quicksilver.interchainstaking.v1.MsgGovReopenChannel") + proto.RegisterType((*MsgGovReopenChannelResponse)(nil), "quicksilver.interchainstaking.v1.MsgGovReopenChannelResponse") + proto.RegisterType((*MsgGovCloseChannel)(nil), "quicksilver.interchainstaking.v1.MsgGovCloseChannel") + proto.RegisterType((*MsgGovCloseChannelResponse)(nil), "quicksilver.interchainstaking.v1.MsgGovCloseChannelResponse") } func init() { @@ -260,51 +420,59 @@ func init() { } var fileDescriptor_04d034c830a7acfe = []byte{ - // 691 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x55, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x4d, 0x9a, 0xfe, 0x24, 0xd3, 0xdf, 0x6f, 0xbe, 0x14, 0xdc, 0x42, 0xe3, 0x68, 0x16, 0xa8, - 0x48, 0x60, 0x53, 0xa8, 0x04, 0xaa, 0x84, 0x54, 0x45, 0x15, 0x52, 0x17, 0x48, 0x95, 0x11, 0x20, - 0x95, 0x85, 0xe5, 0xd8, 0x83, 0x3b, 0x8a, 0x33, 0xe3, 0x7a, 0xc6, 0x51, 0xf3, 0x06, 0x5d, 0xb2, - 0x01, 0xb1, 0xec, 0x96, 0x37, 0x41, 0xac, 0xba, 0x64, 0x65, 0xa1, 0x76, 0xc3, 0xda, 0x4f, 0x80, - 0x3c, 0xe3, 0x10, 0xa7, 0x09, 0x42, 0x2c, 0x40, 0x48, 0xec, 0xee, 0xbd, 0xe7, 0x9e, 0xc9, 0xcd, - 0x39, 0x77, 0x3c, 0xe0, 0xde, 0x71, 0x4c, 0xdc, 0x0e, 0x27, 0x41, 0x0f, 0x47, 0x26, 0xa1, 0x02, - 0x47, 0xee, 0x91, 0x43, 0x28, 0x17, 0x4e, 0x87, 0x50, 0xdf, 0xec, 0x6d, 0x99, 0x61, 0xc4, 0x42, - 0xc6, 0x9d, 0x80, 0x1b, 0x61, 0xc4, 0x04, 0x83, 0xcd, 0x02, 0xc3, 0x18, 0x63, 0x18, 0xbd, 0xad, - 0xf5, 0xba, 0xcf, 0x7c, 0x26, 0x9b, 0xcd, 0x2c, 0x52, 0xbc, 0xf5, 0x35, 0x97, 0xf1, 0x2e, 0xe3, - 0xb6, 0x02, 0x54, 0x92, 0x43, 0x37, 0x7d, 0xc6, 0xfc, 0x00, 0x9b, 0x4e, 0x48, 0x4c, 0x87, 0x52, - 0x26, 0x1c, 0x41, 0x18, 0xcd, 0x51, 0xf4, 0xae, 0x02, 0xea, 0x16, 0xf6, 0x09, 0x17, 0x38, 0x3a, - 0x64, 0x14, 0x1f, 0xe4, 0x03, 0xc1, 0x3a, 0x98, 0x11, 0x44, 0x04, 0x58, 0x2b, 0x37, 0xcb, 0x9b, - 0x35, 0x4b, 0x25, 0xb0, 0x09, 0xe6, 0x3d, 0xcc, 0xdd, 0x88, 0x84, 0xd9, 0x21, 0xda, 0x94, 0xc4, - 0x8a, 0x25, 0xf8, 0x18, 0x2c, 0xba, 0x8c, 0x52, 0xec, 0x66, 0x99, 0x4d, 0x3c, 0xad, 0x92, 0xf5, - 0xb4, 0xb4, 0x34, 0xd1, 0xeb, 0x7d, 0xa7, 0x1b, 0xec, 0xa0, 0x11, 0x18, 0x59, 0x0b, 0xc3, 0x7c, - 0xdf, 0x83, 0xdb, 0x00, 0xb4, 0x1d, 0x8e, 0x6d, 0x0f, 0x53, 0xd6, 0xd5, 0xa6, 0x25, 0x77, 0x35, - 0x4d, 0xf4, 0xff, 0x14, 0x77, 0x88, 0x21, 0xab, 0x96, 0x25, 0x7b, 0x59, 0x0c, 0x1f, 0x82, 0xf9, - 0x80, 0xb9, 0x4e, 0x90, 0xd3, 0x66, 0x24, 0xed, 0x5a, 0x9a, 0xe8, 0x50, 0xd1, 0x0a, 0x20, 0xb2, - 0x80, 0xcc, 0x14, 0x71, 0x17, 0x2c, 0x39, 0xae, 0xcb, 0x62, 0x2a, 0xec, 0x30, 0xc2, 0xaf, 0xc9, - 0x89, 0x36, 0x2b, 0xb9, 0x6b, 0x69, 0xa2, 0xaf, 0x2a, 0xee, 0x28, 0x8e, 0xac, 0xc5, 0xbc, 0x70, - 0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xc8, 0x9a, 0x93, 0xe1, 0xbe, 0x07, 0x6d, 0x90, 0x85, 0xd4, - 0xc7, 0x5c, 0x9b, 0x6e, 0x56, 0x36, 0xe7, 0xef, 0x6f, 0x19, 0x3f, 0xfb, 0xe0, 0x19, 0xc3, 0x3f, - 0xf6, 0xc2, 0x09, 0x62, 0x5c, 0xd4, 0x24, 0x3f, 0x4b, 0xfd, 0x40, 0x16, 0x5d, 0xb9, 0x43, 0x9f, - 0xa6, 0xc0, 0xc6, 0xb8, 0x2e, 0x7f, 0xf6, 0x06, 0xfd, 0x6d, 0x12, 0x15, 0x97, 0x6c, 0xe6, 0x57, - 0x96, 0xec, 0x15, 0x58, 0xbe, 0xf2, 0x3b, 0xb0, 0x09, 0x2a, 0x1d, 0xdc, 0xcf, 0xb5, 0x5b, 0x4a, - 0x13, 0x1d, 0xa8, 0x63, 0x3a, 0xb8, 0x8f, 0xac, 0x0c, 0xca, 0xf4, 0xed, 0x65, 0xad, 0xb9, 0x62, - 0x05, 0x7d, 0x65, 0x19, 0x59, 0x0a, 0x6e, 0x1d, 0x7e, 0xbc, 0x68, 0x94, 0xcf, 0x2f, 0x1a, 0xe5, - 0x2f, 0x17, 0x8d, 0xf2, 0x9b, 0xcb, 0x46, 0xe9, 0xfc, 0xb2, 0x51, 0xfa, 0x7c, 0xd9, 0x28, 0x1d, - 0xee, 0xfa, 0x44, 0x1c, 0xc5, 0x6d, 0xc3, 0x65, 0x5d, 0x93, 0x50, 0x1f, 0xd3, 0x98, 0x88, 0xfe, - 0xdd, 0x76, 0x4c, 0x02, 0xcf, 0x2c, 0x3e, 0xaf, 0x27, 0x13, 0x1e, 0x58, 0xd1, 0x0f, 0x31, 0x6f, - 0xcf, 0xca, 0x97, 0xee, 0xc1, 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xc6, 0x3c, 0xe1, 0x8e, - 0x07, 0x00, 0x00, + // 819 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x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, 0x92, 0x6c, + 0x83, 0xcd, 0xf9, 0x2d, 0x4f, 0x14, 0xe9, 0x5c, 0x7e, 0x77, 0xdf, 0xd4, 0xee, 0xee, 0x9b, 0xda, + 0x4f, 0xf7, 0x4d, 0xed, 0x8b, 0x87, 0x66, 0xe9, 0xee, 0xa1, 0x59, 0xfa, 0xf1, 0xa1, 0x59, 0xba, + 0x3c, 0x72, 0xa9, 0xec, 0x87, 0xbd, 0xb6, 0xcd, 0x87, 0x26, 0x65, 0x2e, 0x61, 0x21, 0x95, 0xe3, + 0xbd, 0x5e, 0x48, 0x3d, 0xc7, 0x2c, 0xbe, 0xc6, 0xae, 0x17, 0xbc, 0xc7, 0xe4, 0xd8, 0x27, 0xa2, + 0xb7, 0xa2, 0x1e, 0x46, 0x6f, 0xff, 0x16, 0x00, 0x00, 0xff, 0xff, 0x97, 0x81, 0x7a, 0xe0, 0xbd, + 0x09, 0x00, 0x00, } func (m *RegisterZoneProposal) Marshal() (dAtA []byte, err error) { @@ -644,6 +812,168 @@ func (m *UpdateZoneValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgGovReopenChannel) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGovReopenChannel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovReopenChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintProposals(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x2a + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintProposals(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0x22 + } + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintProposals(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposals(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposals(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGovReopenChannelResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGovReopenChannelResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovReopenChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgGovCloseChannel) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGovCloseChannel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovCloseChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintProposals(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x2a + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintProposals(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0x22 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintProposals(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposals(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposals(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGovCloseChannelResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGovCloseChannelResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovCloseChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintProposals(dAtA []byte, offset int, v uint64) int { offset -= sovProposals(v) base := offset @@ -812,19 +1142,95 @@ func (m *UpdateZoneValue) Size() (n int) { return n } -func sovProposals(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *MsgGovReopenChannel) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + return n } -func sozProposals(x uint64) (n int) { - return sovProposals(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *MsgGovReopenChannelResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n } -func (m *RegisterZoneProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { + +func (m *MsgGovCloseChannel) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovProposals(uint64(l)) + } + return n +} + +func (m *MsgGovCloseChannelResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovProposals(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozProposals(x uint64) (n int) { + return sovProposals(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RegisterZoneProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowProposals } @@ -1920,6 +2326,526 @@ func (m *UpdateZoneValue) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgGovReopenChannel) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGovReopenChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovReopenChannel: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposals(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposals + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGovReopenChannelResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGovReopenChannelResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovReopenChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipProposals(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposals + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGovCloseChannel) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGovCloseChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovCloseChannel: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposals + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposals + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposals(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposals + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGovCloseChannelResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposals + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGovCloseChannelResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovCloseChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipProposals(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposals + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipProposals(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0