Skip to content

Commit

Permalink
Merge pull request #584 from CosmosContracts/reece/cleanup-13-ui
Browse files Browse the repository at this point in the history
[v13.0.1] Cleanup v13 Swagger UI (No Oracle / InterTx)
  • Loading branch information
faddat authored Mar 12, 2023
2 parents 6b69a3d + 92515d0 commit 881b36d
Show file tree
Hide file tree
Showing 20 changed files with 44,731 additions and 53,374 deletions.
8 changes: 2 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ import (
v10 "github.com/CosmosContracts/juno/v13/app/upgrades/v10"
v11 "github.com/CosmosContracts/juno/v13/app/upgrades/v11"
v12 "github.com/CosmosContracts/juno/v13/app/upgrades/v12"
v13p1 "github.com/CosmosContracts/juno/v13/app/upgrades/v13part1"
// oracleclient "github.com/CosmosContracts/juno/v13/x/oracle/client"
v13 "github.com/CosmosContracts/juno/v13/app/upgrades/v13"
)

const (
Expand All @@ -76,7 +75,7 @@ var (
// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
EnableSpecificProposals = ""

Upgrades = []upgrades.Upgrade{v10.Upgrade, v11.Upgrade, v12.Upgrade, v13p1.Upgrade}
Upgrades = []upgrades.Upgrade{v10.Upgrade, v11.Upgrade, v12.Upgrade, v13.Upgrade}
)

// These constants are derived from the above variables.
Expand Down Expand Up @@ -170,9 +169,6 @@ func getGovProposalHandlers() []govclient.ProposalHandler {
upgradeclient.CancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
// oracleclient.ProposalHandlerAddTrackingPriceHistory,
// oracleclient.ProposalHandlerAddTrackingPriceHistoryWithWhitelist,
// oracleclient.ProposalRemoveTrackingPriceHistory,
)

return govProposalHandlers
Expand Down
38 changes: 1 addition & 37 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ import (

feesharekeeper "github.com/CosmosContracts/juno/v13/x/feeshare/keeper"
feesharetypes "github.com/CosmosContracts/juno/v13/x/feeshare/types"
// intertxkeeper "github.com/cosmos/interchain-accounts/x/inter-tx/keeper"
// intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
//
// oraclekeeper "github.com/CosmosContracts/juno/v13/x/oracle/keeper"
// oracletypes "github.com/CosmosContracts/juno/v13/x/oracle/types"
)

type AppKeepers struct {
Expand Down Expand Up @@ -113,19 +108,15 @@ type AppKeepers struct {
// IBCHooksKeeper *ibchookskeeper.Keeper
// ContractKeeper *wasmkeeper.PermissionedKeeper

// OracleKeeper oraclekeeper.Keeper

ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
// InterTxKeeper intertxkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedFeeMockKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
// ScopedInterTxKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper

WasmKeeper wasm.Keeper
scopedWasmKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -175,7 +166,6 @@ func NewAppKeepers(
scopedIBCKeeper := appKeepers.CapabilityKeeper.ScopeToModule(ibchost.ModuleName)
scopedICAControllerKeeper := appKeepers.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedICAHostKeeper := appKeepers.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
// scopedInterTxKeeper := appKeepers.CapabilityKeeper.ScopeToModule(intertxtypes.ModuleName)
scopedTransferKeeper := appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedWasmKeeper := appKeepers.CapabilityKeeper.ScopeToModule(wasm.ModuleName)

Expand Down Expand Up @@ -246,17 +236,6 @@ func NewAppKeepers(

// ... other modules keepers

// appKeepers.OracleKeeper = oraclekeeper.NewKeeper(
// appCodec,
// appKeepers.keys[oracletypes.ModuleName],
// appKeepers.GetSubspace(oracletypes.ModuleName),
// appKeepers.AccountKeeper,
// appKeepers.BankKeeper,
// appKeepers.DistrKeeper,
// appKeepers.StakingKeeper,
// distrtypes.ModuleName,
// )

// Create IBC Keeper
appKeepers.IBCKeeper = ibckeeper.NewKeeper(
appCodec, appKeepers.keys[ibchost.StoreKey],
Expand All @@ -280,7 +259,6 @@ func NewAppKeepers(
// register the proposal types
govRouter := govtypes.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
// AddRoute(oracletypes.RouterKey, oraclekeeper.NewOracleProposalHandler(appKeepers.OracleKeeper)).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)).
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(appKeepers.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(appKeepers.UpgradeKeeper)).
Expand Down Expand Up @@ -367,11 +345,6 @@ func NewAppKeepers(
icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, appKeepers.ICAControllerKeeper)
icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, appKeepers.IBCFeeKeeper)

// this is the demo controller from
// https://github.com/cosmos/interchain-accounts
// used with a little faith on our part
// appKeepers.InterTxKeeper = intertxkeeper.NewKeeper(appCodec, appKeepers.keys[intertxtypes.StoreKey], appKeepers.ICAControllerKeeper, scopedInterTxKeeper)

// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec, appKeepers.keys[evidencetypes.StoreKey], &appKeepers.StakingKeeper, appKeepers.SlashingKeeper,
Expand Down Expand Up @@ -415,12 +388,6 @@ func NewAppKeepers(
"/osmosis.tokenfactory.v1beta1.Query/Params": &tokenfactorytypes.QueryParamsResponse{},
"/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata": &tokenfactorytypes.QueryDenomAuthorityMetadataResponse{},
"/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator": &tokenfactorytypes.QueryDenomsFromCreatorResponse{},

// oracle query
// "/juno.oracle.v1.Query/ExchangeRates": &oracletypes.QueryExchangeRatesResponse{},
// "/juno.oracle.v1.Query/Params": &oracletypes.QueryParamsResponse{},
// "/juno.oracle.v1.Query/ArithmeticTwapPriceBetweenTime": &oracletypes.QueryArithmeticTwapPriceBetweenTimeResponse{},
// "/juno.oracle.v1.Query/PriceHistoryAtTime": &oracletypes.QueryPriceHistoryAtTimeResponse{},
}
querierOpts := wasmkeeper.WithQueryPlugins(
&wasmkeeper.QueryPlugins{
Expand Down Expand Up @@ -491,7 +458,6 @@ func NewAppKeepers(
AddRoute(wasm.ModuleName, wasmStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack)
// AddRoute(intertxtypes.ModuleName, icaControllerStack)

appKeepers.IBCKeeper.SetRouter(ibcRouter)

Expand All @@ -505,7 +471,6 @@ func NewAppKeepers(
appKeepers.scopedWasmKeeper = scopedWasmKeeper
appKeepers.ScopedICAHostKeeper = scopedICAHostKeeper
appKeepers.ScopedICAControllerKeeper = scopedICAControllerKeeper
// appKeepers.ScopedInterTxKeeper = scopedInterTxKeeper

// set the contract keeper for the Ics20WasmHooks
// appKeepers.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(appKeepers.WasmKeeper)
Expand All @@ -531,7 +496,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
// paramsKeeper.Subspace(oracletypes.ModuleName)
paramsKeeper.Subspace(wasm.ModuleName)
paramsKeeper.Subspace(tokenfactorytypes.ModuleName)
paramsKeeper.Subspace(feesharetypes.ModuleName)
Expand Down
4 changes: 0 additions & 4 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import (

// ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"
packetforwardtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"
// intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
// oracletypes "github.com/CosmosContracts/juno/v13/x/oracle/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand All @@ -48,8 +46,6 @@ func (appKeepers *AppKeepers) GenerateKeys() {
packetforwardtypes.StoreKey,
ibcfeetypes.StoreKey,
// ibchookstypes.StoreKey,
// intertxtypes.StoreKey,
// oracletypes.StoreKey,
)

appKeepers.tkeys = sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down
16 changes: 0 additions & 16 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ import (
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
packetforward "github.com/strangelove-ventures/packet-forward-middleware/v4/router"
packetforwardtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"
// intertx "github.com/cosmos/interchain-accounts/x/inter-tx"
// intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
// "github.com/CosmosContracts/juno/v13/x/oracle"
// oracletypes "github.com/CosmosContracts/juno/v13/x/oracle/types"
// ibchooks "github.com/osmosis-labs/osmosis/x/ibc-hooks"
// ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"
)
Expand All @@ -72,7 +68,6 @@ var maccPerms = map[string][]string{
ibcfeetypes.ModuleName: nil,
wasm.ModuleName: {authtypes.Burner},
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
// oracletypes.ModuleName: nil,
}

// ModuleBasics defines the module BasicManager is in charge of setting up basic,
Expand Down Expand Up @@ -104,8 +99,6 @@ var ModuleBasics = module.NewBasicManager(
feeshare.AppModuleBasic{},
packetforward.AppModuleBasic{},
// ibchooks.AppModuleBasic{},
// oracle.AppModuleBasic{},
// intertx.AppModuleBasic{},
)

func appModules(
Expand Down Expand Up @@ -142,8 +135,6 @@ func appModules(
feeshare.NewAppModule(app.FeeShareKeeper, app.AccountKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
// intertx.NewAppModule(appCodec, app.InterTxKeeper),
// oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
// ibchooks.NewAppModule(app.AccountKeeper),
packetforward.NewAppModule(app.PacketForwardKeeper),
}
Expand Down Expand Up @@ -171,7 +162,6 @@ func simulationModules(
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
params.NewAppModule(app.ParamsKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
// oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
ibc.NewAppModule(app.IBCKeeper),
transfer.NewAppModule(app.TransferKeeper),
Expand Down Expand Up @@ -209,8 +199,6 @@ func orderBeginBlockers() []string {
tokenfactorytypes.ModuleName,
feesharetypes.ModuleName,
wasm.ModuleName,
// intertxtypes.ModuleName,
// oracletypes.ModuleName,
// ibchookstypes.ModuleName,
}
}
Expand Down Expand Up @@ -242,8 +230,6 @@ func orderEndBlockers() []string {
tokenfactorytypes.ModuleName,
feesharetypes.ModuleName,
wasm.ModuleName,
// intertxtypes.ModuleName,
// oracletypes.ModuleName,
// ibchookstypes.ModuleName,
}
}
Expand Down Expand Up @@ -275,8 +261,6 @@ func orderInitBlockers() []string {
tokenfactorytypes.ModuleName,
feesharetypes.ModuleName,
wasm.ModuleName,
// oracletypes.ModuleName,
// intertxtypes.ModuleName,
// ibchookstypes.ModuleName,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
packetforwardtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"
// ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"
// intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
// oracletypes "github.com/CosmosContracts/juno/v13/x/oracle/types"
)

// UpgradeName defines the on-chain upgrade name for the upgrade.
Expand All @@ -30,8 +28,6 @@ var Upgrade = upgrades.Upgrade{
ibcfeetypes.ModuleName,

// ibchookstypes.StoreKey,
// oracletypes.ModuleName,
// intertxtypes.ModuleName,
},
},
}
20 changes: 0 additions & 20 deletions app/upgrades/v13part1/upgrades.go → app/upgrades/v13/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"

// ICA

icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
Expand All @@ -19,7 +18,6 @@ import (
tokenfactorytypes "github.com/CosmWasm/token-factory/x/tokenfactory/types"
feesharetypes "github.com/CosmosContracts/juno/v13/x/feeshare/types"

// oracletypes "github.com/CosmosContracts/juno/v13/x/oracle/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"

Expand Down Expand Up @@ -72,24 +70,6 @@ func CreateV13UpgradeHandler(
keepers.ICAControllerKeeper.SetParams(ctx, icacontrollertypes.Params{ControllerEnabled: true})
logger.Info("upgraded ICAHostKeeper params")

// // Oracle
// newOracleParams := oracletypes.DefaultParams()

// // add osmosis to the oracle params
// osmosisDenom := oracletypes.Denom{
// BaseDenom: "ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518",
// SymbolDenom: "OSMO",
// Exponent: uint32(6),
// }

// allDenoms := oracletypes.DefaultWhitelist
// allDenoms = append(allDenoms, osmosisDenom)

// newOracleParams.Whitelist = allDenoms
// newOracleParams.TwapTrackingList = allDenoms
// logger.Info(fmt.Sprintf("Oracle params set: %s", newOracleParams.String()))
// keepers.OracleKeeper.SetParams(ctx, newOracleParams)

// TokenFactory
newTokenFactoryParams := tokenfactorytypes.Params{
DenomCreationFee: sdk.NewCoins(sdk.NewCoin(nativeDenom, sdk.NewInt(1000000))),
Expand Down
Loading

0 comments on commit 881b36d

Please sign in to comment.