Skip to content

Commit

Permalink
Revert for v13 "[ValSet-Pref] Module Wired up and created MsgSetValid…
Browse files Browse the repository at this point in the history
…atorSetPreference" (#3306)

* Revert "[ValSet-Pref] Module Wired up and created MsgSetValidatorSetPreference  (#2892)"

This reverts commit 2ee66e4.

* removed folder
  • Loading branch information
stackman27 authored Nov 8, 2022
1 parent c89b37f commit 309a8c5
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 4,268 deletions.
58 changes: 23 additions & 35 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ import (
"github.com/osmosis-labs/osmosis/v12/x/txfees"
txfeeskeeper "github.com/osmosis-labs/osmosis/v12/x/txfees/keeper"
txfeestypes "github.com/osmosis-labs/osmosis/v12/x/txfees/types"
valsetpref "github.com/osmosis-labs/osmosis/v12/x/valset-pref"
valsetpreftypes "github.com/osmosis-labs/osmosis/v12/x/valset-pref/types"
)

type AppKeepers struct {
Expand All @@ -94,30 +92,29 @@ type AppKeepers struct {
ScopedWasmKeeper capabilitykeeper.ScopedKeeper

// "Normal" keepers
AccountKeeper *authkeeper.AccountKeeper
BankKeeper *bankkeeper.BaseKeeper
AuthzKeeper *authzkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
DistrKeeper *distrkeeper.Keeper
SlashingKeeper *slashingkeeper.Keeper
IBCKeeper *ibckeeper.Keeper
ICAHostKeeper *icahostkeeper.Keeper
TransferKeeper *ibctransferkeeper.Keeper
EvidenceKeeper *evidencekeeper.Keeper
GAMMKeeper *gammkeeper.Keeper
TwapKeeper *twap.Keeper
LockupKeeper *lockupkeeper.Keeper
EpochsKeeper *epochskeeper.Keeper
IncentivesKeeper *incentiveskeeper.Keeper
MintKeeper *mintkeeper.Keeper
PoolIncentivesKeeper *poolincentiveskeeper.Keeper
TxFeesKeeper *txfeeskeeper.Keeper
SuperfluidKeeper *superfluidkeeper.Keeper
GovKeeper *govkeeper.Keeper
WasmKeeper *wasm.Keeper
ContractKeeper *wasmkeeper.PermissionedKeeper
TokenFactoryKeeper *tokenfactorykeeper.Keeper
ValidatorSetPreferenceKeeper *valsetpref.Keeper
AccountKeeper *authkeeper.AccountKeeper
BankKeeper *bankkeeper.BaseKeeper
AuthzKeeper *authzkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
DistrKeeper *distrkeeper.Keeper
SlashingKeeper *slashingkeeper.Keeper
IBCKeeper *ibckeeper.Keeper
ICAHostKeeper *icahostkeeper.Keeper
TransferKeeper *ibctransferkeeper.Keeper
EvidenceKeeper *evidencekeeper.Keeper
GAMMKeeper *gammkeeper.Keeper
TwapKeeper *twap.Keeper
LockupKeeper *lockupkeeper.Keeper
EpochsKeeper *epochskeeper.Keeper
IncentivesKeeper *incentiveskeeper.Keeper
MintKeeper *mintkeeper.Keeper
PoolIncentivesKeeper *poolincentiveskeeper.Keeper
TxFeesKeeper *txfeeskeeper.Keeper
SuperfluidKeeper *superfluidkeeper.Keeper
GovKeeper *govkeeper.Keeper
WasmKeeper *wasm.Keeper
ContractKeeper *wasmkeeper.PermissionedKeeper
TokenFactoryKeeper *tokenfactorykeeper.Keeper

// IBC modules
// transfer module
Expand Down Expand Up @@ -341,14 +338,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
)
appKeepers.TokenFactoryKeeper = &tokenFactoryKeeper

validatorSetPreferenceKeeper := valsetpref.NewKeeper(
appKeepers.keys[valsetpreftypes.StoreKey],
appKeepers.GetSubspace(valsetpreftypes.ModuleName),
appKeepers.StakingKeeper,
)

appKeepers.ValidatorSetPreferenceKeeper = &validatorSetPreferenceKeeper

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
supportedFeatures := "iterator,staking,stargate,osmosis,cosmwasm_1_1"
Expand Down Expand Up @@ -567,6 +556,5 @@ func KVStoreKeys() []string {
superfluidtypes.StoreKey,
wasm.StoreKey,
tokenfactorytypes.StoreKey,
valsetpreftypes.StoreKey,
}
}
2 changes: 0 additions & 2 deletions app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"github.com/osmosis-labs/osmosis/v12/x/tokenfactory"
"github.com/osmosis-labs/osmosis/v12/x/twap/twapmodule"
"github.com/osmosis-labs/osmosis/v12/x/txfees"
valsetprefmodule "github.com/osmosis-labs/osmosis/v12/x/valset-pref/valpref-module"
)

// AppModuleBasics returns ModuleBasics for the module BasicManager.
Expand Down Expand Up @@ -85,7 +84,6 @@ var AppModuleBasics = []module.AppModuleBasic{
epochs.AppModuleBasic{},
superfluid.AppModuleBasic{},
tokenfactory.AppModuleBasic{},
valsetprefmodule.AppModuleBasic{},
wasm.AppModuleBasic{},
ica.AppModuleBasic{},
}
5 changes: 0 additions & 5 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ import (
twaptypes "github.com/osmosis-labs/osmosis/v12/x/twap/types"
"github.com/osmosis-labs/osmosis/v12/x/txfees"
txfeestypes "github.com/osmosis-labs/osmosis/v12/x/txfees/types"
valsetpreftypes "github.com/osmosis-labs/osmosis/v12/x/valset-pref/types"
valsetprefmodule "github.com/osmosis-labs/osmosis/v12/x/valset-pref/valpref-module"
)

// moduleAccountPermissions defines module account permissions
Expand All @@ -92,7 +90,6 @@ var moduleAccountPermissions = map[string][]string{
txfeestypes.NonNativeFeeCollectorName: nil,
wasm.ModuleName: {authtypes.Burner},
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
valsetpreftypes.ModuleName: {authtypes.Staking},
}

// appModules return modules to initialize module manager.
Expand Down Expand Up @@ -145,7 +142,6 @@ func appModules(
app.EpochsKeeper,
),
tokenfactory.NewAppModule(*app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
valsetprefmodule.NewAppModule(appCodec, *app.ValidatorSetPreferenceKeeper),
}
}

Expand Down Expand Up @@ -215,7 +211,6 @@ func OrderInitGenesis(allModuleNames []string) []string {
poolincentivestypes.ModuleName,
superfluidtypes.ModuleName,
tokenfactorytypes.ModuleName,
valsetpreftypes.ModuleName,
incentivestypes.ModuleName,
epochstypes.ModuleName,
lockuptypes.ModuleName,
Expand Down
11 changes: 4 additions & 7 deletions app/upgrades/v13/constants.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package v13

import (
store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/osmosis-labs/osmosis/v12/app/upgrades"
valsetpreftypes "github.com/osmosis-labs/osmosis/v12/x/valset-pref/types"

store "github.com/cosmos/cosmos-sdk/store/types"
)

// UpgradeName defines the on-chain upgrade name for the Osmosis v13 upgrade.
// UpgradeName defines the on-chain upgrade name for the Osmosis v9 upgrade.
const UpgradeName = "v13"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
StoreUpgrades: store.StoreUpgrades{
Added: []string{valsetpreftypes.StoreKey},
Deleted: []string{}, // double check bech32ibc
},
StoreUpgrades: store.StoreUpgrades{},
}
14 changes: 0 additions & 14 deletions osmoutils/slice_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,3 @@ func ReverseSlice[T any](s []T) []T {
}
return s
}

// ContainsDuplicate checks if there are any duplicate
// elements in the slice.
func ContainsDuplicate[T any](arr []T) bool {
visited := make(map[any]bool, 0)
for i := 0; i < len(arr); i++ {
if visited[arr[i]] {
return true
} else {
visited[arr[i]] = true
}
}
return false
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
syntax = "proto3";
package osmosis.valsetpref.v1beta1;
package osmosis.validatorpreference.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "osmosis/valset-pref/v1beta1/state.proto";
import "osmosis/validator-preference/v1beta1/state.proto";

option go_package = "github.com/osmosis-labs/osmosis/v12/x/valset-pref/client/queryproto";
option go_package = "github.com/osmosis-labs/osmosis/v12/x/validator-preference/client/queryproto";
option (gogoproto.goproto_getters_all) = false;

// Query defines the gRPC querier service.
service Query {
// Returns the list of ValidatorPreferences for the user.
rpc UserValidatorPreferences(QueryUserValidatorPreferences)
returns (QueryUserValidatorPreferenceResponse) {
option (google.api.http).get = "/osmosis/valset-pref/v1beta1/{address}";
option (google.api.http).get =
"/osmosis/validator-preference/v1beta1/{user}";
}
}

// Request type for UserValidatorPreferences.
message QueryUserValidatorPreferences {
// user account address
string address = 1;
string user = 1;
}

// Response type the QueryUserValidatorPreferences query request
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package osmosis.valsetpref.v1beta1;
package osmosis.validatorpreference.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

option go_package = "github.com/osmosis-labs/osmosis/v12/x/valset-pref/types";
option go_package = "github.com/osmosis-labs/osmosis/v12/x/validator-preference/types";
option (gogoproto.goproto_getters_all) = false;

// ValidatorPreference defines the message structure for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
syntax = "proto3";
package osmosis.valsetpref.v1beta1;
package osmosis.validatorpreference.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "osmosis/valset-pref/v1beta1/state.proto";
import "osmosis/validator-preference/v1beta1/state.proto";

option go_package = "github.com/osmosis-labs/osmosis/v12/x/valset-pref/types";
option go_package = "github.com/osmosis-labs/osmosis/v12/x/validator-preference/types";

// Msg defines the valset-pref modules's gRPC message service.
// Msg defines the validator-preference modules's gRPC message service.
service Msg {
// SetValidatorSetPreference creates a set of validator preference.
// This message will process both create + update request.
Expand Down
Binary file modified tests/e2e/scripts/rate_limiter.wasm
Binary file not shown.
155 changes: 0 additions & 155 deletions x/valset-pref/README.md

This file was deleted.

Loading

0 comments on commit 309a8c5

Please sign in to comment.