From e0d2ff5d5ab56e4dc2b41c38279534bef1488a70 Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 15 Jan 2024 15:48:23 +0000 Subject: [PATCH 1/8] Cherry Pick. -> Merge pull request #320 from ComposableFi/stakingmiddleware-module Introduce custom staking module that update validators voting power each N blocks --- app/app.go | 14 +- app/export.go | 2 +- app/keepers/keepers.go | 13 +- app/keepers/keys.go | 4 + app/test_access.go | 2 +- app/upgrades/v8/constants.go | 22 + app/upgrades/v8/upgrade.go | 28 + custom/staking/abci.go | 22 + custom/staking/keeper/keeper.go | 122 ++ custom/staking/keeper/msg_server.go | 62 + custom/staking/module.go | 63 + proto/buf.gen.gogo.yaml | 0 proto/buf.yaml | 0 .../stakingmiddleware/v1beta1/genesis.proto | 14 + .../stakingmiddleware/v1beta1/query.proto | 25 + .../v1beta1/stakingmiddleware.proto | 81 + .../stakingmiddleware/v1beta1/tx.proto | 41 + x/mint/keeper/msg_server.go | 1 + x/stakingmiddleware/client/cli/query.go | 55 + x/stakingmiddleware/client/cli/tx.go | 23 + x/stakingmiddleware/keeper/genesis.go | 19 + x/stakingmiddleware/keeper/keeper.go | 76 + x/stakingmiddleware/keeper/msg_server.go | 38 + x/stakingmiddleware/module.go | 156 ++ x/stakingmiddleware/types/codec.go | 45 + x/stakingmiddleware/types/genesis.go | 21 + x/stakingmiddleware/types/genesis.pb.go | 324 ++++ x/stakingmiddleware/types/keys.go | 15 + x/stakingmiddleware/types/msgs.go | 28 + x/stakingmiddleware/types/query.pb.go | 538 ++++++ x/stakingmiddleware/types/query.pb.gw.go | 153 ++ .../types/stakingmiddleware.pb.go | 1462 +++++++++++++++++ x/stakingmiddleware/types/tx.pb.go | 602 +++++++ 33 files changed, 4063 insertions(+), 8 deletions(-) create mode 100644 app/upgrades/v8/constants.go create mode 100644 app/upgrades/v8/upgrade.go create mode 100644 custom/staking/abci.go create mode 100644 custom/staking/keeper/keeper.go create mode 100644 custom/staking/keeper/msg_server.go create mode 100644 custom/staking/module.go mode change 100644 => 100755 proto/buf.gen.gogo.yaml mode change 100644 => 100755 proto/buf.yaml create mode 100644 proto/centauri/stakingmiddleware/v1beta1/genesis.proto create mode 100644 proto/centauri/stakingmiddleware/v1beta1/query.proto create mode 100644 proto/centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto create mode 100644 proto/centauri/stakingmiddleware/v1beta1/tx.proto create mode 100644 x/stakingmiddleware/client/cli/query.go create mode 100644 x/stakingmiddleware/client/cli/tx.go create mode 100644 x/stakingmiddleware/keeper/genesis.go create mode 100644 x/stakingmiddleware/keeper/keeper.go create mode 100644 x/stakingmiddleware/keeper/msg_server.go create mode 100644 x/stakingmiddleware/module.go create mode 100644 x/stakingmiddleware/types/codec.go create mode 100644 x/stakingmiddleware/types/genesis.go create mode 100644 x/stakingmiddleware/types/genesis.pb.go create mode 100644 x/stakingmiddleware/types/keys.go create mode 100644 x/stakingmiddleware/types/msgs.go create mode 100644 x/stakingmiddleware/types/query.pb.go create mode 100644 x/stakingmiddleware/types/query.pb.gw.go create mode 100644 x/stakingmiddleware/types/stakingmiddleware.pb.go create mode 100644 x/stakingmiddleware/types/tx.pb.go diff --git a/app/app.go b/app/app.go index d555fdefc..a4b04d008 100644 --- a/app/app.go +++ b/app/app.go @@ -39,6 +39,7 @@ import ( v4 "github.com/notional-labs/composable/v6/app/upgrades/v4" v5 "github.com/notional-labs/composable/v6/app/upgrades/v5" v6 "github.com/notional-labs/composable/v6/app/upgrades/v6" + v8 "github.com/notional-labs/composable/v6/app/upgrades/v8" // bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -75,6 +76,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" @@ -88,6 +90,7 @@ import ( ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + customstaking "github.com/notional-labs/composable/v6/custom/staking" "github.com/spf13/cast" icq "github.com/strangelove-ventures/async-icq/v7" icqtypes "github.com/strangelove-ventures/async-icq/v7/types" @@ -101,6 +104,7 @@ import ( custombankmodule "github.com/notional-labs/composable/v6/custom/bank" "github.com/notional-labs/composable/v6/app/ante" + "github.com/notional-labs/composable/v6/x/stakingmiddleware" transfermiddleware "github.com/notional-labs/composable/v6/x/transfermiddleware" transfermiddlewaretypes "github.com/notional-labs/composable/v6/x/transfermiddleware/types" @@ -125,6 +129,7 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" upgrades "github.com/notional-labs/composable/v6/app/upgrades" + stakingmiddlewaretypes "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" ) const ( @@ -142,7 +147,7 @@ var ( // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" - Upgrades = []upgrades.Upgrade{v4.Upgrade, v5.Upgrade, v6.Upgrade} + Upgrades = []upgrades.Upgrade{v4.Upgrade, v5.Upgrade, v6.Upgrade, v8.Upgrade} Forks = []upgrades.Fork{} ) @@ -223,6 +228,7 @@ var ( ratelimitmodule.AppModuleBasic{}, consensus.AppModuleBasic{}, alliancemodule.AppModuleBasic{}, + stakingmiddleware.AppModuleBasic{}, // this line is used by starport scaffolding # stargate/app/moduleBasic ) @@ -364,7 +370,8 @@ func NewComposableApp( mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil), slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + customstaking.NewAppModule(appCodec, *app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + stakingmiddleware.NewAppModule(appCodec, app.StakingMiddlewareKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), upgrade.NewAppModule(app.UpgradeKeeper), evidence.NewAppModule(app.EvidenceKeeper), @@ -420,6 +427,7 @@ func NewComposableApp( icatypes.ModuleName, wasm.ModuleName, alliancemoduletypes.ModuleName, + stakingmiddlewaretypes.ModuleName, // this line is used by starport scaffolding # stargate/app/beginBlockers ) @@ -454,6 +462,7 @@ func NewComposableApp( icatypes.ModuleName, wasm.ModuleName, alliancemoduletypes.ModuleName, + stakingmiddlewaretypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -492,6 +501,7 @@ func NewComposableApp( icatypes.ModuleName, wasm.ModuleName, alliancemoduletypes.ModuleName, + stakingmiddlewaretypes.ModuleName, // this line is used by starport scaffolding # stargate/app/initGenesis ) diff --git a/app/export.go b/app/export.go index 282f4ff5f..a33330220 100644 --- a/app/export.go +++ b/app/export.go @@ -35,7 +35,7 @@ func (app *ComposableApp) ExportAppStateAndValidators( return servertypes.ExportedApp{}, err } - validators, err := staking.WriteValidators(ctx, app.StakingKeeper) + validators, err := staking.WriteValidators(ctx, &app.StakingKeeper.Keeper) if err != nil { return servertypes.ExportedApp{}, err } diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 94138a9a7..0063a645b 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -45,8 +45,8 @@ import ( slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + customstaking "github.com/notional-labs/composable/v6/custom/staking/keeper" "github.com/cosmos/cosmos-sdk/x/upgrade" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" @@ -103,6 +103,8 @@ import ( ibc_hooks "github.com/notional-labs/composable/v6/x/ibc-hooks" ibchookskeeper "github.com/notional-labs/composable/v6/x/ibc-hooks/keeper" ibchookstypes "github.com/notional-labs/composable/v6/x/ibc-hooks/types" + stakingmiddleware "github.com/notional-labs/composable/v6/x/stakingmiddleware/keeper" + stakingmiddlewaretypes "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" ) const ( @@ -120,7 +122,7 @@ type AppKeepers struct { AccountKeeper authkeeper.AccountKeeper BankKeeper custombankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper *stakingkeeper.Keeper + StakingKeeper *customstaking.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper @@ -154,6 +156,7 @@ type AppKeepers struct { RouterKeeper *routerkeeper.Keeper RatelimitKeeper ratelimitmodulekeeper.Keeper AllianceKeeper alliancemodulekeeper.Keeper + StakingMiddlewareKeeper stakingmiddleware.Keeper } // InitNormalKeepers initializes all 'normal' keepers. @@ -185,8 +188,10 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.AccountKeeper, ) - appKeepers.StakingKeeper = stakingkeeper.NewKeeper( - appCodec, appKeepers.keys[stakingtypes.StoreKey], appKeepers.AccountKeeper, appKeepers.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appKeepers.StakingMiddlewareKeeper = stakingmiddleware.NewKeeper(appCodec, appKeepers.keys[stakingmiddlewaretypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) + + appKeepers.StakingKeeper = customstaking.NewKeeper( + appCodec, appKeepers.keys[stakingtypes.StoreKey], appKeepers.AccountKeeper, appKeepers.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), &appKeepers.StakingMiddlewareKeeper, ) appKeepers.MintKeeper = mintkeeper.NewKeeper( diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 27f5a9e71..101d53ef0 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -42,6 +42,9 @@ import ( "github.com/CosmWasm/wasmd/x/wasm" wasm08types "github.com/cosmos/ibc-go/v7/modules/light-clients/08-wasm/types" + + // customstakingtypes "github.com/notional-labs/composable/v6/custom/staking/types" + stakingmiddleware "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" ) // GenerateKeys generates new keys (KV Store, Transient store, and memory store). @@ -52,6 +55,7 @@ func (appKeepers *AppKeepers) GenerateKeys() { authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, icqtypes.StoreKey, capabilitytypes.StoreKey, consensusparamtypes.StoreKey, wasm08types.StoreKey, + authzkeeper.StoreKey, stakingmiddleware.StoreKey, crisistypes.StoreKey, routertypes.StoreKey, transfermiddlewaretypes.StoreKey, group.StoreKey, minttypes.StoreKey, alliancemoduletypes.StoreKey, wasm.StoreKey, ibchookstypes.StoreKey, icahosttypes.StoreKey, ratelimitmoduletypes.StoreKey, txBoundaryTypes.StoreKey, authzkeeper.StoreKey, ) diff --git a/app/test_access.go b/app/test_access.go index 78a65b7d2..88fb03c52 100644 --- a/app/test_access.go +++ b/app/test_access.go @@ -47,7 +47,7 @@ func (s TestSupport) ScopedTransferKeeper() capabilitykeeper.ScopedKeeper { } func (s TestSupport) StakingKeeper() *stakingkeeper.Keeper { - return s.app.StakingKeeper + return &s.app.StakingKeeper.Keeper } func (s TestSupport) AccountKeeper() authkeeper.AccountKeeper { diff --git a/app/upgrades/v8/constants.go b/app/upgrades/v8/constants.go new file mode 100644 index 000000000..c0ecb2893 --- /dev/null +++ b/app/upgrades/v8/constants.go @@ -0,0 +1,22 @@ +package v8 + +import ( + store "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/notional-labs/composable/v6/app/upgrades" + customstmiddleware "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +const ( + // UpgradeName defines the on-chain upgrade name for the composable upgrade. + UpgradeName = "v8" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{customstmiddleware.StoreKey}, + Deleted: []string{}, + }, +} diff --git a/app/upgrades/v8/upgrade.go b/app/upgrades/v8/upgrade.go new file mode 100644 index 000000000..61509252f --- /dev/null +++ b/app/upgrades/v8/upgrade.go @@ -0,0 +1,28 @@ +package v8 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/notional-labs/composable/v6/app/keepers" + "github.com/notional-labs/composable/v6/app/upgrades" + customstmiddleware "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + _ upgrades.BaseAppParamManager, + _ codec.Codec, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + // Add params for custom middleware + custommiddlewareparams := customstmiddleware.Params{BlocksPerEpoch: 100, AllowUnbondAfterEpochProgressBlockNumber: 90} + keepers.StakingMiddlewareKeeper.SetParams(ctx, custommiddlewareparams) + + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/custom/staking/abci.go b/custom/staking/abci.go new file mode 100644 index 000000000..915dafca0 --- /dev/null +++ b/custom/staking/abci.go @@ -0,0 +1,22 @@ +package bank + +import ( + "time" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + + // "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/types" + + customstakingkeeper "github.com/notional-labs/composable/v6/custom/staking/keeper" +) + +// Called every block, update validator set +func EndBlocker(ctx sdk.Context, k *customstakingkeeper.Keeper) []abci.ValidatorUpdate { + defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + + return k.BlockValidatorUpdates(ctx, ctx.BlockHeight()) +} diff --git a/custom/staking/keeper/keeper.go b/custom/staking/keeper/keeper.go new file mode 100644 index 000000000..2c5b6a5dd --- /dev/null +++ b/custom/staking/keeper/keeper.go @@ -0,0 +1,122 @@ +package keeper + +import ( + abcicometbft "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/codec" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/types" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingmiddleware "github.com/notional-labs/composable/v6/x/stakingmiddleware/keeper" +) + +type Keeper struct { + stakingkeeper.Keeper + cdc codec.BinaryCodec + Stakingmiddleware *stakingmiddleware.Keeper + authority string +} + +func (k Keeper) BlockValidatorUpdates(ctx sdk.Context, height int64) []abcicometbft.ValidatorUpdate { + // Calculate validator set changes. + // + // NOTE: ApplyAndReturnValidatorSetUpdates has to come before + // UnbondAllMatureValidatorQueue. + // This fixes a bug when the unbonding period is instant (is the case in + // some of the tests). The test expected the validator to be completely + // unbonded after the Endblocker (go from Bonded -> Unbonding during + // ApplyAndReturnValidatorSetUpdates and then Unbonding -> Unbonded during + // UnbondAllMatureValidatorQueue). + params := k.Stakingmiddleware.GetParams(ctx) + shouldExecuteBatch := (height % int64(params.BlocksPerEpoch)) == 0 + var validatorUpdates []abcicometbft.ValidatorUpdate + if shouldExecuteBatch { + k.Logger(ctx).Info("Should Execute ApplyAndReturnValidatorSetUpdates at height : ", height) + v, err := k.ApplyAndReturnValidatorSetUpdates(ctx) + if err != nil { + panic(err) + } + validatorUpdates = v + } + + // unbond all mature validators from the unbonding queue + k.UnbondAllMatureValidators(ctx) + + // Remove all mature unbonding delegations from the ubd queue. + matureUnbonds := k.DequeueAllMatureUBDQueue(ctx, ctx.BlockHeader().Time) + for _, dvPair := range matureUnbonds { + addr, err := sdk.ValAddressFromBech32(dvPair.ValidatorAddress) + if err != nil { + panic(err) + } + delegatorAddress := sdk.MustAccAddressFromBech32(dvPair.DelegatorAddress) + + balances, err := k.CompleteUnbonding(ctx, delegatorAddress, addr) + if err != nil { + continue + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeCompleteUnbonding, + sdk.NewAttribute(sdk.AttributeKeyAmount, balances.String()), + sdk.NewAttribute(types.AttributeKeyValidator, dvPair.ValidatorAddress), + sdk.NewAttribute(types.AttributeKeyDelegator, dvPair.DelegatorAddress), + ), + ) + } + + // Remove all mature redelegations from the red queue. + matureRedelegations := k.DequeueAllMatureRedelegationQueue(ctx, ctx.BlockHeader().Time) + for _, dvvTriplet := range matureRedelegations { + valSrcAddr, err := sdk.ValAddressFromBech32(dvvTriplet.ValidatorSrcAddress) + if err != nil { + panic(err) + } + valDstAddr, err := sdk.ValAddressFromBech32(dvvTriplet.ValidatorDstAddress) + if err != nil { + panic(err) + } + delegatorAddress := sdk.MustAccAddressFromBech32(dvvTriplet.DelegatorAddress) + + balances, err := k.CompleteRedelegation( + ctx, + delegatorAddress, + valSrcAddr, + valDstAddr, + ) + if err != nil { + continue + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeCompleteRedelegation, + sdk.NewAttribute(sdk.AttributeKeyAmount, balances.String()), + sdk.NewAttribute(types.AttributeKeyDelegator, dvvTriplet.DelegatorAddress), + sdk.NewAttribute(types.AttributeKeySrcValidator, dvvTriplet.ValidatorSrcAddress), + sdk.NewAttribute(types.AttributeKeyDstValidator, dvvTriplet.ValidatorDstAddress), + ), + ) + } + + return validatorUpdates +} + +func NewKeeper( + cdc codec.BinaryCodec, + key storetypes.StoreKey, + ak types.AccountKeeper, + bk types.BankKeeper, + authority string, + stakingmiddleware *stakingmiddleware.Keeper, +) *Keeper { + keeper := Keeper{ + Keeper: *stakingkeeper.NewKeeper(cdc, key, ak, bk, authority), + authority: authority, + Stakingmiddleware: stakingmiddleware, + cdc: cdc, + } + return &keeper +} diff --git a/custom/staking/keeper/msg_server.go b/custom/staking/keeper/msg_server.go new file mode 100644 index 000000000..0e162875f --- /dev/null +++ b/custom/staking/keeper/msg_server.go @@ -0,0 +1,62 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +type msgServer struct { + Keeper + msgServer types.MsgServer +} + +var _ types.MsgServer = msgServer{} + +func NewMsgServerImpl(stakingKeeper stakingkeeper.Keeper, customstakingkeeper Keeper) types.MsgServer { + return &msgServer{Keeper: customstakingkeeper, msgServer: stakingkeeper.NewMsgServerImpl(&stakingKeeper)} +} + +func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateValidator) (*types.MsgCreateValidatorResponse, error) { + return k.msgServer.CreateValidator(goCtx, msg) +} + +func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValidator) (*types.MsgEditValidatorResponse, error) { + return k.msgServer.EditValidator(goCtx, msg) +} + +func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*types.MsgDelegateResponse, error) { + return k.msgServer.Delegate(goCtx, msg) +} + +func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + params := k.Keeper.Stakingmiddleware.GetParams(ctx) + height := ctx.BlockHeight() + epoch_progress_block_number := (height % int64(params.BlocksPerEpoch)) + if epoch_progress_block_number > int64(params.AllowUnbondAfterEpochProgressBlockNumber) || epoch_progress_block_number == 0 { + return k.msgServer.BeginRedelegate(goCtx, msg) + } + return &types.MsgBeginRedelegateResponse{}, nil +} + +func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) (*types.MsgUndelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + params := k.Keeper.Stakingmiddleware.GetParams(ctx) + height := ctx.BlockHeight() + epoch_progress_block_number := (height % int64(params.BlocksPerEpoch)) + if epoch_progress_block_number > int64(params.AllowUnbondAfterEpochProgressBlockNumber) || epoch_progress_block_number == 0 { + return k.msgServer.Undelegate(goCtx, msg) + } + return &types.MsgUndelegateResponse{}, nil +} + +func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.MsgCancelUnbondingDelegation) (*types.MsgCancelUnbondingDelegationResponse, error) { + return k.msgServer.CancelUnbondingDelegation(goCtx, msg) +} + +func (ms msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + return ms.msgServer.UpdateParams(goCtx, msg) +} diff --git a/custom/staking/module.go b/custom/staking/module.go new file mode 100644 index 000000000..44a306f73 --- /dev/null +++ b/custom/staking/module.go @@ -0,0 +1,63 @@ +package bank + +import ( + "fmt" + + abcitype "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types/module" + stakingmodule "github.com/cosmos/cosmos-sdk/x/staking" + "github.com/cosmos/cosmos-sdk/x/staking/exported" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + // custombankkeeper "github.com/notional-labs/composable/v6/custom/bank/keeper" + sdk "github.com/cosmos/cosmos-sdk/types" + customstakingkeeper "github.com/notional-labs/composable/v6/custom/staking/keeper" +) + +// AppModule wraps around the bank module and the bank keeper to return the right total supply +type AppModule struct { + stakingmodule.AppModule + keeper customstakingkeeper.Keeper + subspace exported.Subspace + msgServer stakingtypes.MsgServer +} + +// NewAppModule creates a new AppModule object +func NewAppModule(cdc codec.Codec, keeper customstakingkeeper.Keeper, accountKeeper stakingtypes.AccountKeeper, bankKeeper stakingtypes.BankKeeper, ss exported.Subspace) AppModule { + stakingModule := stakingmodule.NewAppModule(cdc, &keeper.Keeper, accountKeeper, bankKeeper, ss) + return AppModule{ + AppModule: stakingModule, + keeper: keeper, + subspace: ss, + msgServer: stakingkeeper.NewMsgServerImpl(&keeper.Keeper), + } +} + +// RegisterServices registers module services. +// NOTE: Overriding this method as not doing so will cause a panic +// when trying to force this custom keeper into a bankkeeper.BaseKeeper +func (am AppModule) RegisterServices(cfg module.Configurator) { + // types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(&am.keeper)) + stakingtypes.RegisterMsgServer(cfg.MsgServer(), customstakingkeeper.NewMsgServerImpl(am.keeper.Keeper, am.keeper)) + querier := stakingkeeper.Querier{Keeper: &am.keeper.Keeper} + stakingtypes.RegisterQueryServer(cfg.QueryServer(), querier) + + m := stakingkeeper.NewMigrator(&am.keeper.Keeper, am.subspace) + if err := cfg.RegisterMigration(stakingtypes.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/staking from version 1 to 2: %v", err)) + } + + if err := cfg.RegisterMigration(stakingtypes.ModuleName, 2, m.Migrate2to3); err != nil { + panic(fmt.Sprintf("failed to migrate x/staking from version 2 to 3: %v", err)) + } + + if err := cfg.RegisterMigration(stakingtypes.ModuleName, 3, m.Migrate3to4); err != nil { + panic(fmt.Sprintf("failed to migrate x/staking from version 3 to 4: %v", err)) + } +} + +func (am AppModule) EndBlock(ctx sdk.Context, _abc abcitype.RequestEndBlock) []abcitype.ValidatorUpdate { + return EndBlocker(ctx, &am.keeper) +} diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml old mode 100644 new mode 100755 diff --git a/proto/buf.yaml b/proto/buf.yaml old mode 100644 new mode 100755 diff --git a/proto/centauri/stakingmiddleware/v1beta1/genesis.proto b/proto/centauri/stakingmiddleware/v1beta1/genesis.proto new file mode 100644 index 000000000..f2cdb42c2 --- /dev/null +++ b/proto/centauri/stakingmiddleware/v1beta1/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package centauri.stakingmiddleware.v1beta1; + +import "gogoproto/gogo.proto"; +import "centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto"; +import "amino/amino.proto"; + + +option go_package = "x/stakingmiddleware/types"; + +// GenesisState defines the stakingmiddleware module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/centauri/stakingmiddleware/v1beta1/query.proto b/proto/centauri/stakingmiddleware/v1beta1/query.proto new file mode 100644 index 000000000..026dd1972 --- /dev/null +++ b/proto/centauri/stakingmiddleware/v1beta1/query.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package centauri.stakingmiddleware.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto"; + +option go_package = "x/stakingmiddleware/types"; + +// Query provides defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/mint/v1beta1/params"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto b/proto/centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto new file mode 100644 index 000000000..60f55f095 --- /dev/null +++ b/proto/centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; +package centauri.stakingmiddleware.v1beta1; + +option go_package = "x/stakingmiddleware/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; + + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message Delegation { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgDelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// BeginRedelegate defines a SDK message for performing a begin redelegation of coins +// from a delegator to a validator. +message BeginRedelegate{ + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgBeginRedelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message Undelegate { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgUndelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +message CancelUnbondingDelegation { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgCancelUnbondingDelegation"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + int64 creation_height = 4; +} + + + +// Params holds parameters for the stakingmiddleware module. +message Params { + // expected blocks per year + uint64 blocks_per_epoch = 1; + // max block allowed before validator set update + uint64 allow_unbond_after_epoch_progress_block_number = 2; +} + diff --git a/proto/centauri/stakingmiddleware/v1beta1/tx.proto b/proto/centauri/stakingmiddleware/v1beta1/tx.proto new file mode 100644 index 000000000..491b4fcab --- /dev/null +++ b/proto/centauri/stakingmiddleware/v1beta1/tx.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; +package centauri.stakingmiddleware.v1beta1; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto"; + +option go_package = "x/stakingmiddleware/types"; + +// Msg defines the x/stakingmiddleware Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc UpdateEpochParams(MsgUpdateEpochParams) returns (MsgUpdateParamsEpochResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateEpochParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "centauri/x/stakingmiddleware/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params defines the x/stakingmiddleware parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsEpochResponse {} diff --git a/x/mint/keeper/msg_server.go b/x/mint/keeper/msg_server.go index 4feafae33..05f73dbe6 100644 --- a/x/mint/keeper/msg_server.go +++ b/x/mint/keeper/msg_server.go @@ -42,6 +42,7 @@ func (ms msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdatePara func (ms msgServer) FundModuleAccount(goCtx context.Context, req *types.MsgFundModuleAccount) (*types.MsgFundModuleAccountResponse, error) { // Unwrap context ctx := sdk.UnwrapSDKContext(goCtx) + // Check sender address sender, err := sdk.AccAddressFromBech32(req.FromAddress) if err != nil { diff --git a/x/stakingmiddleware/client/cli/query.go b/x/stakingmiddleware/client/cli/query.go new file mode 100644 index 000000000..45449d249 --- /dev/null +++ b/x/stakingmiddleware/client/cli/query.go @@ -0,0 +1,55 @@ +package cli + +import ( + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +// GetQueryCmd returns the cli query commands for the staking middleware module. +func GetQueryCmd() *cobra.Command { + stakingMiddlewareParamsQueryCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the staking middleware module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + stakingMiddlewareParamsQueryCmd.AddCommand( + GetCmdQueryParams(), + ) + + return stakingMiddlewareParamsQueryCmd +} + +// GetCmdQueryParams implements a command to return the current staking middleware's params +// parameters. +func GetCmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "Query the current staking middleware parameters", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryParamsRequest{} + res, err := queryClient.Params(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(&res.Params) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/stakingmiddleware/client/cli/tx.go b/x/stakingmiddleware/client/cli/tx.go new file mode 100644 index 000000000..44c201e3d --- /dev/null +++ b/x/stakingmiddleware/client/cli/tx.go @@ -0,0 +1,23 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + + "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +// GetTxCmd returns the tx commands for staking middleware module. +func GetTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Exp transaction subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand() + + return txCmd +} diff --git a/x/stakingmiddleware/keeper/genesis.go b/x/stakingmiddleware/keeper/genesis.go new file mode 100644 index 000000000..c50d10dcf --- /dev/null +++ b/x/stakingmiddleware/keeper/genesis.go @@ -0,0 +1,19 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +// InitGenesis new stake middleware genesis +func (keeper Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) { + if err := keeper.SetParams(ctx, data.Params); err != nil { + panic(err) + } +} + +// ExportGenesis returns a GenesisState for a given context and keeper. +func (keeper Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { + params := keeper.GetParams(ctx) + return types.NewGenesisState(params) +} diff --git a/x/stakingmiddleware/keeper/keeper.go b/x/stakingmiddleware/keeper/keeper.go new file mode 100644 index 000000000..4580cb017 --- /dev/null +++ b/x/stakingmiddleware/keeper/keeper.go @@ -0,0 +1,76 @@ +package keeper + +import ( + "fmt" + + "github.com/cometbft/cometbft/libs/log" + "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" + + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// Keeper of the staking middleware store +type Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/gov module account. + authority string +} + +// NewKeeper creates a new middleware Keeper instance +func NewKeeper( + cdc codec.BinaryCodec, + key storetypes.StoreKey, + authority string, +) Keeper { + return Keeper{ + cdc: cdc, + storeKey: key, + authority: authority, + } +} + +// GetAuthority returns the x/stakingmiddleware module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+types.ModuleName) +} + +// SetParams sets the x/stakingmiddleware module parameters. +func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error { + if p.BlocksPerEpoch < 5 { + return fmt.Errorf( + "BlocksPerEpoch must be greater than or equal to 5", + ) + } + if p.AllowUnbondAfterEpochProgressBlockNumber > p.BlocksPerEpoch { + return fmt.Errorf( + "AllowUnbondAfterEpochProgressBlockNumber must be less than or equal to BlocksPerEpoch", + ) + } + + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&p) + store.Set(types.ParamsKey, bz) + + return nil +} + +// GetParams returns the current x/stakingmiddleware module parameters. +func (k Keeper) GetParams(ctx sdk.Context) (p types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return p + } + + k.cdc.MustUnmarshal(bz, &p) + return p +} diff --git a/x/stakingmiddleware/keeper/msg_server.go b/x/stakingmiddleware/keeper/msg_server.go new file mode 100644 index 000000000..95de74ad9 --- /dev/null +++ b/x/stakingmiddleware/keeper/msg_server.go @@ -0,0 +1,38 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +var _ types.MsgServer = msgServer{} + +// msgServer is a wrapper of Keeper. +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the x/stakingmiddleware MsgServer interface. +func NewMsgServerImpl(k Keeper) types.MsgServer { + return &msgServer{ + Keeper: k, + } +} + +// UpdateParams updates the params. +func (ms msgServer) UpdateEpochParams(goCtx context.Context, req *types.MsgUpdateEpochParams) (*types.MsgUpdateParamsEpochResponse, error) { + if ms.authority != req.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := ms.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsEpochResponse{}, nil +} diff --git a/x/stakingmiddleware/module.go b/x/stakingmiddleware/module.go new file mode 100644 index 000000000..d745978eb --- /dev/null +++ b/x/stakingmiddleware/module.go @@ -0,0 +1,156 @@ +package stakingmiddleware + +import ( + "context" + "encoding/json" + "fmt" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/notional-labs/composable/v6/x/stakingmiddleware/client/cli" + "github.com/notional-labs/composable/v6/x/stakingmiddleware/keeper" + "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleSimulation = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the staking middleware module. +type AppModuleBasic struct { + cdc codec.Codec +} + +var _ module.AppModuleBasic = AppModuleBasic{} + +// Name returns the staking middleware module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the staking middleware module's types on the given LegacyAmino codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +// RegisterInterfaces registers the module interface +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns default genesis state as raw bytes for the staking middleware +// module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the staking middleware module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(bz, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return types.ValidateGenesis(data) +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the staking middleware module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// GetTxCmd returns no root tx command for the staking middleware module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the root query command for the staking middleware module. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// AppModule implements an application module for the staking middleware module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper +} + +// NewAppModule creates a new AppModule object. If the InflationCalculationFn +// argument is nil, then the SDK's default inflation function will be used. +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{cdc: cdc}, + keeper: keeper, + } +} + +// Name returns the staking middleware module's name. +func (AppModule) Name() string { + return types.ModuleName +} + +// RegisterInvariants registers the staking middleware module invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// RegisterServices registers a gRPC query service to respond to the +// module-specific gRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + // types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) +} + +// InitGenesis performs genesis initialization for the staking middleware module. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + + am.keeper.InitGenesis(ctx, &genesisState) + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the staking middleware +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := am.keeper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(gs) +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock returns the begin blocker for the staking middleware module. +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + // BeginBlocker(ctx, am.keeper) ??? +} + +// AppModuleSimulation functions +// GenerateGenesisState creates a randomized GenState of the staking middleware module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) {} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { + return nil +} + +// RegisterStoreDecoder registers a decoder for staking middleware module's types. +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations doesn't return any staking middleware module operation. +func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + return nil +} diff --git a/x/stakingmiddleware/types/codec.go b/x/stakingmiddleware/types/codec.go new file mode 100644 index 000000000..c8986807f --- /dev/null +++ b/x/stakingmiddleware/types/codec.go @@ -0,0 +1,45 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/types/msgservice" + authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" + govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec" + groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// RegisterLegacyAminoCodec registers the account interfaces and concrete types on the +// provided LegacyAmino codec. These types are used for Amino JSON serialization +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + legacy.RegisterAminoMsg(cdc, &MsgUpdateEpochParams{}, "composable/MsgUpdateEpochParams") +} + +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgUpdateEpochParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + sdk.RegisterLegacyAminoCodec(amino) + + // Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be + // used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances + RegisterLegacyAminoCodec(authzcodec.Amino) + RegisterLegacyAminoCodec(govcodec.Amino) + RegisterLegacyAminoCodec(groupcodec.Amino) +} diff --git a/x/stakingmiddleware/types/genesis.go b/x/stakingmiddleware/types/genesis.go new file mode 100644 index 000000000..1356a78a7 --- /dev/null +++ b/x/stakingmiddleware/types/genesis.go @@ -0,0 +1,21 @@ +package types + +// NewGenesisState creates a new GenesisState object +func NewGenesisState(params Params) *GenesisState { + return &GenesisState{ + Params: params, + } +} + +// DefaultGenesisState creates a default GenesisState object +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Params: Params{BlocksPerEpoch: 10, AllowUnbondAfterEpochProgressBlockNumber: 7}, + } +} + +// ValidateGenesis validates the provided genesis state to ensure the +// expected invariants holds. +func ValidateGenesis(data GenesisState) error { + return nil +} diff --git a/x/stakingmiddleware/types/genesis.pb.go b/x/stakingmiddleware/types/genesis.pb.go new file mode 100644 index 000000000..56b0631be --- /dev/null +++ b/x/stakingmiddleware/types/genesis.pb.go @@ -0,0 +1,324 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: centauri/stakingmiddleware/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the stakingmiddleware module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_1aa0bd912277c095, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "centauri.stakingmiddleware.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("centauri/stakingmiddleware/v1beta1/genesis.proto", fileDescriptor_1aa0bd912277c095) +} + +var fileDescriptor_1aa0bd912277c095 = []byte{ + // 206 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x48, 0x4e, 0xcd, 0x2b, + 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, 0x4c, 0x49, + 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, + 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x82, 0xe9, + 0xd0, 0xc3, 0xd0, 0xa1, 0x07, 0xd5, 0x21, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xae, 0x0f, + 0x62, 0x41, 0x74, 0x4a, 0x59, 0x11, 0x61, 0x17, 0xa6, 0x99, 0x10, 0xbd, 0x82, 0x89, 0xb9, 0x99, + 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x22, 0xa4, 0x14, 0xc1, 0xc5, 0xe3, 0x0e, 0x71, 0x59, 0x70, 0x49, + 0x62, 0x49, 0xaa, 0x90, 0x07, 0x17, 0x5b, 0x41, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x04, 0xa3, 0x02, + 0xa3, 0x06, 0xb7, 0x91, 0x96, 0x1e, 0x61, 0x97, 0xea, 0x05, 0x80, 0x75, 0x38, 0xb1, 0x9c, 0xb8, + 0x27, 0xcf, 0x10, 0x04, 0xd5, 0xef, 0x64, 0x7c, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, + 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, + 0x0c, 0x51, 0x92, 0x15, 0x58, 0xdc, 0x5e, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0x95, + 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x25, 0x9a, 0xf8, 0x52, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stakingmiddleware/types/keys.go b/x/stakingmiddleware/types/keys.go new file mode 100644 index 000000000..a4f667e69 --- /dev/null +++ b/x/stakingmiddleware/types/keys.go @@ -0,0 +1,15 @@ +package types + +// ParamsKey is the key to use for the keeper store. +var ( + ParamsKey = []byte{0x01} // key for global staking middleware params in the keeper store +) + +const ( + // module name + ModuleName = "stakingmiddleware" + + // StoreKey is the default store key for stakingmiddleware module that store params when apply validator set changes and when allow to unbond/redelegate + + StoreKey = "customstakingparams" // not using the module name because of collisions with key "staking" +) diff --git a/x/stakingmiddleware/types/msgs.go b/x/stakingmiddleware/types/msgs.go new file mode 100644 index 000000000..4418aa784 --- /dev/null +++ b/x/stakingmiddleware/types/msgs.go @@ -0,0 +1,28 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateEpochParams{} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgUpdateEpochParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m *MsgUpdateEpochParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateEpochParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrapf(err, "invalid authority address") + } + + return nil +} diff --git a/x/stakingmiddleware/types/query.pb.go b/x/stakingmiddleware/types/query.pb.go new file mode 100644 index 000000000..772706fc6 --- /dev/null +++ b/x/stakingmiddleware/types/query.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: centauri/stakingmiddleware/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_81a7c3c637f3f95a, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params defines the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_81a7c3c637f3f95a, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "centauri.stakingmiddleware.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "centauri.stakingmiddleware.v1beta1.QueryParamsResponse") +} + +func init() { + proto.RegisterFile("centauri/stakingmiddleware/v1beta1/query.proto", fileDescriptor_81a7c3c637f3f95a) +} + +var fileDescriptor_81a7c3c637f3f95a = []byte{ + // 290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4b, 0x4e, 0xcd, 0x2b, + 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, 0x4c, 0x49, + 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, + 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x82, 0xa9, 0xd7, 0xc3, + 0x50, 0xaf, 0x07, 0x55, 0x2f, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xae, 0x0f, 0x62, 0x41, + 0x74, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, + 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x43, 0x65, 0xad, 0x88, 0x70, 0x07, 0xa6, + 0x8d, 0x60, 0xbd, 0x4a, 0x22, 0x5c, 0x42, 0x81, 0x20, 0x27, 0x06, 0x24, 0x16, 0x25, 0xe6, 0x16, + 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0xc5, 0x73, 0x09, 0xa3, 0x88, 0x16, 0x17, 0xe4, + 0xe7, 0x15, 0xa7, 0x0a, 0x79, 0x70, 0xb1, 0x15, 0x80, 0x45, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, + 0x8d, 0xb4, 0xf4, 0x08, 0xfb, 0x48, 0x0f, 0x62, 0x86, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, + 0x50, 0xfd, 0x46, 0x2b, 0x18, 0xb9, 0x58, 0xc1, 0x36, 0x08, 0xcd, 0x63, 0xe4, 0x62, 0x83, 0x28, + 0x11, 0x32, 0x23, 0xc6, 0x38, 0x4c, 0xd7, 0x4a, 0x99, 0x93, 0xac, 0x0f, 0xe2, 0x1f, 0x25, 0xe5, + 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0xc9, 0x0a, 0x49, 0xeb, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, + 0xe7, 0x66, 0xe6, 0x95, 0xc0, 0x83, 0x0c, 0xe2, 0x54, 0x27, 0xe3, 0x13, 0x8f, 0xe4, 0x18, 0x2f, + 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, + 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x92, 0xac, 0xc0, 0x12, 0xe0, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, + 0x6c, 0xe0, 0xd0, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xf8, 0x2d, 0x7d, 0x23, 0x02, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Params returns the total set of minting parameters. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/centauri.stakingmiddleware.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params returns the total set of minting parameters. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/centauri.stakingmiddleware.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "centauri.stakingmiddleware.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "centauri/stakingmiddleware/v1beta1/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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 ErrIntOverflowQuery + } + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) 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 ErrIntOverflowQuery + } + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stakingmiddleware/types/query.pb.gw.go b/x/stakingmiddleware/types/query.pb.gw.go new file mode 100644 index 000000000..e7c79699d --- /dev/null +++ b/x/stakingmiddleware/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: centauri/stakingmiddleware/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Query_Params_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_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "mint", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/stakingmiddleware/types/stakingmiddleware.pb.go b/x/stakingmiddleware/types/stakingmiddleware.pb.go new file mode 100644 index 000000000..f1d9dc8f4 --- /dev/null +++ b/x/stakingmiddleware/types/stakingmiddleware.pb.go @@ -0,0 +1,1462 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +type Delegation struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` +} + +func (m *Delegation) Reset() { *m = Delegation{} } +func (m *Delegation) String() string { return proto.CompactTextString(m) } +func (*Delegation) ProtoMessage() {} +func (*Delegation) Descriptor() ([]byte, []int) { + return fileDescriptor_b3eb4aece69e048d, []int{0} +} +func (m *Delegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Delegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Delegation.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 *Delegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Delegation.Merge(m, src) +} +func (m *Delegation) XXX_Size() int { + return m.Size() +} +func (m *Delegation) XXX_DiscardUnknown() { + xxx_messageInfo_Delegation.DiscardUnknown(m) +} + +var xxx_messageInfo_Delegation proto.InternalMessageInfo + +// BeginRedelegate defines a SDK message for performing a begin redelegation of coins +// from a delegator to a validator. +type BeginRedelegate struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"` + ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"` + Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` +} + +func (m *BeginRedelegate) Reset() { *m = BeginRedelegate{} } +func (m *BeginRedelegate) String() string { return proto.CompactTextString(m) } +func (*BeginRedelegate) ProtoMessage() {} +func (*BeginRedelegate) Descriptor() ([]byte, []int) { + return fileDescriptor_b3eb4aece69e048d, []int{1} +} +func (m *BeginRedelegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BeginRedelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BeginRedelegate.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 *BeginRedelegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_BeginRedelegate.Merge(m, src) +} +func (m *BeginRedelegate) XXX_Size() int { + return m.Size() +} +func (m *BeginRedelegate) XXX_DiscardUnknown() { + xxx_messageInfo_BeginRedelegate.DiscardUnknown(m) +} + +var xxx_messageInfo_BeginRedelegate proto.InternalMessageInfo + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +type Undelegate struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` +} + +func (m *Undelegate) Reset() { *m = Undelegate{} } +func (m *Undelegate) String() string { return proto.CompactTextString(m) } +func (*Undelegate) ProtoMessage() {} +func (*Undelegate) Descriptor() ([]byte, []int) { + return fileDescriptor_b3eb4aece69e048d, []int{2} +} +func (m *Undelegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Undelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Undelegate.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 *Undelegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Undelegate.Merge(m, src) +} +func (m *Undelegate) XXX_Size() int { + return m.Size() +} +func (m *Undelegate) XXX_DiscardUnknown() { + xxx_messageInfo_Undelegate.DiscardUnknown(m) +} + +var xxx_messageInfo_Undelegate proto.InternalMessageInfo + +// MsgDelegate defines a SDK message for performing a delegation of coins +// from a delegator to a validator. +type CancelUnbondingDelegation struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + CreationHeight int64 `protobuf:"varint,4,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"` +} + +func (m *CancelUnbondingDelegation) Reset() { *m = CancelUnbondingDelegation{} } +func (m *CancelUnbondingDelegation) String() string { return proto.CompactTextString(m) } +func (*CancelUnbondingDelegation) ProtoMessage() {} +func (*CancelUnbondingDelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_b3eb4aece69e048d, []int{3} +} +func (m *CancelUnbondingDelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CancelUnbondingDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CancelUnbondingDelegation.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 *CancelUnbondingDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelUnbondingDelegation.Merge(m, src) +} +func (m *CancelUnbondingDelegation) XXX_Size() int { + return m.Size() +} +func (m *CancelUnbondingDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_CancelUnbondingDelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelUnbondingDelegation proto.InternalMessageInfo + +// Params holds parameters for the stakingmiddleware module. +type Params struct { + // expected blocks per year + BlocksPerEpoch uint64 `protobuf:"varint,1,opt,name=blocks_per_epoch,json=blocksPerEpoch,proto3" json:"blocks_per_epoch,omitempty"` + // max block allowed before validator set update + AllowUnbondAfterEpochProgressBlockNumber uint64 `protobuf:"varint,2,opt,name=allow_unbond_after_epoch_progress_block_number,json=allowUnbondAfterEpochProgressBlockNumber,proto3" json:"allow_unbond_after_epoch_progress_block_number,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_b3eb4aece69e048d, []int{4} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetBlocksPerEpoch() uint64 { + if m != nil { + return m.BlocksPerEpoch + } + return 0 +} + +func (m *Params) GetAllowUnbondAfterEpochProgressBlockNumber() uint64 { + if m != nil { + return m.AllowUnbondAfterEpochProgressBlockNumber + } + return 0 +} + +func init() { + proto.RegisterType((*Delegation)(nil), "centauri.stakingmiddleware.v1beta1.Delegation") + proto.RegisterType((*BeginRedelegate)(nil), "centauri.stakingmiddleware.v1beta1.BeginRedelegate") + proto.RegisterType((*Undelegate)(nil), "centauri.stakingmiddleware.v1beta1.Undelegate") + proto.RegisterType((*CancelUnbondingDelegation)(nil), "centauri.stakingmiddleware.v1beta1.CancelUnbondingDelegation") + proto.RegisterType((*Params)(nil), "centauri.stakingmiddleware.v1beta1.Params") +} + +func init() { + proto.RegisterFile("centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto", fileDescriptor_b3eb4aece69e048d) +} + +var fileDescriptor_b3eb4aece69e048d = []byte{ + // 580 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x95, 0x4f, 0x6b, 0x13, 0x4f, + 0x18, 0xc7, 0x77, 0xd3, 0x10, 0xe8, 0xfc, 0xa0, 0x7f, 0xf2, 0xab, 0x9a, 0x14, 0xdc, 0x94, 0xbd, + 0x34, 0x04, 0x9a, 0x25, 0xf6, 0x64, 0xf4, 0x60, 0xd3, 0x16, 0x44, 0x54, 0xc2, 0x96, 0x5e, 0xbc, + 0xac, 0xb3, 0xbb, 0xe3, 0x66, 0xc8, 0xee, 0x4c, 0x98, 0x99, 0xa4, 0x7a, 0xf5, 0x24, 0x9e, 0x04, + 0xf5, 0xde, 0xa3, 0xc7, 0x1c, 0x7c, 0x11, 0x3d, 0x16, 0x4f, 0x1e, 0x44, 0x24, 0x39, 0xc4, 0x17, + 0xe0, 0x0b, 0x90, 0x9d, 0x99, 0x24, 0xc4, 0x54, 0x52, 0xa4, 0x07, 0xf1, 0x92, 0x64, 0x9e, 0x67, + 0x3e, 0x5f, 0x9e, 0xf9, 0xb0, 0x99, 0x05, 0xf5, 0x00, 0x11, 0x01, 0xbb, 0x0c, 0x3b, 0x5c, 0xc0, + 0x36, 0x26, 0x51, 0x82, 0xc3, 0x30, 0x46, 0x27, 0x90, 0x21, 0xa7, 0x57, 0xf3, 0x91, 0x80, 0xb5, + 0xf9, 0x4e, 0xb5, 0xc3, 0xa8, 0xa0, 0x79, 0x7b, 0xcc, 0x56, 0xe7, 0x77, 0x68, 0x76, 0x73, 0x23, + 0xa2, 0x11, 0x95, 0xdb, 0x9d, 0xf4, 0x97, 0x22, 0x37, 0x8b, 0x01, 0xe5, 0x09, 0xe5, 0x9e, 0x6a, + 0xa8, 0x85, 0x6e, 0x59, 0x6a, 0xe5, 0xf8, 0x90, 0x4f, 0x27, 0x08, 0x28, 0x26, 0xba, 0xbf, 0x0e, + 0x13, 0x4c, 0xa8, 0x23, 0x3f, 0x75, 0xe9, 0x86, 0x46, 0x12, 0x1e, 0x39, 0xbd, 0x5a, 0xfa, 0xa5, + 0x1a, 0xf6, 0xdb, 0x0c, 0x00, 0x07, 0x28, 0x46, 0x11, 0x14, 0x98, 0x92, 0xfc, 0x21, 0x58, 0x0f, + 0xd5, 0x8a, 0x32, 0x0f, 0x86, 0x21, 0x43, 0x9c, 0x17, 0xcc, 0x2d, 0xb3, 0xbc, 0xdc, 0x28, 0x7c, + 0xfa, 0xb8, 0xb3, 0xa1, 0xe7, 0xd8, 0x53, 0x9d, 0x23, 0xc1, 0x30, 0x89, 0xdc, 0xb5, 0x09, 0xa2, + 0xeb, 0x69, 0x4c, 0x0f, 0xc6, 0x38, 0x9c, 0x89, 0xc9, 0x2c, 0x8a, 0x99, 0x20, 0xe3, 0x98, 0xbb, + 0x20, 0x07, 0x13, 0xda, 0x25, 0xa2, 0xb0, 0xb4, 0x65, 0x96, 0xff, 0xbb, 0x55, 0xac, 0x6a, 0x30, + 0x3d, 0xf9, 0xd8, 0x5f, 0x75, 0x9f, 0x62, 0xd2, 0x58, 0x3e, 0xfb, 0x5a, 0x32, 0x3e, 0x8c, 0xfa, + 0x15, 0xd3, 0xd5, 0x4c, 0xfd, 0xf6, 0xab, 0xd3, 0x92, 0xf1, 0xfd, 0xb4, 0x64, 0xbc, 0x1c, 0xf5, + 0x2b, 0xf3, 0xc7, 0x7a, 0x3d, 0xea, 0x57, 0xae, 0xab, 0xbc, 0x1d, 0x1e, 0xb6, 0x9d, 0x47, 0x3c, + 0xd2, 0x22, 0x90, 0xfd, 0x23, 0x03, 0x56, 0x1b, 0x28, 0xc2, 0xc4, 0x45, 0x9a, 0x43, 0x57, 0xa5, + 0xe6, 0x21, 0xb8, 0x36, 0x55, 0xc3, 0x59, 0x70, 0x69, 0x3d, 0xff, 0x4f, 0xb0, 0x23, 0x16, 0x5c, + 0x98, 0x16, 0x72, 0x31, 0x49, 0x5b, 0xba, 0x74, 0xda, 0x01, 0x17, 0xf3, 0xbe, 0xb3, 0x7f, 0xe0, + 0xfb, 0xde, 0x62, 0xdf, 0x37, 0x67, 0x7d, 0xff, 0xa2, 0xd8, 0x7e, 0x9f, 0x01, 0xe0, 0x98, 0x5c, + 0xb5, 0xf1, 0xbf, 0xe2, 0x61, 0xbc, 0xb3, 0x58, 0x4e, 0x61, 0x56, 0xce, 0x54, 0x84, 0xfd, 0x25, + 0x03, 0x8a, 0xfb, 0x90, 0x04, 0x28, 0x3e, 0x26, 0x3e, 0x25, 0x21, 0x26, 0xd1, 0xbf, 0xf9, 0x9f, + 0xcd, 0x6f, 0x83, 0xd5, 0x80, 0x21, 0x79, 0x2e, 0xaf, 0x85, 0x70, 0xd4, 0x52, 0x8f, 0xe2, 0x92, + 0xbb, 0x32, 0x2e, 0xdf, 0x97, 0xd5, 0xfa, 0x83, 0xc5, 0x3e, 0xb7, 0x67, 0x7d, 0xfe, 0x56, 0xa0, + 0xfd, 0xce, 0x04, 0xb9, 0x26, 0x64, 0x30, 0xe1, 0xf9, 0x32, 0x58, 0xf3, 0x63, 0x1a, 0xb4, 0xb9, + 0xd7, 0x41, 0xcc, 0x43, 0x1d, 0x1a, 0xb4, 0xa4, 0xca, 0xac, 0xbb, 0xa2, 0xea, 0x4d, 0xc4, 0x0e, + 0xd3, 0x6a, 0xfe, 0x29, 0xa8, 0xc2, 0x38, 0xa6, 0x27, 0x5e, 0x57, 0x26, 0x7a, 0xf0, 0x99, 0x18, + 0x13, 0xe9, 0x9d, 0x1d, 0xa5, 0x53, 0x78, 0x92, 0xf1, 0x48, 0x37, 0xf1, 0x11, 0x93, 0x2e, 0xb3, + 0x6e, 0x59, 0x52, 0x6a, 0x8c, 0xbd, 0x94, 0x91, 0x71, 0x4d, 0x4d, 0x34, 0x52, 0xe0, 0xb1, 0xdc, + 0xdf, 0xd8, 0x3d, 0x1b, 0x58, 0xe6, 0xf9, 0xc0, 0x32, 0xbf, 0x0d, 0x2c, 0xf3, 0xcd, 0xd0, 0x32, + 0xce, 0x87, 0x96, 0xf1, 0x79, 0x68, 0x19, 0x4f, 0x8a, 0xcf, 0x2f, 0x78, 0x15, 0x89, 0x17, 0x1d, + 0xc4, 0xfd, 0x9c, 0xbc, 0xd6, 0x77, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x44, 0x05, 0x49, + 0xb5, 0x06, 0x00, 0x00, +} + +func (m *Delegation) 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 *Delegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStakingmiddleware(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BeginRedelegate) 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 *BeginRedelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BeginRedelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStakingmiddleware(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ValidatorDstAddress) > 0 { + i -= len(m.ValidatorDstAddress) + copy(dAtA[i:], m.ValidatorDstAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.ValidatorDstAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.ValidatorSrcAddress) > 0 { + i -= len(m.ValidatorSrcAddress) + copy(dAtA[i:], m.ValidatorSrcAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.ValidatorSrcAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Undelegate) 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 *Undelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Undelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStakingmiddleware(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CancelUnbondingDelegation) 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 *CancelUnbondingDelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CancelUnbondingDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreationHeight != 0 { + i = encodeVarintStakingmiddleware(dAtA, i, uint64(m.CreationHeight)) + i-- + dAtA[i] = 0x20 + } + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStakingmiddleware(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintStakingmiddleware(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowUnbondAfterEpochProgressBlockNumber != 0 { + i = encodeVarintStakingmiddleware(dAtA, i, uint64(m.AllowUnbondAfterEpochProgressBlockNumber)) + i-- + dAtA[i] = 0x10 + } + if m.BlocksPerEpoch != 0 { + i = encodeVarintStakingmiddleware(dAtA, i, uint64(m.BlocksPerEpoch)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintStakingmiddleware(dAtA []byte, offset int, v uint64) int { + offset -= sovStakingmiddleware(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Delegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovStakingmiddleware(uint64(l)) + return n +} + +func (m *BeginRedelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = len(m.ValidatorSrcAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = len(m.ValidatorDstAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovStakingmiddleware(uint64(l)) + return n +} + +func (m *Undelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovStakingmiddleware(uint64(l)) + return n +} + +func (m *CancelUnbondingDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovStakingmiddleware(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovStakingmiddleware(uint64(l)) + if m.CreationHeight != 0 { + n += 1 + sovStakingmiddleware(uint64(m.CreationHeight)) + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlocksPerEpoch != 0 { + n += 1 + sovStakingmiddleware(uint64(m.BlocksPerEpoch)) + } + if m.AllowUnbondAfterEpochProgressBlockNumber != 0 { + n += 1 + sovStakingmiddleware(uint64(m.AllowUnbondAfterEpochProgressBlockNumber)) + } + return n +} + +func sovStakingmiddleware(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStakingmiddleware(x uint64) (n int) { + return sovStakingmiddleware(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Delegation) 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 ErrIntOverflowStakingmiddleware + } + 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: Delegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Delegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStakingmiddleware(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStakingmiddleware + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BeginRedelegate) 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 ErrIntOverflowStakingmiddleware + } + 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: BeginRedelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BeginRedelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSrcAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorSrcAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDstAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorDstAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStakingmiddleware(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStakingmiddleware + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Undelegate) 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 ErrIntOverflowStakingmiddleware + } + 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: Undelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Undelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStakingmiddleware(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStakingmiddleware + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CancelUnbondingDelegation) 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 ErrIntOverflowStakingmiddleware + } + 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: CancelUnbondingDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CancelUnbondingDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + 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 ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStakingmiddleware + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStakingmiddleware + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) + } + m.CreationHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStakingmiddleware(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStakingmiddleware + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) 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 ErrIntOverflowStakingmiddleware + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksPerEpoch", wireType) + } + m.BlocksPerEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlocksPerEpoch |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowUnbondAfterEpochProgressBlockNumber", wireType) + } + m.AllowUnbondAfterEpochProgressBlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AllowUnbondAfterEpochProgressBlockNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStakingmiddleware(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStakingmiddleware + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStakingmiddleware(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStakingmiddleware + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStakingmiddleware + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStakingmiddleware + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStakingmiddleware + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStakingmiddleware = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStakingmiddleware = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStakingmiddleware = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/stakingmiddleware/types/tx.pb.go b/x/stakingmiddleware/types/tx.pb.go new file mode 100644 index 000000000..a3f3ad136 --- /dev/null +++ b/x/stakingmiddleware/types/tx.pb.go @@ -0,0 +1,602 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: centauri/stakingmiddleware/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateEpochParams struct { + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/stakingmiddleware parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateEpochParams) Reset() { *m = MsgUpdateEpochParams{} } +func (m *MsgUpdateEpochParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateEpochParams) ProtoMessage() {} +func (*MsgUpdateEpochParams) Descriptor() ([]byte, []int) { + return fileDescriptor_d15665ac9877b062, []int{0} +} +func (m *MsgUpdateEpochParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateEpochParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateEpochParams.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 *MsgUpdateEpochParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateEpochParams.Merge(m, src) +} +func (m *MsgUpdateEpochParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateEpochParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateEpochParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateEpochParams proto.InternalMessageInfo + +func (m *MsgUpdateEpochParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateEpochParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsEpochResponse struct { +} + +func (m *MsgUpdateParamsEpochResponse) Reset() { *m = MsgUpdateParamsEpochResponse{} } +func (m *MsgUpdateParamsEpochResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsEpochResponse) ProtoMessage() {} +func (*MsgUpdateParamsEpochResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d15665ac9877b062, []int{1} +} +func (m *MsgUpdateParamsEpochResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsEpochResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsEpochResponse.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 *MsgUpdateParamsEpochResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsEpochResponse.Merge(m, src) +} +func (m *MsgUpdateParamsEpochResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsEpochResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsEpochResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsEpochResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateEpochParams)(nil), "centauri.stakingmiddleware.v1beta1.MsgUpdateEpochParams") + proto.RegisterType((*MsgUpdateParamsEpochResponse)(nil), "centauri.stakingmiddleware.v1beta1.MsgUpdateParamsEpochResponse") +} + +func init() { + proto.RegisterFile("centauri/stakingmiddleware/v1beta1/tx.proto", fileDescriptor_d15665ac9877b062) +} + +var fileDescriptor_d15665ac9877b062 = []byte{ + // 360 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0x4e, 0xcd, 0x2b, + 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, 0x4c, 0x49, + 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, + 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x82, 0x29, 0xd6, 0xc3, 0x50, 0xac, 0x07, + 0x55, 0x2c, 0x25, 0x9e, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0xac, 0x9f, 0x5b, 0x9c, 0xae, 0x5f, 0x66, + 0x08, 0xa2, 0x20, 0x9a, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x54, 0x48, + 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0xa0, 0xa2, 0x92, 0x10, 0x13, 0xe2, 0x21, + 0x12, 0x10, 0x0e, 0x54, 0xca, 0x8a, 0x08, 0xd7, 0x62, 0x3a, 0x0d, 0xac, 0x57, 0xe9, 0x1e, 0x23, + 0x97, 0x88, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0xaa, 0x6b, 0x41, 0x7e, 0x72, 0x46, + 0x40, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x90, 0x19, 0x17, 0x67, 0x62, 0x69, 0x49, 0x46, 0x7e, 0x51, + 0x66, 0x49, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xc4, 0xa5, 0x2d, 0xba, 0x22, 0x50, + 0x9b, 0x1d, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x83, 0x10, + 0x4a, 0x85, 0x7c, 0xb9, 0xd8, 0x0a, 0xc0, 0x26, 0x48, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x69, + 0xe9, 0x11, 0x0e, 0x1e, 0x3d, 0x88, 0x9d, 0x4e, 0x9c, 0x27, 0xee, 0xc9, 0x33, 0xac, 0x78, 0xbe, + 0x41, 0x8b, 0x31, 0x08, 0x6a, 0x88, 0x95, 0x7d, 0xd3, 0xf3, 0x0d, 0x5a, 0x08, 0xe3, 0xbb, 0x9e, + 0x6f, 0xd0, 0xd2, 0x81, 0x7b, 0xb7, 0x02, 0x8b, 0x87, 0xe1, 0x9e, 0x81, 0x98, 0xa9, 0x24, 0xc7, + 0x25, 0x83, 0x26, 0x04, 0xf6, 0x65, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0xd1, 0x3c, + 0x46, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x7e, 0x46, 0x2e, 0x41, 0xcc, 0x50, 0xb0, 0x20, 0xc6, + 0xf5, 0xd8, 0xc2, 0x4f, 0xca, 0x81, 0x24, 0x9d, 0x58, 0x5c, 0x26, 0xc5, 0xda, 0x00, 0x0a, 0x09, + 0x27, 0xe3, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, + 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x92, 0xc4, 0xe6, 0xff, + 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xec, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x89, 0xbf, 0x82, 0x72, 0xc9, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + UpdateEpochParams(ctx context.Context, in *MsgUpdateEpochParams, opts ...grpc.CallOption) (*MsgUpdateParamsEpochResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateEpochParams(ctx context.Context, in *MsgUpdateEpochParams, opts ...grpc.CallOption) (*MsgUpdateParamsEpochResponse, error) { + out := new(MsgUpdateParamsEpochResponse) + err := c.cc.Invoke(ctx, "/centauri.stakingmiddleware.v1beta1.Msg/UpdateEpochParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + UpdateEpochParams(context.Context, *MsgUpdateEpochParams) (*MsgUpdateParamsEpochResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateEpochParams(ctx context.Context, req *MsgUpdateEpochParams) (*MsgUpdateParamsEpochResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateEpochParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateEpochParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateEpochParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateEpochParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/centauri.stakingmiddleware.v1beta1.Msg/UpdateEpochParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateEpochParams(ctx, req.(*MsgUpdateEpochParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "centauri.stakingmiddleware.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateEpochParams", + Handler: _Msg_UpdateEpochParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "centauri/stakingmiddleware/v1beta1/tx.proto", +} + +func (m *MsgUpdateEpochParams) 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 *MsgUpdateEpochParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateEpochParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsEpochResponse) 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 *MsgUpdateParamsEpochResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsEpochResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateEpochParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsEpochResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateEpochParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateEpochParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateEpochParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsEpochResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsEpochResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsEpochResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From 6b6c19cc9512d73e56b700618e29e339a2657a98 Mon Sep 17 00:00:00 2001 From: "rust.dev" <102041955+RustNinja@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:31:59 +0000 Subject: [PATCH 2/8] Merge pull request #405 from ComposableFi/staking-epoch-params Allow query custom staking epoch params. Register Query service and subspace. --- app/keepers/keepers.go | 1 + app/upgrades/v8/upgrade.go | 2 +- .../stakingmiddleware/v1beta1/query.proto | 2 +- scripts/staking-middleware-proposal.json | 12 ++++++++++++ x/stakingmiddleware/keeper/grpc_query.go | 19 +++++++++++++++++++ x/stakingmiddleware/module.go | 2 +- x/stakingmiddleware/types/genesis.go | 2 +- x/stakingmiddleware/types/query.pb.go | 17 ++++++++--------- x/stakingmiddleware/types/query.pb.gw.go | 2 +- 9 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 scripts/staking-middleware-proposal.json create mode 100644 x/stakingmiddleware/keeper/grpc_query.go diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 0063a645b..f56a9bcbb 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -482,6 +482,7 @@ func (appKeepers *AppKeepers) initParamsKeeper(appCodec codec.BinaryCodec, legac paramsKeeper.Subspace(alliancemoduletypes.ModuleName) paramsKeeper.Subspace(wasm.ModuleName) paramsKeeper.Subspace(transfermiddlewaretypes.ModuleName) + paramsKeeper.Subspace(stakingmiddlewaretypes.ModuleName) return paramsKeeper } diff --git a/app/upgrades/v8/upgrade.go b/app/upgrades/v8/upgrade.go index 61509252f..5cd1b8c43 100644 --- a/app/upgrades/v8/upgrade.go +++ b/app/upgrades/v8/upgrade.go @@ -20,7 +20,7 @@ func CreateUpgradeHandler( ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { // Add params for custom middleware - custommiddlewareparams := customstmiddleware.Params{BlocksPerEpoch: 100, AllowUnbondAfterEpochProgressBlockNumber: 90} + custommiddlewareparams := customstmiddleware.Params{BlocksPerEpoch: 100, AllowUnbondAfterEpochProgressBlockNumber: 0} keepers.StakingMiddlewareKeeper.SetParams(ctx, custommiddlewareparams) return mm.RunMigrations(ctx, configurator, vm) diff --git a/proto/centauri/stakingmiddleware/v1beta1/query.proto b/proto/centauri/stakingmiddleware/v1beta1/query.proto index 026dd1972..aa7472528 100644 --- a/proto/centauri/stakingmiddleware/v1beta1/query.proto +++ b/proto/centauri/stakingmiddleware/v1beta1/query.proto @@ -11,7 +11,7 @@ option go_package = "x/stakingmiddleware/types"; service Query { // Params returns the total set of minting parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/params"; + option (google.api.http).get = "/centauri/stakingmiddleware/params"; } } diff --git a/scripts/staking-middleware-proposal.json b/scripts/staking-middleware-proposal.json new file mode 100644 index 000000000..54f48e8e6 --- /dev/null +++ b/scripts/staking-middleware-proposal.json @@ -0,0 +1,12 @@ +{ + "title": "Staking middleware blocks_per_epoch to 100", + "description": "update parameter blocks per epoch to value 100", + "changes": [ + { + "subspace": "stakingmiddleware", + "key": "blocks_per_epoch", + "value": 200 + } + ], + "deposit": "10000000stake" + } \ No newline at end of file diff --git a/x/stakingmiddleware/keeper/grpc_query.go b/x/stakingmiddleware/keeper/grpc_query.go new file mode 100644 index 000000000..d7002472e --- /dev/null +++ b/x/stakingmiddleware/keeper/grpc_query.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/notional-labs/composable/v6/x/stakingmiddleware/types" +) + +var _ types.QueryServer = Keeper{} + +// Params returns params of the staking middleware module. +func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + params := k.GetParams(ctx) + + return &types.QueryParamsResponse{Params: params}, nil +} diff --git a/x/stakingmiddleware/module.go b/x/stakingmiddleware/module.go index d745978eb..4c656f6ce 100644 --- a/x/stakingmiddleware/module.go +++ b/x/stakingmiddleware/module.go @@ -109,7 +109,7 @@ func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} // RegisterServices registers a gRPC query service to respond to the // module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { - // types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) } diff --git a/x/stakingmiddleware/types/genesis.go b/x/stakingmiddleware/types/genesis.go index 1356a78a7..0b7665f88 100644 --- a/x/stakingmiddleware/types/genesis.go +++ b/x/stakingmiddleware/types/genesis.go @@ -10,7 +10,7 @@ func NewGenesisState(params Params) *GenesisState { // DefaultGenesisState creates a default GenesisState object func DefaultGenesisState() *GenesisState { return &GenesisState{ - Params: Params{BlocksPerEpoch: 10, AllowUnbondAfterEpochProgressBlockNumber: 7}, + Params: Params{BlocksPerEpoch: 10, AllowUnbondAfterEpochProgressBlockNumber: 0}, } } diff --git a/x/stakingmiddleware/types/query.pb.go b/x/stakingmiddleware/types/query.pb.go index 772706fc6..53233f90a 100644 --- a/x/stakingmiddleware/types/query.pb.go +++ b/x/stakingmiddleware/types/query.pb.go @@ -122,7 +122,7 @@ func init() { } var fileDescriptor_81a7c3c637f3f95a = []byte{ - // 290 bytes of a gzipped FileDescriptorProto + // 279 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4b, 0x4e, 0xcd, 0x2b, 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, @@ -134,14 +134,13 @@ var fileDescriptor_81a7c3c637f3f95a = []byte{ 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0xc5, 0x73, 0x09, 0xa3, 0x88, 0x16, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x79, 0x70, 0xb1, 0x15, 0x80, 0x45, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xb4, 0xf4, 0x08, 0xfb, 0x48, 0x0f, 0x62, 0x86, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, - 0x50, 0xfd, 0x46, 0x2b, 0x18, 0xb9, 0x58, 0xc1, 0x36, 0x08, 0xcd, 0x63, 0xe4, 0x62, 0x83, 0x28, - 0x11, 0x32, 0x23, 0xc6, 0x38, 0x4c, 0xd7, 0x4a, 0x99, 0x93, 0xac, 0x0f, 0xe2, 0x1f, 0x25, 0xe5, - 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0xc9, 0x0a, 0x49, 0xeb, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, - 0xe7, 0x66, 0xe6, 0x95, 0xc0, 0x83, 0x0c, 0xe2, 0x54, 0x27, 0xe3, 0x13, 0x8f, 0xe4, 0x18, 0x2f, - 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, - 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x92, 0xac, 0xc0, 0x12, 0xe0, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, - 0x6c, 0xe0, 0xd0, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xf8, 0x2d, 0x7d, 0x23, 0x02, - 0x00, 0x00, + 0x50, 0xfd, 0x46, 0xeb, 0x19, 0xb9, 0x58, 0xc1, 0x36, 0x08, 0x2d, 0x65, 0xe4, 0x62, 0x83, 0x28, + 0x11, 0x32, 0x23, 0xc6, 0x38, 0x4c, 0xd7, 0x4a, 0x99, 0x93, 0xac, 0x0f, 0xe2, 0x1f, 0x25, 0xad, + 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0xa9, 0x08, 0x29, 0xe9, 0xe3, 0x09, 0x41, 0x88, 0x8b, 0x9d, 0x8c, + 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, + 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0xb2, 0x02, 0x8b, 0xae, 0x92, + 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x20, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x21, + 0x09, 0x7c, 0xa2, 0x2a, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/stakingmiddleware/types/query.pb.gw.go b/x/stakingmiddleware/types/query.pb.gw.go index e7c79699d..1e692a32c 100644 --- a/x/stakingmiddleware/types/query.pb.gw.go +++ b/x/stakingmiddleware/types/query.pb.gw.go @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "mint", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"centauri", "stakingmiddleware", "params"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( From fb1b7d05ed5fd705b631957921bb3b90fe2f294b Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 8 Jan 2024 16:46:23 +0000 Subject: [PATCH 3/8] use v8.Update as an custom staking epoch (voting power delay) --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index a4b04d008..3da67f6b1 100644 --- a/app/app.go +++ b/app/app.go @@ -147,7 +147,7 @@ var ( // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" - Upgrades = []upgrades.Upgrade{v4.Upgrade, v5.Upgrade, v6.Upgrade, v8.Upgrade} + Upgrades = []upgrades.Upgrade{v8.Upgrade} Forks = []upgrades.Fork{} ) From 473cdade6332d6529496faf24607f0f0525f8749 Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 15 Jan 2024 15:50:08 +0000 Subject: [PATCH 4/8] remove unused import of updates that do not need in current chain update --- app/app.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/app.go b/app/app.go index 3da67f6b1..845dd4428 100644 --- a/app/app.go +++ b/app/app.go @@ -36,9 +36,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" "github.com/notional-labs/composable/v6/app/keepers" - v4 "github.com/notional-labs/composable/v6/app/upgrades/v4" - v5 "github.com/notional-labs/composable/v6/app/upgrades/v5" - v6 "github.com/notional-labs/composable/v6/app/upgrades/v6" v8 "github.com/notional-labs/composable/v6/app/upgrades/v8" // bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" From 7959bdaffa96b06c4630172cc5d85882c2118830 Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 8 Jan 2024 17:26:40 +0000 Subject: [PATCH 5/8] move staking middleware proto into composable repo and regenerate types --- .../stakingmiddleware/v1beta1/genesis.proto | 4 +- .../stakingmiddleware/v1beta1/query.proto | 6 +- .../v1beta1/stakingmiddleware.proto | 2 +- .../stakingmiddleware/v1beta1/tx.proto | 6 +- x/stakingmiddleware/types/genesis.pb.go | 39 +++---- x/stakingmiddleware/types/query.pb.go | 64 +++++------ x/stakingmiddleware/types/query.pb.gw.go | 4 +- .../types/stakingmiddleware.pb.go | 100 +++++++++--------- x/stakingmiddleware/types/tx.pb.go | 74 ++++++------- 9 files changed, 150 insertions(+), 149 deletions(-) rename proto/{centauri => composable}/stakingmiddleware/v1beta1/genesis.proto (70%) rename proto/{centauri => composable}/stakingmiddleware/v1beta1/query.proto (77%) rename proto/{centauri => composable}/stakingmiddleware/v1beta1/stakingmiddleware.proto (98%) rename proto/{centauri => composable}/stakingmiddleware/v1beta1/tx.proto (85%) diff --git a/proto/centauri/stakingmiddleware/v1beta1/genesis.proto b/proto/composable/stakingmiddleware/v1beta1/genesis.proto similarity index 70% rename from proto/centauri/stakingmiddleware/v1beta1/genesis.proto rename to proto/composable/stakingmiddleware/v1beta1/genesis.proto index f2cdb42c2..5965e113d 100644 --- a/proto/centauri/stakingmiddleware/v1beta1/genesis.proto +++ b/proto/composable/stakingmiddleware/v1beta1/genesis.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package centauri.stakingmiddleware.v1beta1; +package composable.stakingmiddleware.v1beta1; import "gogoproto/gogo.proto"; -import "centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto"; +import "composable/stakingmiddleware/v1beta1/stakingmiddleware.proto"; import "amino/amino.proto"; diff --git a/proto/centauri/stakingmiddleware/v1beta1/query.proto b/proto/composable/stakingmiddleware/v1beta1/query.proto similarity index 77% rename from proto/centauri/stakingmiddleware/v1beta1/query.proto rename to proto/composable/stakingmiddleware/v1beta1/query.proto index aa7472528..3a4185572 100644 --- a/proto/centauri/stakingmiddleware/v1beta1/query.proto +++ b/proto/composable/stakingmiddleware/v1beta1/query.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package centauri.stakingmiddleware.v1beta1; +package composable.stakingmiddleware.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto"; +import "composable/stakingmiddleware/v1beta1/stakingmiddleware.proto"; option go_package = "x/stakingmiddleware/types"; @@ -11,7 +11,7 @@ option go_package = "x/stakingmiddleware/types"; service Query { // Params returns the total set of minting parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/centauri/stakingmiddleware/params"; + option (google.api.http).get = "/composable/stakingmiddleware/params"; } } diff --git a/proto/centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto b/proto/composable/stakingmiddleware/v1beta1/stakingmiddleware.proto similarity index 98% rename from proto/centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto rename to proto/composable/stakingmiddleware/v1beta1/stakingmiddleware.proto index 60f55f095..f4bb1c044 100644 --- a/proto/centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto +++ b/proto/composable/stakingmiddleware/v1beta1/stakingmiddleware.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package centauri.stakingmiddleware.v1beta1; +package composable.stakingmiddleware.v1beta1; option go_package = "x/stakingmiddleware/types"; diff --git a/proto/centauri/stakingmiddleware/v1beta1/tx.proto b/proto/composable/stakingmiddleware/v1beta1/tx.proto similarity index 85% rename from proto/centauri/stakingmiddleware/v1beta1/tx.proto rename to proto/composable/stakingmiddleware/v1beta1/tx.proto index 491b4fcab..ff1431f74 100644 --- a/proto/centauri/stakingmiddleware/v1beta1/tx.proto +++ b/proto/composable/stakingmiddleware/v1beta1/tx.proto @@ -1,11 +1,11 @@ syntax = "proto3"; -package centauri.stakingmiddleware.v1beta1; +package composable.stakingmiddleware.v1beta1; import "cosmos/msg/v1/msg.proto"; import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; -import "centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto"; +import "composable/stakingmiddleware/v1beta1/stakingmiddleware.proto"; option go_package = "x/stakingmiddleware/types"; @@ -21,7 +21,7 @@ service Msg { // Since: cosmos-sdk 0.47 message MsgUpdateEpochParams { option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "centauri/x/stakingmiddleware/MsgUpdateParams"; + option (amino.name) = "composable/x/stakingmiddleware/MsgUpdateParams"; // authority is the address that controls the module (defaults to x/gov unless // overwritten). diff --git a/x/stakingmiddleware/types/genesis.pb.go b/x/stakingmiddleware/types/genesis.pb.go index 56b0631be..714889258 100644 --- a/x/stakingmiddleware/types/genesis.pb.go +++ b/x/stakingmiddleware/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: centauri/stakingmiddleware/v1beta1/genesis.proto +// source: composable/stakingmiddleware/v1beta1/genesis.proto package types @@ -33,7 +33,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_1aa0bd912277c095, []int{0} + return fileDescriptor_957815fd0e146c10, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -70,28 +70,29 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "centauri.stakingmiddleware.v1beta1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "composable.stakingmiddleware.v1beta1.GenesisState") } func init() { - proto.RegisterFile("centauri/stakingmiddleware/v1beta1/genesis.proto", fileDescriptor_1aa0bd912277c095) + proto.RegisterFile("composable/stakingmiddleware/v1beta1/genesis.proto", fileDescriptor_957815fd0e146c10) } -var fileDescriptor_1aa0bd912277c095 = []byte{ - // 206 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x48, 0x4e, 0xcd, 0x2b, - 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, 0x4c, 0x49, - 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, - 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x82, 0xe9, - 0xd0, 0xc3, 0xd0, 0xa1, 0x07, 0xd5, 0x21, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xae, 0x0f, - 0x62, 0x41, 0x74, 0x4a, 0x59, 0x11, 0x61, 0x17, 0xa6, 0x99, 0x10, 0xbd, 0x82, 0x89, 0xb9, 0x99, - 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x22, 0xa4, 0x14, 0xc1, 0xc5, 0xe3, 0x0e, 0x71, 0x59, 0x70, 0x49, - 0x62, 0x49, 0xaa, 0x90, 0x07, 0x17, 0x5b, 0x41, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x04, 0xa3, 0x02, - 0xa3, 0x06, 0xb7, 0x91, 0x96, 0x1e, 0x61, 0x97, 0xea, 0x05, 0x80, 0x75, 0x38, 0xb1, 0x9c, 0xb8, - 0x27, 0xcf, 0x10, 0x04, 0xd5, 0xef, 0x64, 0x7c, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, - 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, - 0x0c, 0x51, 0x92, 0x15, 0x58, 0xdc, 0x5e, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0x95, - 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x25, 0x9a, 0xf8, 0x52, 0x01, 0x00, 0x00, +var fileDescriptor_957815fd0e146c10 = []byte{ + // 209 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4a, 0xce, 0xcf, 0x2d, + 0xc8, 0x2f, 0x4e, 0x4c, 0xca, 0x49, 0xd5, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, + 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, + 0x41, 0xe8, 0xd1, 0xc3, 0xd0, 0xa3, 0x07, 0xd5, 0x23, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0xd6, + 0xa0, 0x0f, 0x62, 0x41, 0xf4, 0x4a, 0xd9, 0x10, 0x65, 0x1f, 0xa6, 0xa9, 0x10, 0xdd, 0x82, 0x89, + 0xb9, 0x99, 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x22, 0xa4, 0x14, 0xc5, 0xc5, 0xe3, 0x0e, 0x71, 0x5d, + 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x17, 0x17, 0x5b, 0x41, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x04, + 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x8e, 0x1e, 0x31, 0xae, 0xd5, 0x0b, 0x00, 0xeb, 0x71, 0x62, + 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0x6a, 0x82, 0x93, 0xf1, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, + 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, + 0x1e, 0xcb, 0x31, 0x44, 0x49, 0x56, 0x60, 0x71, 0x7d, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0xd8, 0x5d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0x70, 0xe6, 0x7e, 0x5a, 0x01, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/stakingmiddleware/types/query.pb.go b/x/stakingmiddleware/types/query.pb.go index 53233f90a..ca285f403 100644 --- a/x/stakingmiddleware/types/query.pb.go +++ b/x/stakingmiddleware/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: centauri/stakingmiddleware/v1beta1/query.proto +// source: composable/stakingmiddleware/v1beta1/query.proto package types @@ -37,7 +37,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_81a7c3c637f3f95a, []int{0} + return fileDescriptor_4f9afb7a9fee305a, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +76,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81a7c3c637f3f95a, []int{1} + return fileDescriptor_4f9afb7a9fee305a, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -113,34 +113,34 @@ func (m *QueryParamsResponse) GetParams() Params { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "centauri.stakingmiddleware.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "centauri.stakingmiddleware.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "composable.stakingmiddleware.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "composable.stakingmiddleware.v1beta1.QueryParamsResponse") } func init() { - proto.RegisterFile("centauri/stakingmiddleware/v1beta1/query.proto", fileDescriptor_81a7c3c637f3f95a) -} - -var fileDescriptor_81a7c3c637f3f95a = []byte{ - // 279 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4b, 0x4e, 0xcd, 0x2b, - 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, 0x4c, 0x49, - 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, - 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x82, 0xa9, 0xd7, 0xc3, - 0x50, 0xaf, 0x07, 0x55, 0x2f, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xae, 0x0f, 0x62, 0x41, - 0x74, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, - 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x43, 0x65, 0xad, 0x88, 0x70, 0x07, 0xa6, - 0x8d, 0x60, 0xbd, 0x4a, 0x22, 0x5c, 0x42, 0x81, 0x20, 0x27, 0x06, 0x24, 0x16, 0x25, 0xe6, 0x16, - 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0xc5, 0x73, 0x09, 0xa3, 0x88, 0x16, 0x17, 0xe4, - 0xe7, 0x15, 0xa7, 0x0a, 0x79, 0x70, 0xb1, 0x15, 0x80, 0x45, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, - 0x8d, 0xb4, 0xf4, 0x08, 0xfb, 0x48, 0x0f, 0x62, 0x86, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, - 0x50, 0xfd, 0x46, 0xeb, 0x19, 0xb9, 0x58, 0xc1, 0x36, 0x08, 0x2d, 0x65, 0xe4, 0x62, 0x83, 0x28, - 0x11, 0x32, 0x23, 0xc6, 0x38, 0x4c, 0xd7, 0x4a, 0x99, 0x93, 0xac, 0x0f, 0xe2, 0x1f, 0x25, 0xad, - 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0xa9, 0x08, 0x29, 0xe9, 0xe3, 0x09, 0x41, 0x88, 0x8b, 0x9d, 0x8c, - 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, - 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0xb2, 0x02, 0x8b, 0xae, 0x92, - 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x20, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x21, - 0x09, 0x7c, 0xa2, 0x2a, 0x02, 0x00, 0x00, + proto.RegisterFile("composable/stakingmiddleware/v1beta1/query.proto", fileDescriptor_4f9afb7a9fee305a) +} + +var fileDescriptor_4f9afb7a9fee305a = []byte{ + // 281 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x48, 0xce, 0xcf, 0x2d, + 0xc8, 0x2f, 0x4e, 0x4c, 0xca, 0x49, 0xd5, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, + 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x41, 0xe8, + 0xd0, 0xc3, 0xd0, 0xa1, 0x07, 0xd5, 0x21, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0xd6, 0xa0, 0x0f, + 0x62, 0x41, 0xf4, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7, 0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, + 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0x15, 0x43, 0x65, 0x6d, 0x88, 0x72, + 0x0b, 0xa6, 0x9d, 0x60, 0xdd, 0x4a, 0x22, 0x5c, 0x42, 0x81, 0x20, 0x67, 0x06, 0x24, 0x16, 0x25, + 0xe6, 0x16, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0x25, 0x72, 0x09, 0xa3, 0x88, 0x16, + 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x79, 0x71, 0xb1, 0x15, 0x80, 0x45, 0x24, 0x18, 0x15, 0x18, + 0x35, 0xb8, 0x8d, 0x74, 0xf4, 0x88, 0xf1, 0x95, 0x1e, 0xc4, 0x14, 0x27, 0x96, 0x13, 0xf7, 0xe4, + 0x19, 0x82, 0xa0, 0x26, 0x18, 0x6d, 0x65, 0xe4, 0x62, 0x05, 0xdb, 0x21, 0xb4, 0x9a, 0x91, 0x8b, + 0x0d, 0xa2, 0x44, 0xc8, 0x82, 0x38, 0x03, 0x31, 0x5d, 0x2c, 0x65, 0x49, 0x86, 0x4e, 0x88, 0xaf, + 0x94, 0x74, 0x9a, 0x2e, 0x3f, 0x99, 0xcc, 0xa4, 0x26, 0xa4, 0xa2, 0x8f, 0x37, 0x24, 0x21, 0xee, + 0x76, 0x32, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, + 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xc9, 0x0a, 0x2c, + 0xba, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x81, 0x6d, 0x0c, 0x08, 0x00, 0x00, 0xff, + 0xff, 0xa7, 0x2a, 0xd9, 0xe9, 0x38, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -169,7 +169,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/centauri.stakingmiddleware.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/composable.stakingmiddleware.v1beta1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -204,7 +204,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/centauri.stakingmiddleware.v1beta1.Query/Params", + FullMethod: "/composable.stakingmiddleware.v1beta1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -213,7 +213,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "centauri.stakingmiddleware.v1beta1.Query", + ServiceName: "composable.stakingmiddleware.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -222,7 +222,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "centauri/stakingmiddleware/v1beta1/query.proto", + Metadata: "composable/stakingmiddleware/v1beta1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/stakingmiddleware/types/query.pb.gw.go b/x/stakingmiddleware/types/query.pb.gw.go index 1e692a32c..cf1ab27f6 100644 --- a/x/stakingmiddleware/types/query.pb.gw.go +++ b/x/stakingmiddleware/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: centauri/stakingmiddleware/v1beta1/query.proto +// source: composable/stakingmiddleware/v1beta1/query.proto /* Package types is a reverse proxy. @@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"centauri", "stakingmiddleware", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"composable", "stakingmiddleware", "params"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/stakingmiddleware/types/stakingmiddleware.pb.go b/x/stakingmiddleware/types/stakingmiddleware.pb.go index f1d9dc8f4..3a0af596d 100644 --- a/x/stakingmiddleware/types/stakingmiddleware.pb.go +++ b/x/stakingmiddleware/types/stakingmiddleware.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto +// source: composable/stakingmiddleware/v1beta1/stakingmiddleware.proto package types @@ -39,7 +39,7 @@ func (m *Delegation) Reset() { *m = Delegation{} } func (m *Delegation) String() string { return proto.CompactTextString(m) } func (*Delegation) ProtoMessage() {} func (*Delegation) Descriptor() ([]byte, []int) { - return fileDescriptor_b3eb4aece69e048d, []int{0} + return fileDescriptor_1e66d585b233ed96, []int{0} } func (m *Delegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -81,7 +81,7 @@ func (m *BeginRedelegate) Reset() { *m = BeginRedelegate{} } func (m *BeginRedelegate) String() string { return proto.CompactTextString(m) } func (*BeginRedelegate) ProtoMessage() {} func (*BeginRedelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_b3eb4aece69e048d, []int{1} + return fileDescriptor_1e66d585b233ed96, []int{1} } func (m *BeginRedelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -122,7 +122,7 @@ func (m *Undelegate) Reset() { *m = Undelegate{} } func (m *Undelegate) String() string { return proto.CompactTextString(m) } func (*Undelegate) ProtoMessage() {} func (*Undelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_b3eb4aece69e048d, []int{2} + return fileDescriptor_1e66d585b233ed96, []int{2} } func (m *Undelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -164,7 +164,7 @@ func (m *CancelUnbondingDelegation) Reset() { *m = CancelUnbondingDelega func (m *CancelUnbondingDelegation) String() string { return proto.CompactTextString(m) } func (*CancelUnbondingDelegation) ProtoMessage() {} func (*CancelUnbondingDelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_b3eb4aece69e048d, []int{3} + return fileDescriptor_1e66d585b233ed96, []int{3} } func (m *CancelUnbondingDelegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -205,7 +205,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_b3eb4aece69e048d, []int{4} + return fileDescriptor_1e66d585b233ed96, []int{4} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -249,56 +249,56 @@ func (m *Params) GetAllowUnbondAfterEpochProgressBlockNumber() uint64 { } func init() { - proto.RegisterType((*Delegation)(nil), "centauri.stakingmiddleware.v1beta1.Delegation") - proto.RegisterType((*BeginRedelegate)(nil), "centauri.stakingmiddleware.v1beta1.BeginRedelegate") - proto.RegisterType((*Undelegate)(nil), "centauri.stakingmiddleware.v1beta1.Undelegate") - proto.RegisterType((*CancelUnbondingDelegation)(nil), "centauri.stakingmiddleware.v1beta1.CancelUnbondingDelegation") - proto.RegisterType((*Params)(nil), "centauri.stakingmiddleware.v1beta1.Params") + proto.RegisterType((*Delegation)(nil), "composable.stakingmiddleware.v1beta1.Delegation") + proto.RegisterType((*BeginRedelegate)(nil), "composable.stakingmiddleware.v1beta1.BeginRedelegate") + proto.RegisterType((*Undelegate)(nil), "composable.stakingmiddleware.v1beta1.Undelegate") + proto.RegisterType((*CancelUnbondingDelegation)(nil), "composable.stakingmiddleware.v1beta1.CancelUnbondingDelegation") + proto.RegisterType((*Params)(nil), "composable.stakingmiddleware.v1beta1.Params") } func init() { - proto.RegisterFile("centauri/stakingmiddleware/v1beta1/stakingmiddleware.proto", fileDescriptor_b3eb4aece69e048d) + proto.RegisterFile("composable/stakingmiddleware/v1beta1/stakingmiddleware.proto", fileDescriptor_1e66d585b233ed96) } -var fileDescriptor_b3eb4aece69e048d = []byte{ +var fileDescriptor_1e66d585b233ed96 = []byte{ // 580 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x95, 0x4f, 0x6b, 0x13, 0x4f, - 0x18, 0xc7, 0x77, 0xd3, 0x10, 0xe8, 0xfc, 0xa0, 0x7f, 0xf2, 0xab, 0x9a, 0x14, 0xdc, 0x94, 0xbd, - 0x34, 0x04, 0x9a, 0x25, 0xf6, 0x64, 0xf4, 0x60, 0xd3, 0x16, 0x44, 0x54, 0xc2, 0x96, 0x5e, 0xbc, - 0xac, 0xb3, 0xbb, 0xe3, 0x66, 0xc8, 0xee, 0x4c, 0x98, 0x99, 0xa4, 0x7a, 0xf5, 0x24, 0x9e, 0x04, - 0xf5, 0xde, 0xa3, 0xc7, 0x1c, 0x7c, 0x11, 0x3d, 0x16, 0x4f, 0x1e, 0x44, 0x24, 0x39, 0xc4, 0x17, - 0xe0, 0x0b, 0x90, 0x9d, 0x99, 0x24, 0xc4, 0x54, 0x52, 0xa4, 0x07, 0xf1, 0x92, 0x64, 0x9e, 0x67, - 0x3e, 0x5f, 0x9e, 0xf9, 0xb0, 0x99, 0x05, 0xf5, 0x00, 0x11, 0x01, 0xbb, 0x0c, 0x3b, 0x5c, 0xc0, - 0x36, 0x26, 0x51, 0x82, 0xc3, 0x30, 0x46, 0x27, 0x90, 0x21, 0xa7, 0x57, 0xf3, 0x91, 0x80, 0xb5, - 0xf9, 0x4e, 0xb5, 0xc3, 0xa8, 0xa0, 0x79, 0x7b, 0xcc, 0x56, 0xe7, 0x77, 0x68, 0x76, 0x73, 0x23, - 0xa2, 0x11, 0x95, 0xdb, 0x9d, 0xf4, 0x97, 0x22, 0x37, 0x8b, 0x01, 0xe5, 0x09, 0xe5, 0x9e, 0x6a, - 0xa8, 0x85, 0x6e, 0x59, 0x6a, 0xe5, 0xf8, 0x90, 0x4f, 0x27, 0x08, 0x28, 0x26, 0xba, 0xbf, 0x0e, - 0x13, 0x4c, 0xa8, 0x23, 0x3f, 0x75, 0xe9, 0x86, 0x46, 0x12, 0x1e, 0x39, 0xbd, 0x5a, 0xfa, 0xa5, - 0x1a, 0xf6, 0xdb, 0x0c, 0x00, 0x07, 0x28, 0x46, 0x11, 0x14, 0x98, 0x92, 0xfc, 0x21, 0x58, 0x0f, - 0xd5, 0x8a, 0x32, 0x0f, 0x86, 0x21, 0x43, 0x9c, 0x17, 0xcc, 0x2d, 0xb3, 0xbc, 0xdc, 0x28, 0x7c, - 0xfa, 0xb8, 0xb3, 0xa1, 0xe7, 0xd8, 0x53, 0x9d, 0x23, 0xc1, 0x30, 0x89, 0xdc, 0xb5, 0x09, 0xa2, - 0xeb, 0x69, 0x4c, 0x0f, 0xc6, 0x38, 0x9c, 0x89, 0xc9, 0x2c, 0x8a, 0x99, 0x20, 0xe3, 0x98, 0xbb, - 0x20, 0x07, 0x13, 0xda, 0x25, 0xa2, 0xb0, 0xb4, 0x65, 0x96, 0xff, 0xbb, 0x55, 0xac, 0x6a, 0x30, - 0x3d, 0xf9, 0xd8, 0x5f, 0x75, 0x9f, 0x62, 0xd2, 0x58, 0x3e, 0xfb, 0x5a, 0x32, 0x3e, 0x8c, 0xfa, - 0x15, 0xd3, 0xd5, 0x4c, 0xfd, 0xf6, 0xab, 0xd3, 0x92, 0xf1, 0xfd, 0xb4, 0x64, 0xbc, 0x1c, 0xf5, - 0x2b, 0xf3, 0xc7, 0x7a, 0x3d, 0xea, 0x57, 0xae, 0xab, 0xbc, 0x1d, 0x1e, 0xb6, 0x9d, 0x47, 0x3c, - 0xd2, 0x22, 0x90, 0xfd, 0x23, 0x03, 0x56, 0x1b, 0x28, 0xc2, 0xc4, 0x45, 0x9a, 0x43, 0x57, 0xa5, - 0xe6, 0x21, 0xb8, 0x36, 0x55, 0xc3, 0x59, 0x70, 0x69, 0x3d, 0xff, 0x4f, 0xb0, 0x23, 0x16, 0x5c, - 0x98, 0x16, 0x72, 0x31, 0x49, 0x5b, 0xba, 0x74, 0xda, 0x01, 0x17, 0xf3, 0xbe, 0xb3, 0x7f, 0xe0, - 0xfb, 0xde, 0x62, 0xdf, 0x37, 0x67, 0x7d, 0xff, 0xa2, 0xd8, 0x7e, 0x9f, 0x01, 0xe0, 0x98, 0x5c, - 0xb5, 0xf1, 0xbf, 0xe2, 0x61, 0xbc, 0xb3, 0x58, 0x4e, 0x61, 0x56, 0xce, 0x54, 0x84, 0xfd, 0x25, - 0x03, 0x8a, 0xfb, 0x90, 0x04, 0x28, 0x3e, 0x26, 0x3e, 0x25, 0x21, 0x26, 0xd1, 0xbf, 0xf9, 0x9f, - 0xcd, 0x6f, 0x83, 0xd5, 0x80, 0x21, 0x79, 0x2e, 0xaf, 0x85, 0x70, 0xd4, 0x52, 0x8f, 0xe2, 0x92, - 0xbb, 0x32, 0x2e, 0xdf, 0x97, 0xd5, 0xfa, 0x83, 0xc5, 0x3e, 0xb7, 0x67, 0x7d, 0xfe, 0x56, 0xa0, - 0xfd, 0xce, 0x04, 0xb9, 0x26, 0x64, 0x30, 0xe1, 0xf9, 0x32, 0x58, 0xf3, 0x63, 0x1a, 0xb4, 0xb9, - 0xd7, 0x41, 0xcc, 0x43, 0x1d, 0x1a, 0xb4, 0xa4, 0xca, 0xac, 0xbb, 0xa2, 0xea, 0x4d, 0xc4, 0x0e, - 0xd3, 0x6a, 0xfe, 0x29, 0xa8, 0xc2, 0x38, 0xa6, 0x27, 0x5e, 0x57, 0x26, 0x7a, 0xf0, 0x99, 0x18, - 0x13, 0xe9, 0x9d, 0x1d, 0xa5, 0x53, 0x78, 0x92, 0xf1, 0x48, 0x37, 0xf1, 0x11, 0x93, 0x2e, 0xb3, - 0x6e, 0x59, 0x52, 0x6a, 0x8c, 0xbd, 0x94, 0x91, 0x71, 0x4d, 0x4d, 0x34, 0x52, 0xe0, 0xb1, 0xdc, - 0xdf, 0xd8, 0x3d, 0x1b, 0x58, 0xe6, 0xf9, 0xc0, 0x32, 0xbf, 0x0d, 0x2c, 0xf3, 0xcd, 0xd0, 0x32, - 0xce, 0x87, 0x96, 0xf1, 0x79, 0x68, 0x19, 0x4f, 0x8a, 0xcf, 0x2f, 0x78, 0x15, 0x89, 0x17, 0x1d, - 0xc4, 0xfd, 0x9c, 0xbc, 0xd6, 0x77, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x44, 0x05, 0x49, - 0xb5, 0x06, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x95, 0x4f, 0x6b, 0x13, 0x41, + 0x18, 0x87, 0x77, 0x93, 0x10, 0xe8, 0x08, 0xfd, 0x13, 0xab, 0x26, 0x05, 0x37, 0x25, 0x08, 0x0d, + 0x81, 0x66, 0x89, 0x3d, 0x59, 0x7b, 0xb0, 0x69, 0x0b, 0x22, 0x2a, 0x61, 0x4b, 0x2f, 0x5e, 0xd6, + 0xd9, 0xdd, 0x71, 0x32, 0x64, 0x77, 0x26, 0xcc, 0x6c, 0x52, 0xbd, 0x7a, 0x12, 0x4f, 0x82, 0x7a, + 0xef, 0xd1, 0x63, 0x0e, 0x7e, 0x88, 0x1e, 0x8b, 0x27, 0x0f, 0x22, 0x92, 0x1c, 0xe2, 0x07, 0xf0, + 0x03, 0xc8, 0xce, 0x4c, 0x12, 0x62, 0x2a, 0x29, 0xd2, 0x83, 0xf4, 0x92, 0x64, 0xde, 0x77, 0x9f, + 0x1f, 0xef, 0x3c, 0x4c, 0x66, 0xc1, 0x8e, 0xcf, 0xa2, 0x36, 0x13, 0xd0, 0x0b, 0x91, 0x2d, 0x62, + 0xd8, 0x22, 0x14, 0x47, 0x24, 0x08, 0x42, 0x74, 0x0c, 0x39, 0xb2, 0xbb, 0x35, 0x0f, 0xc5, 0xb0, + 0x36, 0xdb, 0xa9, 0xb6, 0x39, 0x8b, 0x59, 0xee, 0xce, 0x84, 0xae, 0xce, 0x3e, 0xa3, 0xe9, 0xb5, + 0x55, 0xcc, 0x30, 0x93, 0x80, 0x9d, 0xfc, 0x52, 0xec, 0x5a, 0xc1, 0x67, 0x22, 0x62, 0xc2, 0x55, + 0x0d, 0xb5, 0xd0, 0x2d, 0x4b, 0xad, 0x6c, 0x0f, 0x8a, 0xc9, 0x0c, 0x3e, 0x23, 0x54, 0xf7, 0x57, + 0x60, 0x44, 0x28, 0xb3, 0xe5, 0xa7, 0x2e, 0xdd, 0xd2, 0x48, 0x24, 0xb0, 0xdd, 0xad, 0x25, 0x5f, + 0xaa, 0x51, 0x7a, 0x9f, 0x02, 0x60, 0x1f, 0x85, 0x08, 0xc3, 0x98, 0x30, 0x9a, 0x3b, 0x00, 0x2b, + 0x81, 0x5a, 0x31, 0xee, 0xc2, 0x20, 0xe0, 0x48, 0x88, 0xbc, 0xb9, 0x6e, 0x96, 0x17, 0xea, 0xf9, + 0x2f, 0x9f, 0x37, 0x57, 0xf5, 0x1c, 0xbb, 0xaa, 0x73, 0x18, 0x73, 0x42, 0xb1, 0xb3, 0x3c, 0x46, + 0x74, 0x3d, 0x89, 0xe9, 0xc2, 0x90, 0x04, 0x53, 0x31, 0xa9, 0x79, 0x31, 0x63, 0x64, 0x14, 0xb3, + 0x03, 0xb2, 0x30, 0x62, 0x1d, 0x1a, 0xe7, 0xd3, 0xeb, 0x66, 0xf9, 0xda, 0xdd, 0x42, 0x55, 0x83, + 0xc9, 0xce, 0x47, 0xfe, 0xaa, 0x7b, 0x8c, 0xd0, 0xfa, 0xc2, 0xe9, 0xf7, 0xa2, 0xf1, 0x69, 0xd8, + 0xab, 0x98, 0x8e, 0x66, 0xb6, 0xef, 0xbd, 0x39, 0x29, 0x1a, 0x3f, 0x4f, 0x8a, 0xc6, 0xeb, 0x61, + 0xaf, 0x32, 0xbb, 0xad, 0xb7, 0xc3, 0x5e, 0xe5, 0xa6, 0xca, 0xdb, 0x14, 0x41, 0xcb, 0x7e, 0x22, + 0xb0, 0x16, 0x81, 0x4a, 0xbf, 0x52, 0x60, 0xa9, 0x8e, 0x30, 0xa1, 0x0e, 0xd2, 0x1c, 0xba, 0x2c, + 0x35, 0x8f, 0xc1, 0x8d, 0x89, 0x1a, 0xc1, 0xfd, 0x0b, 0xeb, 0xb9, 0x3e, 0xc6, 0x0e, 0xb9, 0x7f, + 0x6e, 0x5a, 0x20, 0xe2, 0x71, 0x5a, 0xfa, 0xc2, 0x69, 0xfb, 0x22, 0x9e, 0xf5, 0x9d, 0xf9, 0x07, + 0xdf, 0x0f, 0xe6, 0xfb, 0xbe, 0x3d, 0xed, 0xfb, 0x0f, 0xc5, 0xa5, 0x8f, 0x29, 0x00, 0x8e, 0xe8, + 0x65, 0x1b, 0xff, 0x2f, 0x0e, 0xe3, 0xfd, 0xf9, 0x72, 0xf2, 0xd3, 0x72, 0x26, 0x22, 0x4a, 0xdf, + 0x52, 0xa0, 0xb0, 0x07, 0xa9, 0x8f, 0xc2, 0x23, 0xea, 0x31, 0x1a, 0x10, 0x8a, 0xaf, 0xe6, 0x7f, + 0x36, 0xb7, 0x01, 0x96, 0x7c, 0x8e, 0xe4, 0xbe, 0xdc, 0x26, 0x22, 0xb8, 0xa9, 0x8e, 0x62, 0xda, + 0x59, 0x1c, 0x95, 0x1f, 0xca, 0xea, 0xf6, 0xa3, 0xf9, 0x3e, 0x37, 0xa6, 0x7d, 0xfe, 0x55, 0x60, + 0xe9, 0x83, 0x09, 0xb2, 0x0d, 0xc8, 0x61, 0x24, 0x72, 0x65, 0xb0, 0xec, 0x85, 0xcc, 0x6f, 0x09, + 0xb7, 0x8d, 0xb8, 0x8b, 0xda, 0xcc, 0x6f, 0x4a, 0x95, 0x19, 0x67, 0x51, 0xd5, 0x1b, 0x88, 0x1f, + 0x24, 0xd5, 0xdc, 0x73, 0x50, 0x85, 0x61, 0xc8, 0x8e, 0xdd, 0x8e, 0x4c, 0x74, 0xe1, 0x8b, 0x78, + 0x44, 0x24, 0x77, 0x36, 0x4e, 0xa6, 0x70, 0x25, 0xe3, 0xd2, 0x4e, 0xe4, 0x21, 0x2e, 0x5d, 0x66, + 0x9c, 0xb2, 0xa4, 0xd4, 0x18, 0xbb, 0x09, 0x23, 0xe3, 0x1a, 0x9a, 0xa8, 0x27, 0xc0, 0x53, 0xf9, + 0x7c, 0x7d, 0xeb, 0xb4, 0x6f, 0x99, 0x67, 0x7d, 0xcb, 0xfc, 0xd1, 0xb7, 0xcc, 0x77, 0x03, 0xcb, + 0x38, 0x1b, 0x58, 0xc6, 0xd7, 0x81, 0x65, 0x3c, 0x2b, 0xbc, 0x3c, 0xe7, 0x65, 0x14, 0xbf, 0x6a, + 0x23, 0xe1, 0x65, 0xe5, 0xb5, 0xbe, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x8c, 0x20, 0x75, + 0xb9, 0x06, 0x00, 0x00, } func (m *Delegation) Marshal() (dAtA []byte, err error) { diff --git a/x/stakingmiddleware/types/tx.pb.go b/x/stakingmiddleware/types/tx.pb.go index a3f3ad136..5bf477a33 100644 --- a/x/stakingmiddleware/types/tx.pb.go +++ b/x/stakingmiddleware/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: centauri/stakingmiddleware/v1beta1/tx.proto +// source: composable/stakingmiddleware/v1beta1/tx.proto package types @@ -48,7 +48,7 @@ func (m *MsgUpdateEpochParams) Reset() { *m = MsgUpdateEpochParams{} } func (m *MsgUpdateEpochParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateEpochParams) ProtoMessage() {} func (*MsgUpdateEpochParams) Descriptor() ([]byte, []int) { - return fileDescriptor_d15665ac9877b062, []int{0} + return fileDescriptor_4ef8bcd16d104cd6, []int{0} } func (m *MsgUpdateEpochParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -102,7 +102,7 @@ func (m *MsgUpdateParamsEpochResponse) Reset() { *m = MsgUpdateParamsEpo func (m *MsgUpdateParamsEpochResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsEpochResponse) ProtoMessage() {} func (*MsgUpdateParamsEpochResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d15665ac9877b062, []int{1} + return fileDescriptor_4ef8bcd16d104cd6, []int{1} } func (m *MsgUpdateParamsEpochResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,39 +132,39 @@ func (m *MsgUpdateParamsEpochResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsEpochResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgUpdateEpochParams)(nil), "centauri.stakingmiddleware.v1beta1.MsgUpdateEpochParams") - proto.RegisterType((*MsgUpdateParamsEpochResponse)(nil), "centauri.stakingmiddleware.v1beta1.MsgUpdateParamsEpochResponse") + proto.RegisterType((*MsgUpdateEpochParams)(nil), "composable.stakingmiddleware.v1beta1.MsgUpdateEpochParams") + proto.RegisterType((*MsgUpdateParamsEpochResponse)(nil), "composable.stakingmiddleware.v1beta1.MsgUpdateParamsEpochResponse") } func init() { - proto.RegisterFile("centauri/stakingmiddleware/v1beta1/tx.proto", fileDescriptor_d15665ac9877b062) -} - -var fileDescriptor_d15665ac9877b062 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0x4e, 0xcd, 0x2b, - 0x49, 0x2c, 0x2d, 0xca, 0xd4, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, 0x4c, 0x49, - 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, - 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x82, 0x29, 0xd6, 0xc3, 0x50, 0xac, 0x07, - 0x55, 0x2c, 0x25, 0x9e, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0xac, 0x9f, 0x5b, 0x9c, 0xae, 0x5f, 0x66, - 0x08, 0xa2, 0x20, 0x9a, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x54, 0x48, - 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0xa0, 0xa2, 0x92, 0x10, 0x13, 0xe2, 0x21, - 0x12, 0x10, 0x0e, 0x54, 0xca, 0x8a, 0x08, 0xd7, 0x62, 0x3a, 0x0d, 0xac, 0x57, 0xe9, 0x1e, 0x23, - 0x97, 0x88, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0xaa, 0x6b, 0x41, 0x7e, 0x72, 0x46, - 0x40, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x90, 0x19, 0x17, 0x67, 0x62, 0x69, 0x49, 0x46, 0x7e, 0x51, - 0x66, 0x49, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xc4, 0xa5, 0x2d, 0xba, 0x22, 0x50, - 0x9b, 0x1d, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x83, 0x10, - 0x4a, 0x85, 0x7c, 0xb9, 0xd8, 0x0a, 0xc0, 0x26, 0x48, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x69, - 0xe9, 0x11, 0x0e, 0x1e, 0x3d, 0x88, 0x9d, 0x4e, 0x9c, 0x27, 0xee, 0xc9, 0x33, 0xac, 0x78, 0xbe, - 0x41, 0x8b, 0x31, 0x08, 0x6a, 0x88, 0x95, 0x7d, 0xd3, 0xf3, 0x0d, 0x5a, 0x08, 0xe3, 0xbb, 0x9e, - 0x6f, 0xd0, 0xd2, 0x81, 0x7b, 0xb7, 0x02, 0x8b, 0x87, 0xe1, 0x9e, 0x81, 0x98, 0xa9, 0x24, 0xc7, - 0x25, 0x83, 0x26, 0x04, 0xf6, 0x65, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0xd1, 0x3c, - 0x46, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x7e, 0x46, 0x2e, 0x41, 0xcc, 0x50, 0xb0, 0x20, 0xc6, - 0xf5, 0xd8, 0xc2, 0x4f, 0xca, 0x81, 0x24, 0x9d, 0x58, 0x5c, 0x26, 0xc5, 0xda, 0x00, 0x0a, 0x09, - 0x27, 0xe3, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, - 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x92, 0xc4, 0xe6, 0xff, - 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xec, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x89, 0xbf, 0x82, 0x72, 0xc9, 0x02, 0x00, 0x00, + proto.RegisterFile("composable/stakingmiddleware/v1beta1/tx.proto", fileDescriptor_4ef8bcd16d104cd6) +} + +var fileDescriptor_4ef8bcd16d104cd6 = []byte{ + // 362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4d, 0xce, 0xcf, 0x2d, + 0xc8, 0x2f, 0x4e, 0x4c, 0xca, 0x49, 0xd5, 0x2f, 0x2e, 0x49, 0xcc, 0xce, 0xcc, 0x4b, 0xcf, 0xcd, + 0x4c, 0x49, 0xc9, 0x49, 0x2d, 0x4f, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x41, 0x28, 0xd7, 0xc3, 0x50, + 0xae, 0x07, 0x55, 0x2e, 0x25, 0x9e, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0xac, 0x9f, 0x5b, 0x9c, 0xae, + 0x5f, 0x66, 0x08, 0xa2, 0x20, 0xda, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, + 0x54, 0x48, 0x24, 0x3d, 0x3f, 0x3d, 0x1f, 0xcc, 0xd4, 0x07, 0xb1, 0xa0, 0xa2, 0x92, 0x10, 0x13, + 0xe2, 0x21, 0x12, 0x10, 0x0e, 0x54, 0xca, 0x86, 0x28, 0x17, 0x63, 0x3a, 0x0e, 0xac, 0x5b, 0xe9, + 0x11, 0x23, 0x97, 0x88, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0xaa, 0x6b, 0x41, 0x7e, + 0x72, 0x46, 0x40, 0x62, 0x51, 0x62, 0x6e, 0xb1, 0x90, 0x19, 0x17, 0x67, 0x62, 0x69, 0x49, 0x46, + 0x7e, 0x51, 0x66, 0x49, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xc4, 0xa5, 0x2d, 0xba, + 0x22, 0x50, 0xbb, 0x1d, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, + 0x83, 0x10, 0x4a, 0x85, 0xfc, 0xb9, 0xd8, 0x0a, 0xc0, 0x26, 0x48, 0x30, 0x29, 0x30, 0x6a, 0x70, + 0x1b, 0xe9, 0xe8, 0x11, 0x13, 0x44, 0x7a, 0x10, 0x5b, 0x9d, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, + 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0xd4, 0x18, 0x2b, 0xc7, 0xa6, 0xe7, 0x1b, 0xb4, 0x10, 0x16, + 0x74, 0x3d, 0xdf, 0xa0, 0x85, 0x64, 0xa4, 0x7e, 0x05, 0x16, 0x4f, 0xc3, 0x3d, 0x04, 0x31, 0x55, + 0x49, 0x8e, 0x4b, 0x06, 0x4d, 0x08, 0xec, 0xd3, 0xa0, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, + 0xa3, 0x45, 0x8c, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x93, 0x19, 0xb9, 0x04, 0x31, 0x43, 0xc2, + 0x8a, 0x38, 0x1f, 0x60, 0x0b, 0x45, 0x29, 0x27, 0x12, 0xf5, 0x62, 0x71, 0x9d, 0x14, 0x6b, 0x03, + 0x28, 0x3c, 0x9c, 0x8c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, + 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x12, + 0x5b, 0x18, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x63, 0xd9, 0x18, 0x10, 0x00, 0x00, + 0xff, 0xff, 0xc4, 0xc6, 0x61, 0xc6, 0xd7, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -192,7 +192,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) UpdateEpochParams(ctx context.Context, in *MsgUpdateEpochParams, opts ...grpc.CallOption) (*MsgUpdateParamsEpochResponse, error) { out := new(MsgUpdateParamsEpochResponse) - err := c.cc.Invoke(ctx, "/centauri.stakingmiddleware.v1beta1.Msg/UpdateEpochParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/composable.stakingmiddleware.v1beta1.Msg/UpdateEpochParams", in, out, opts...) if err != nil { return nil, err } @@ -226,7 +226,7 @@ func _Msg_UpdateEpochParams_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/centauri.stakingmiddleware.v1beta1.Msg/UpdateEpochParams", + FullMethod: "/composable.stakingmiddleware.v1beta1.Msg/UpdateEpochParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateEpochParams(ctx, req.(*MsgUpdateEpochParams)) @@ -235,7 +235,7 @@ func _Msg_UpdateEpochParams_Handler(srv interface{}, ctx context.Context, dec fu } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "centauri.stakingmiddleware.v1beta1.Msg", + ServiceName: "composable.stakingmiddleware.v1beta1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -244,7 +244,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "centauri/stakingmiddleware/v1beta1/tx.proto", + Metadata: "composable/stakingmiddleware/v1beta1/tx.proto", } func (m *MsgUpdateEpochParams) Marshal() (dAtA []byte, err error) { From 4e17c8cd9c87d64566c05e3a61e306fc1312e1b9 Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 8 Jan 2024 18:36:00 +0000 Subject: [PATCH 6/8] fix Potential key collision between KVStores:authz - authz. --- app/keepers/keys.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 101d53ef0..a0dc2e358 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -57,7 +57,6 @@ func (appKeepers *AppKeepers) GenerateKeys() { evidencetypes.StoreKey, ibctransfertypes.StoreKey, icqtypes.StoreKey, capabilitytypes.StoreKey, consensusparamtypes.StoreKey, wasm08types.StoreKey, authzkeeper.StoreKey, stakingmiddleware.StoreKey, crisistypes.StoreKey, routertypes.StoreKey, transfermiddlewaretypes.StoreKey, group.StoreKey, minttypes.StoreKey, alliancemoduletypes.StoreKey, wasm.StoreKey, ibchookstypes.StoreKey, icahosttypes.StoreKey, ratelimitmoduletypes.StoreKey, txBoundaryTypes.StoreKey, - authzkeeper.StoreKey, ) // Define transient store keys From 1953b4a663c5d23fb6aa0c822aac31a384252d68 Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 15 Jan 2024 15:55:00 +0000 Subject: [PATCH 7/8] rename software upgrade name to v6_4 to keep version correct naming --- app/app.go | 4 ++-- app/upgrades/{v8 => v6_4}/constants.go | 2 +- app/upgrades/{v8 => v6_4}/upgrade.go | 0 scripts/software_upgrade_metadata.json | 10 ++++++++++ scripts/software_upgrade_proposal.json | 17 +++++++++++++++++ 5 files changed, 30 insertions(+), 3 deletions(-) rename app/upgrades/{v8 => v6_4}/constants.go (96%) rename app/upgrades/{v8 => v6_4}/upgrade.go (100%) create mode 100644 scripts/software_upgrade_metadata.json create mode 100644 scripts/software_upgrade_proposal.json diff --git a/app/app.go b/app/app.go index 845dd4428..067fe7ca1 100644 --- a/app/app.go +++ b/app/app.go @@ -36,7 +36,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" "github.com/notional-labs/composable/v6/app/keepers" - v8 "github.com/notional-labs/composable/v6/app/upgrades/v8" + v6_4 "github.com/notional-labs/composable/v6/app/upgrades/v6_4" // bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -144,7 +144,7 @@ var ( // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 EnableSpecificProposals = "" - Upgrades = []upgrades.Upgrade{v8.Upgrade} + Upgrades = []upgrades.Upgrade{v6_4.Upgrade} Forks = []upgrades.Fork{} ) diff --git a/app/upgrades/v8/constants.go b/app/upgrades/v6_4/constants.go similarity index 96% rename from app/upgrades/v8/constants.go rename to app/upgrades/v6_4/constants.go index c0ecb2893..7f585cd56 100644 --- a/app/upgrades/v8/constants.go +++ b/app/upgrades/v6_4/constants.go @@ -9,7 +9,7 @@ import ( const ( // UpgradeName defines the on-chain upgrade name for the composable upgrade. - UpgradeName = "v8" + UpgradeName = "v6_4" ) var Upgrade = upgrades.Upgrade{ diff --git a/app/upgrades/v8/upgrade.go b/app/upgrades/v6_4/upgrade.go similarity index 100% rename from app/upgrades/v8/upgrade.go rename to app/upgrades/v6_4/upgrade.go diff --git a/scripts/software_upgrade_metadata.json b/scripts/software_upgrade_metadata.json new file mode 100644 index 000000000..1c7e6372c --- /dev/null +++ b/scripts/software_upgrade_metadata.json @@ -0,0 +1,10 @@ +{ + "title": "Title of proposal", + "authors": [ + "rustninja and kostuy and robert" + ], + "summary": "Update chain with a new epoch staking", + "details": "Some details for proposal", + "proposal_forum_url": "https://composable.finance", + "vote_option_context": "Yes No Abstain No with veto" + } \ No newline at end of file diff --git a/scripts/software_upgrade_proposal.json b/scripts/software_upgrade_proposal.json new file mode 100644 index 000000000..2fc66ca3e --- /dev/null +++ b/scripts/software_upgrade_proposal.json @@ -0,0 +1,17 @@ +{ + "messages": [ + { + "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + "authority": "layer10d07y265gmmuvt4z0w9aw880jnsr700j2q996p", + "plan": { + "name": "v6_4", + "height": "50", + "info": "Some info about plan", + "upgraded_client_state": null + } + } + ], + "deposit": "10000000stake", + "title": "Title of proposal", + "summary": "Update chain with a new epoch staking" + } \ No newline at end of file From 2071c3c8f4140f8f3934dff31b5386e72aad586f Mon Sep 17 00:00:00 2001 From: rustdev Date: Tue, 9 Jan 2024 16:17:31 +0000 Subject: [PATCH 8/8] renamed package to v6_4 --- app/upgrades/v6_4/constants.go | 2 +- app/upgrades/v6_4/upgrade.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v6_4/constants.go b/app/upgrades/v6_4/constants.go index 7f585cd56..64aca679c 100644 --- a/app/upgrades/v6_4/constants.go +++ b/app/upgrades/v6_4/constants.go @@ -1,4 +1,4 @@ -package v8 +package v6_4 import ( store "github.com/cosmos/cosmos-sdk/store/types" diff --git a/app/upgrades/v6_4/upgrade.go b/app/upgrades/v6_4/upgrade.go index 5cd1b8c43..825fab2f8 100644 --- a/app/upgrades/v6_4/upgrade.go +++ b/app/upgrades/v6_4/upgrade.go @@ -1,4 +1,4 @@ -package v8 +package v6_4 import ( sdk "github.com/cosmos/cosmos-sdk/types"