diff --git a/app/ante.go b/app/ante.go index a4d4a7861..317f6857d 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,15 +1,15 @@ package app import ( + corestoretypes "cosmossdk.io/core/store" sdkerrors "cosmossdk.io/errors" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" sdkante "github.com/cosmos/cosmos-sdk/x/auth/ante" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" "github.com/NibiruChain/nibiru/app/ante" devgasante "github.com/NibiruChain/nibiru/x/devgas/v1/ante" @@ -22,8 +22,8 @@ type AnteHandlerOptions struct { DevGasKeeper *devgaskeeper.Keeper DevGasBankKeeper devgasante.BankKeeper - TxCounterStoreKey types.StoreKey - WasmConfig *wasmtypes.WasmConfig + TXCounterStoreService corestoretypes.KVStoreService + WasmConfig *wasmtypes.WasmConfig } // NewAnteHandler returns and AnteHandler that checks and increments sequence @@ -55,7 +55,7 @@ func NewAnteHandler(options AnteHandlerOptions) (sdk.AnteHandler, error) { anteDecorators := []sdk.AnteDecorator{ sdkante.NewSetUpContextDecorator(), wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), - wasmkeeper.NewCountTXDecorator(options.TxCounterStoreKey), + wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService), sdkante.NewExtensionOptionsDecorator(nil), sdkante.NewValidateBasicDecorator(), sdkante.NewTxTimeoutHeightDecorator(), diff --git a/app/ante/commission.go b/app/ante/commission.go index c0de8f0ae..200bf51e3 100644 --- a/app/ante/commission.go +++ b/app/ante/commission.go @@ -1,11 +1,12 @@ package ante import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) -func MAX_COMMISSION() sdk.Dec { return sdk.MustNewDecFromStr("0.25") } +func MAX_COMMISSION() sdkmath.LegacyDec { return sdkmath.LegacyMustNewDecFromStr("0.25") } var _ sdk.AnteDecorator = (*AnteDecoratorStakingCommission)(nil) diff --git a/app/ante/errors.go b/app/ante/errors.go index 5e5ef2bdc..572bd6e17 100644 --- a/app/ante/errors.go +++ b/app/ante/errors.go @@ -2,7 +2,7 @@ package ante import ( sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" + sdkmath "cosmossdk.io/math" ) var errorCodeIdx uint32 = 1 @@ -18,7 +18,7 @@ var ( ErrMaxValidatorCommission = registerError("validator commission rate is above max") ) -func NewErrMaxValidatorCommission(gotCommission sdk.Dec) error { +func NewErrMaxValidatorCommission(gotCommission sdkmath.LegacyDec) error { return ErrMaxValidatorCommission.Wrapf( "got (%s), max rate is (%s)", gotCommission, MAX_COMMISSION()) } diff --git a/app/ante/gas.go b/app/ante/gas.go index 7b4c2da98..591e5f93d 100644 --- a/app/ante/gas.go +++ b/app/ante/gas.go @@ -3,31 +3,29 @@ package ante import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" ) type fixedGasMeter struct { - consumed types.Gas + consumed storetypes.Gas } // NewFixedGasMeter returns a reference to a new fixedGasMeter. -func NewFixedGasMeter(fixedGas types.Gas) types.GasMeter { +func NewFixedGasMeter(fixedGas storetypes.Gas) storetypes.GasMeter { return &fixedGasMeter{ consumed: fixedGas, } } -func (g *fixedGasMeter) GasConsumed() types.Gas { +func (g *fixedGasMeter) GasConsumed() storetypes.Gas { return g.consumed } -func (g *fixedGasMeter) GasConsumedToLimit() types.Gas { +func (g *fixedGasMeter) GasConsumedToLimit() storetypes.Gas { return g.consumed } -func (g *fixedGasMeter) Limit() types.Gas { +func (g *fixedGasMeter) Limit() storetypes.Gas { return g.consumed } @@ -35,8 +33,8 @@ func (g *fixedGasMeter) GasRemaining() storetypes.Gas { return g.consumed } -func (g *fixedGasMeter) ConsumeGas(types.Gas, string) {} -func (g *fixedGasMeter) RefundGas(types.Gas, string) {} +func (g *fixedGasMeter) ConsumeGas(storetypes.Gas, string) {} +func (g *fixedGasMeter) RefundGas(storetypes.Gas, string) {} func (g *fixedGasMeter) IsPastLimit() bool { return false diff --git a/app/ante/testutil_test.go b/app/ante/testutil_test.go index 9e6d50edc..bc2834240 100644 --- a/app/ante/testutil_test.go +++ b/app/ante/testutil_test.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" diff --git a/app/app.go b/app/app.go index 2f8de8dff..994198a73 100644 --- a/app/app.go +++ b/app/app.go @@ -3,6 +3,7 @@ package app import ( "encoding/json" "fmt" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" "io" "net/http" "os" @@ -13,22 +14,22 @@ import ( "github.com/NibiruChain/nibiru/app/wasmext" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" + //_ "github.com/cosmos/cosmos-sdk/client/docs/statik" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -36,12 +37,11 @@ import ( authante "github.com/cosmos/cosmos-sdk/x/auth/ante" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" "github.com/cosmos/cosmos-sdk/x/crisis" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - "github.com/cosmos/ibc-go/v7/testing/types" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctesting "github.com/cosmos/ibc-go/v8/testing" + "github.com/cosmos/ibc-go/v8/testing/types" "github.com/gorilla/mux" "github.com/prometheus/client_golang/prometheus" "github.com/rakyll/statik/fs" @@ -138,7 +138,8 @@ func NewNibiruApp( txConfig := encodingConfig.TxConfig bApp := baseapp.NewBaseApp( - appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) + appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions..., + ) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) @@ -192,11 +193,11 @@ func NewNibiruApp( SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), SigGasConsumer: authante.DefaultSigVerificationGasConsumer, }, - IBCKeeper: app.ibcKeeper, - TxCounterStoreKey: keys[wasmtypes.StoreKey], - WasmConfig: &wasmConfig, - DevGasKeeper: &app.DevGasKeeper, - DevGasBankKeeper: app.BankKeeper, + IBCKeeper: app.ibcKeeper, + TXCounterStoreService: runtime.NewKVStoreService(keys[wasmtypes.StoreKey]), + WasmConfig: &wasmConfig, + DevGasKeeper: &app.DevGasKeeper, + DevGasBankKeeper: app.BankKeeper, }) if err != nil { panic(fmt.Errorf("failed to create sdk.AnteHandler: %s", err)) @@ -245,23 +246,27 @@ func NewNibiruApp( func (app *NibiruApp) Name() string { return app.BaseApp.Name() } // BeginBlocker application updates every begin block -func (app *NibiruApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.ModuleManager.BeginBlock(ctx, req) +func (app *NibiruApp) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) { + return app.ModuleManager.BeginBlock(ctx) } // EndBlocker application updates every end block -func (app *NibiruApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.ModuleManager.EndBlock(ctx, req) +func (app *NibiruApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) { + return app.ModuleManager.EndBlock(ctx) } // InitChainer application update at chain initialization -func (app *NibiruApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { +func (app *NibiruApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { var genesisState GenesisState if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - app.upgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) - return app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState) + err := app.upgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) + if err != nil { + panic(err) + } + response, err := app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState) + return response, err } // LoadHeight loads a particular height @@ -269,8 +274,8 @@ func (app *NibiruApp) LoadHeight(height int64) error { return app.LoadVersion(height) } -func (app *NibiruApp) RegisterNodeService(clientCtx client.Context) { - node.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +func (app *NibiruApp) RegisterNodeService(clientCtx client.Context, cfg config.Config) { + node.RegisterNodeService(clientCtx, app.GRPCQueryRouter(), cfg) } // ModuleAccountAddrs returns all the app's module account addresses. @@ -348,7 +353,7 @@ func (app *NibiruApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.API // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. - tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register legacy and grpc-gateway routes for all modules. ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) @@ -368,7 +373,7 @@ func (app *NibiruApp) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *NibiruApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService( + cmtservice.RegisterTendermintService( clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, diff --git a/app/export.go b/app/export.go index 7a9a5ed6a..3d5b2ab29 100644 --- a/app/export.go +++ b/app/export.go @@ -1,11 +1,10 @@ package app import ( + storetypes "cosmossdk.io/store/types" "encoding/json" "log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -19,7 +18,7 @@ func (app *NibiruApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -29,7 +28,10 @@ func (app *NibiruApp) ExportAppStateAndValidators( app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + genState, err := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) + if err != nil { + return servertypes.ExportedApp{}, err + } appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -73,12 +75,13 @@ func (app *NibiruApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs // withdraw all validator commission app.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + operator, _ := sdk.ValAddressFromBech32(val.GetOperator()) + _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, operator) return false }) // withdraw all delegator rewards - dels := app.stakingKeeper.GetAllDelegations(ctx) + dels, _ := app.stakingKeeper.GetAllDelegations(ctx) for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -105,12 +108,21 @@ func (app *NibiruApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs // reinitialize all validators app.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) + valAddr, err := sdk.ValAddressFromBech32(val.GetOperator()) + if err != nil { + panic(err) + } + + scraps, _ := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, valAddr) + feePool, err := app.DistrKeeper.FeePool.Get(ctx) + if err != nil { + panic(err) + } + feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) + app.DistrKeeper.FeePool.Set(ctx, feePool) - err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + err = app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, valAddr) if err != nil { panic(err) } @@ -163,14 +175,14 @@ func (app *NibiruApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs // Iterate through validators by power descending, reset bond heights, and // update bond intra-tx counters. store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + iter := storetypes.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) counter := int16(0) for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) - validator, found := app.stakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") + validator, err := app.stakingKeeper.GetValidator(ctx, addr) + if err != nil { + panic(err) } validator.UnbondingHeight = 0 diff --git a/app/ibc_test.go b/app/ibc_test.go index c2c3b1d09..f8261dfec 100644 --- a/app/ibc_test.go +++ b/app/ibc_test.go @@ -5,8 +5,8 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibctesting "github.com/cosmos/ibc-go/v8/testing" "github.com/stretchr/testify/suite" "github.com/NibiruChain/nibiru/app" diff --git a/app/keepers.go b/app/keepers.go index b6b54243f..0e88f8f45 100644 --- a/app/keepers.go +++ b/app/keepers.go @@ -1,6 +1,8 @@ package app import ( + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/types/module" "path/filepath" "strings" @@ -8,15 +10,21 @@ import ( "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + + "cosmossdk.io/store/types" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/evidence" + evidencekeeper "cosmossdk.io/x/evidence/keeper" + evidencetypes "cosmossdk.io/x/evidence/types" + "cosmossdk.io/x/feegrant" + feegrantkeeper "cosmossdk.io/x/feegrant/keeper" + feegrantmodule "cosmossdk.io/x/feegrant/module" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/store/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -29,9 +37,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" @@ -40,12 +45,6 @@ import ( distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/cosmos/cosmos-sdk/x/evidence" - evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -54,9 +53,11 @@ import ( govv1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" + "github.com/cosmos/ibc-go/modules/capability" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" @@ -68,29 +69,27 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" 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" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "cosmossdk.io/x/upgrade" + upgradekeeper "cosmossdk.io/x/upgrade/keeper" + upgradetypes "cosmossdk.io/x/upgrade/types" // --------------------------------------------------------------- // IBC imports - ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee" - ibcfeekeeper "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper" - ibcfeetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" - ibctransfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - ibcmock "github.com/cosmos/ibc-go/v7/testing/mock" + ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" + ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v8/modules/core" + ibcclient "github.com/cosmos/ibc-go/v8/modules/core/02-client" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" //nolint:staticcheck + porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" + ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" + ibcmock "github.com/cosmos/ibc-go/v8/testing/mock" "github.com/spf13/cast" // --------------------------------------------------------------- @@ -190,7 +189,7 @@ func initStoreKeys() ( tkeys map[string]*types.TransientStoreKey, memKeys map[string]*types.MemoryStoreKey, ) { - keys = sdk.NewKVStoreKeys( + keys = storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, @@ -222,8 +221,8 @@ func initStoreKeys() ( devgastypes.StoreKey, tokenfactorytypes.StoreKey, ) - tkeys = sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys = sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + tkeys = storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys = storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) return keys, tkeys, memKeys } @@ -245,8 +244,13 @@ func (app *NibiruApp) InitKeepers( ) // set the BaseApp's parameter store - app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], govModuleAddr) - bApp.SetParamStore(&app.ConsensusParamsKeeper) + app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), + govModuleAddr, + runtime.EventService{}, + ) + bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore) /* Add capabilityKeeper and ScopeToModule for the ibc module This allows authentication of object-capability permissions for each of @@ -271,29 +275,33 @@ func (app *NibiruApp) InitKeepers( // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, - keys[authtypes.StoreKey], + runtime.NewKVStoreService(keys[authtypes.StoreKey]), authtypes.ProtoBaseAccount, maccPerms, + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), sdk.GetConfig().GetBech32AccountAddrPrefix(), govModuleAddr, ) app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, - keys[banktypes.StoreKey], + runtime.NewKVStoreService(keys[banktypes.StoreKey]), app.AccountKeeper, BlockedAddresses(), govModuleAddr, + bApp.Logger(), ) app.stakingKeeper = stakingkeeper.NewKeeper( appCodec, - keys[stakingtypes.StoreKey], + runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, govModuleAddr, + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), ) app.DistrKeeper = distrkeeper.NewKeeper( appCodec, - keys[distrtypes.StoreKey], + runtime.NewKVStoreService(keys[distrtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.stakingKeeper, @@ -304,14 +312,18 @@ func (app *NibiruApp) InitKeepers( invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)) app.crisisKeeper = *crisiskeeper.NewKeeper( appCodec, - keys[crisistypes.StoreKey], + runtime.NewKVStoreService(keys[crisistypes.StoreKey]), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, govModuleAddr, + app.AccountKeeper.AddressCodec(), + ) + app.FeeGrantKeeper = feegrantkeeper.NewKeeper( + appCodec, + runtime.NewKVStoreService(keys[feegrant.StoreKey]), + app.AccountKeeper, ) - - app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) // get skipUpgradeHeights from the app options skipUpgradeHeights := map[int64]bool{} @@ -323,7 +335,7 @@ func (app *NibiruApp) InitKeepers( /*upgradeKeeper must be created before ibcKeeper. */ app.upgradeKeeper = *upgradekeeper.NewKeeper( skipUpgradeHeights, - keys[upgradetypes.StoreKey], + runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, @@ -335,7 +347,7 @@ func (app *NibiruApp) InitKeepers( app.slashingKeeper = slashingkeeper.NewKeeper( appCodec, legacyAmino, - keys[slashingtypes.StoreKey], + runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), app.stakingKeeper, govModuleAddr, ) @@ -345,7 +357,7 @@ func (app *NibiruApp) InitKeepers( ) app.authzKeeper = authzkeeper.NewKeeper( - keys[authzkeeper.StoreKey], + runtime.NewKVStoreService(keys[authzkeeper.StoreKey]), appCodec, app.BaseApp.MsgServiceRouter(), app.AccountKeeper, @@ -354,15 +366,25 @@ func (app *NibiruApp) InitKeepers( // ---------------------------------- Nibiru Chain x/ keepers app.SpotKeeper = spotkeeper.NewKeeper( - appCodec, keys[spottypes.StoreKey], app.GetSubspace(spottypes.ModuleName), - app.AccountKeeper, app.BankKeeper, app.DistrKeeper) + appCodec, + keys[spottypes.StoreKey], + app.GetSubspace(spottypes.ModuleName), + app.AccountKeeper, + app.BankKeeper, + app.DistrKeeper, + ) app.SudoKeeper = keeper.NewKeeper( appCodec, keys[sudotypes.StoreKey], ) - app.OracleKeeper = oraclekeeper.NewKeeper(appCodec, keys[oracletypes.StoreKey], - app.AccountKeeper, app.BankKeeper, app.DistrKeeper, app.stakingKeeper, + app.OracleKeeper = oraclekeeper.NewKeeper( + appCodec, + keys[oracletypes.StoreKey], + app.AccountKeeper, + app.BankKeeper, + app.DistrKeeper, + app.stakingKeeper, app.SudoKeeper, distrtypes.ModuleName, ) @@ -372,14 +394,25 @@ func (app *NibiruApp) InitKeepers( ) app.PerpKeeperV2 = perpkeeper.NewKeeper( - appCodec, keys[perptypes.StoreKey], - app.AccountKeeper, app.BankKeeper, app.OracleKeeper, app.EpochsKeeper, + appCodec, + keys[perptypes.StoreKey], + app.AccountKeeper, + app.BankKeeper, + app.OracleKeeper, + app.EpochsKeeper, app.SudoKeeper, ) app.InflationKeeper = inflationkeeper.NewKeeper( - appCodec, keys[inflationtypes.StoreKey], app.GetSubspace(inflationtypes.ModuleName), - app.AccountKeeper, app.BankKeeper, app.DistrKeeper, app.stakingKeeper, app.SudoKeeper, authtypes.FeeCollectorName, + appCodec, + keys[inflationtypes.StoreKey], + app.GetSubspace(inflationtypes.ModuleName), + app.AccountKeeper, + app.BankKeeper, + app.DistrKeeper, + app.stakingKeeper, + app.SudoKeeper, + authtypes.FeeCollectorName, ) app.EpochsKeeper.SetHooks( @@ -399,6 +432,7 @@ func (app *NibiruApp) InitKeepers( app.stakingKeeper, app.upgradeKeeper, app.ScopedIBCKeeper, + govModuleAddr, ) // IBC Fee Module keeper @@ -406,7 +440,7 @@ func (app *NibiruApp) InitKeepers( appCodec, keys[ibcfeetypes.StoreKey], app.ibcKeeper.ChannelKeeper, // may be replaced with IBC middleware app.ibcKeeper.ChannelKeeper, - &app.ibcKeeper.PortKeeper, + app.ibcKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, ) @@ -417,10 +451,11 @@ func (app *NibiruApp) InitKeepers( /* paramSubspace */ app.GetSubspace(ibctransfertypes.ModuleName), /* ibctransfertypes.ICS4Wrapper */ app.ibcFeeKeeper, /* ibctransfertypes.ChannelKeeper */ app.ibcKeeper.ChannelKeeper, - /* ibctransfertypes.PortKeeper */ &app.ibcKeeper.PortKeeper, + /* ibctransfertypes.PortKeeper */ app.ibcKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, app.ScopedTransferKeeper, + govModuleAddr, ) app.ScopedWasmKeeper = app.capabilityKeeper.ScopeToModule(wasmtypes.ModuleName) @@ -442,14 +477,14 @@ func (app *NibiruApp) InitKeepers( supportedFeatures := strings.Join(wasmdapp.AllCapabilities(), ",") app.WasmKeeper = wasmkeeper.NewKeeper( appCodec, - keys[wasmtypes.StoreKey], + runtime.NewKVStoreService(keys[wasmtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.stakingKeeper, distrkeeper.NewQuerier(app.DistrKeeper), app.ibcFeeKeeper, // ISC4 Wrapper: fee IBC middleware app.ibcKeeper.ChannelKeeper, - &app.ibcKeeper.PortKeeper, + app.ibcKeeper.PortKeeper, app.ScopedWasmKeeper, app.ibcTransferKeeper, app.MsgServiceRouter(), @@ -486,8 +521,12 @@ func (app *NibiruApp) InitKeepers( // Create evidence keeper. // This keeper automatically includes an evidence router. app.evidenceKeeper = *evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], app.stakingKeeper, + appCodec, + runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), + app.stakingKeeper, app.slashingKeeper, + app.AccountKeeper.AddressCodec(), + runtime.ProvideCometInfoService(), ) // Mock Module setup for testing IBC and also acts as the interchain accounts authentication module @@ -541,16 +580,19 @@ func (app *NibiruApp) InitKeepers( AddRoute(govtypes.RouterKey, govv1beta1types.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)). // AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.upgradeKeeper)). + // TODO: find NewSoftwareUpgradeProposalHandler + //AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(&app.upgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.ibcKeeper.ClientKeeper)) govConfig := govtypes.DefaultConfig() + govKeeper := govkeeper.NewKeeper( appCodec, - keys[govtypes.StoreKey], + runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.stakingKeeper, + app.DistrKeeper, app.MsgServiceRouter(), govConfig, govModuleAddr, @@ -571,21 +613,23 @@ func (app *NibiruApp) initAppModules( appCodec := app.appCodec return []module.AppModule{ - // core modules genutil.NewAppModule( - app.AccountKeeper, app.stakingKeeper, app.BaseApp.DeliverTx, + app.AccountKeeper, + app.stakingKeeper, + app, encodingConfig.TxConfig, ), + // core modules auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), capability.NewAppModule(appCodec, *app.capabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), - slashing.NewAppModule(appCodec, app.slashingKeeper, app.AccountKeeper, app.BankKeeper, app.stakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.slashingKeeper, app.AccountKeeper, app.BankKeeper, app.stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry), 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)), - upgrade.NewAppModule(&app.upgradeKeeper), + upgrade.NewAppModule(&app.upgradeKeeper, app.AccountKeeper.AddressCodec()), params.NewAppModule(app.paramsKeeper), authzmodule.NewAppModule(appCodec, app.authzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), @@ -705,8 +749,9 @@ func (app *NibiruApp) initModuleManager( encodingConfig EncodingConfig, skipGenesisInvariants bool, ) { + appModules := app.initAppModules(encodingConfig, skipGenesisInvariants) app.ModuleManager = module.NewManager( - app.initAppModules(encodingConfig, skipGenesisInvariants)..., + appModules..., ) orderedModules := orderedModuleNames() @@ -755,13 +800,14 @@ func ModuleBasicManager() module.BasicManager { capability.AppModuleBasic{}, StakingModule{}, distr.AppModuleBasic{}, - NewGovModuleBasic( - paramsclient.ProposalHandler, - upgradeclient.LegacyProposalHandler, - upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - ), + // TODO: implement legacy proposal handlers + //NewGovModuleBasic( + // paramsclient.ProposalHandler, + // upgradeclient.LegacyProposalHandler, + // upgradeclient.LegacyCancelProposalHandler, + // ibcclientclient.UpdateClientProposalHandler, + // ibcclientclient.UpgradeProposalHandler, + //), params.AppModuleBasic{}, CrisisModule{}, slashing.AppModuleBasic{}, diff --git a/app/modules.go b/app/modules.go index c64155dad..8a4123cde 100644 --- a/app/modules.go +++ b/app/modules.go @@ -1,6 +1,7 @@ package app import ( + "cosmossdk.io/math" "encoding/json" "fmt" @@ -66,7 +67,7 @@ var _ module.HasGenesisBasics = (*StakingModule)(nil) func (StakingModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { genState := stakingtypes.DefaultGenesisState() genState.Params.BondDenom = BondDenom - genState.Params.MinCommissionRate = sdk.MustNewDecFromStr("0.05") + genState.Params.MinCommissionRate = math.LegacyMustNewDecFromStr("0.05") return cdc.MustMarshalJSON(genState) } diff --git a/app/upgrades.go b/app/upgrades.go index 26093c521..8dde1ca93 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -3,7 +3,7 @@ package app import ( "fmt" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/NibiruChain/nibiru/app/upgrades" "github.com/NibiruChain/nibiru/app/upgrades/v1_1_0" @@ -20,7 +20,7 @@ func (app *NibiruApp) setupUpgrades() { func (app *NibiruApp) setUpgradeHandlers() { for _, u := range Upgrades { - app.upgradeKeeper.SetUpgradeHandler(u.UpgradeName, u.CreateUpgradeHandler(app.ModuleManager, app.configurator)) + app.upgradeKeeper.SetUpgradeHandler(u.UpgradeName, u.CreateUpgradeHandler(*app.ModuleManager, app.configurator)) } } diff --git a/app/upgrades/types.go b/app/upgrades/types.go index a2cdde4b5..ad86f1a87 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -1,15 +1,22 @@ package upgrades import ( - store "github.com/cosmos/cosmos-sdk/store/types" + "context" + store "cosmossdk.io/store/types" + "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) type Upgrade struct { UpgradeName string - CreateUpgradeHandler func(*module.Manager, module.Configurator) types.UpgradeHandler + CreateUpgradeHandler func(module.Manager, module.Configurator) types.UpgradeHandler StoreUpgrades store.StoreUpgrades } + +func CreateUpgradeHandler(mm module.Manager, configurator module.Configurator) types.UpgradeHandler { + return func(ctx context.Context, plan types.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, configurator, fromVM) + } +} diff --git a/app/upgrades/v1_1_0/constants.go b/app/upgrades/v1_1_0/constants.go index 257ef77c5..6476fcc7a 100644 --- a/app/upgrades/v1_1_0/constants.go +++ b/app/upgrades/v1_1_0/constants.go @@ -1,11 +1,7 @@ package v1_1_0 import ( - "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - + "cosmossdk.io/store/types" "github.com/NibiruChain/nibiru/app/upgrades" inflationtypes "github.com/NibiruChain/nibiru/x/inflation/types" ) @@ -14,11 +10,8 @@ const UpgradeName = "v1.1.0" var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, - CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler { - return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - return mm.RunMigrations(ctx, cfg, fromVM) - } - }, + + CreateUpgradeHandler: upgrades.CreateUpgradeHandler, StoreUpgrades: types.StoreUpgrades{ Added: []string{inflationtypes.ModuleName}, }, diff --git a/app/wasmext/stargate_query.go b/app/wasmext/stargate_query.go index 3a08dd327..dbd58401c 100644 --- a/app/wasmext/stargate_query.go +++ b/app/wasmext/stargate_query.go @@ -14,9 +14,9 @@ import ( bank "github.com/cosmos/cosmos-sdk/x/bank/types" gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" ) /* diff --git a/cmd/nibid/cmd/decode_base64_test.go b/cmd/nibid/cmd/decode_base64_test.go index c5e3c1e4e..8fb2d0205 100644 --- a/cmd/nibid/cmd/decode_base64_test.go +++ b/cmd/nibid/cmd/decode_base64_test.go @@ -6,7 +6,7 @@ import ( "github.com/NibiruChain/nibiru/app" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil" diff --git a/cmd/nibid/cmd/genaccounts.go b/cmd/nibid/cmd/genaccounts.go index 6b79b1d87..17c64f091 100644 --- a/cmd/nibid/cmd/genaccounts.go +++ b/cmd/nibid/cmd/genaccounts.go @@ -90,7 +90,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + baseVestingAccount, _ := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { diff --git a/cmd/nibid/cmd/genaccounts_test.go b/cmd/nibid/cmd/genaccounts_test.go index 3846fc2f3..d7bafa60a 100644 --- a/cmd/nibid/cmd/genaccounts_test.go +++ b/cmd/nibid/cmd/genaccounts_test.go @@ -7,7 +7,7 @@ import ( "github.com/NibiruChain/nibiru/app" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" diff --git a/cmd/nibid/cmd/init.go b/cmd/nibid/cmd/init.go index 534ee07c5..7c0d485d3 100644 --- a/cmd/nibid/cmd/init.go +++ b/cmd/nibid/cmd/init.go @@ -4,6 +4,7 @@ import ( "bufio" "encoding/json" "fmt" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "os" "path/filepath" "time" @@ -13,7 +14,6 @@ import ( tmcli "github.com/cometbft/cometbft/libs/cli" tmrand "github.com/cometbft/cometbft/libs/rand" - tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/go-bip39" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -153,24 +153,22 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { return errors.Wrap(err, "Failed to marshal default genesis state") } - genDoc := &tmtypes.GenesisDoc{} + appGenesis := &genutiltypes.AppGenesis{} if _, err := os.Stat(genFile); err != nil { if !os.IsNotExist(err) { return err } } else { - genDoc, err = tmtypes.GenesisDocFromFile(genFile) + appGenesis, err = genutiltypes.AppGenesisFromFile(config.GenesisFile()) if err != nil { return errors.Wrap(err, "Failed to read genesis doc from file") } + appGenesis.AppState = appState + appGenesis.ChainID = chainID + appGenesis.InitialHeight = initHeight } - genDoc.ChainID = chainID - genDoc.Validators = nil - genDoc.AppState = appState - genDoc.InitialHeight = initHeight - - if err = genutil.ExportGenesisFile(genDoc, genFile); err != nil { + if err = genutil.ExportGenesisFile(appGenesis, genFile); err != nil { return errors.Wrap(err, "Failed to export genesis file") } diff --git a/cmd/nibid/cmd/root.go b/cmd/nibid/cmd/root.go index 72587fac6..ab7dafd78 100644 --- a/cmd/nibid/cmd/root.go +++ b/cmd/nibid/cmd/root.go @@ -5,11 +5,12 @@ import ( "io" "os" + confixcmd "cosmossdk.io/tools/confix/cmd" "github.com/NibiruChain/nibiru/x/sudo/cli" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cometbft/cometbft/libs/log" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" @@ -144,15 +145,15 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig app.EncodingConfig) { tmcli.NewCompletionCmd(rootCmd, true), testnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}), debug.Cmd(), - config.Cmd(), - pruning.PruningCmd(a.newApp), + confixcmd.GetCommand(), + pruning.Cmd(a.newApp, app.DefaultNodeHome), ) server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags) // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( - rpc.StatusCommand(), + server.StatusCommand(), genesisCommand( encodingConfig, oraclecli.AddGenesisPricefeederDelegationCmd(app.DefaultNodeHome), @@ -161,7 +162,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig app.EncodingConfig) { ), queryCommand(), txCommand(), - keys.Commands(app.DefaultNodeHome), + keys.Commands(), ) // TODO add rosettaj @@ -197,9 +198,8 @@ func queryCommand() *cobra.Command { } rootQueryCmd.AddCommand( - authcmd.GetAccountCmd(), rpc.ValidatorCommand(), - rpc.BlockCommand(), + server.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), authcmd.QueryTxCmd(), ) diff --git a/cmd/nibid/cmd/testnet.go b/cmd/nibid/cmd/testnet.go index 763ab7cf1..d5b8a02c7 100644 --- a/cmd/nibid/cmd/testnet.go +++ b/cmd/nibid/cmd/testnet.go @@ -4,8 +4,10 @@ package cmd import ( "bufio" + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" + "github.com/cosmos/cosmos-sdk/runtime" "net" "os" "path/filepath" @@ -79,6 +81,7 @@ Example: return InitTestnet( clientCtx, cmd, config, mbm, genBalIterator, outputDir, chainID, minGasPrices, nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algo, numValidators, + clientCtx.TxConfig.SigningContext().ValidatorAddressCodec(), ) }, } @@ -114,6 +117,7 @@ func InitTestnet( keyringBackend, algoStr string, numValidators int, + valAddrCodec runtime.ValidatorAddressCodec, ) error { if chainID == "" { chainID = "chain-" + tmrand.NewRand().Str(6) @@ -209,12 +213,12 @@ func InitTestnet( valTokens := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + addr.String(), valPubKeys[i], sdk.NewCoin(denoms.NIBI, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) if err != nil { return err @@ -234,7 +238,7 @@ func InitTestnet( WithKeybase(kb). WithTxConfig(clientCtx.TxConfig) - if err := tx.Sign(txFactory, nodeDirName, txBuilder, true); err != nil { + if err := tx.Sign(cmd.Context(), txFactory, nodeDirName, txBuilder, true); err != nil { return err } @@ -256,7 +260,7 @@ func InitTestnet( err := collectGenFiles( clientCtx, nodeConfig, chainID, nodeIDs, valPubKeys, numValidators, - outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, + outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, valAddrCodec, ) if err != nil { return err @@ -319,6 +323,7 @@ func collectGenFiles( clientCtx client.Context, nodeConfig *tmconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, + valAddrCodec runtime.ValidatorAddressCodec, ) error { var appState json.RawMessage genTime := tmtime.Now() @@ -334,7 +339,7 @@ func collectGenFiles( nodeID, valPubKey := nodeIDs[i], valPubKeys[i] initCfg := genutiltypes.NewInitConfig(chainID, gentxsDir, nodeID, valPubKey) - genDoc, err := types.GenesisDocFromFile(nodeConfig.GenesisFile()) + appGenesis, err := genutiltypes.AppGenesisFromFile(nodeConfig.GenesisFile()) if err != nil { return err } @@ -344,9 +349,10 @@ func collectGenFiles( clientCtx.TxConfig, nodeConfig, initCfg, - *genDoc, + appGenesis, genBalIterator, genutiltypes.DefaultMessageValidator, + valAddrCodec, ) if err != nil { return err diff --git a/cmd/nibid/cmd/testnet_test.go b/cmd/nibid/cmd/testnet_test.go index 2054580f9..f9c160494 100644 --- a/cmd/nibid/cmd/testnet_test.go +++ b/cmd/nibid/cmd/testnet_test.go @@ -7,7 +7,7 @@ import ( "github.com/NibiruChain/nibiru/app" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" diff --git a/cmd/nibid/main.go b/cmd/nibid/main.go index b34315c2f..2e8058b0b 100644 --- a/cmd/nibid/main.go +++ b/cmd/nibid/main.go @@ -1,9 +1,9 @@ package main import ( + "cosmossdk.io/log" "os" - "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/NibiruChain/nibiru/app" @@ -14,12 +14,7 @@ func main() { rootCmd, _ := cmd.NewRootCmd() if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { - switch e := err.(type) { - case server.ErrorCode: - os.Exit(e.Code) - - default: - os.Exit(1) - } + log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) + os.Exit(1) } } diff --git a/go.mod b/go.mod index a4e283aee..15216811f 100644 --- a/go.mod +++ b/go.mod @@ -3,23 +3,27 @@ module github.com/NibiruChain/nibiru go 1.21 require ( + cosmossdk.io/collections v0.4.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 - github.com/CosmWasm/wasmd v0.44.0 + cosmossdk.io/store v1.0.2 + cosmossdk.io/x/evidence v0.1.0 + cosmossdk.io/x/feegrant v0.1.0 + cosmossdk.io/x/upgrade v0.1.1 + github.com/CosmWasm/wasmd v0.50.0 github.com/CosmWasm/wasmvm v1.5.0 github.com/MakeNowJust/heredoc/v2 v2.0.1 - github.com/NibiruChain/collections v0.4.0 - github.com/armon/go-metrics v0.4.1 - github.com/cometbft/cometbft v0.37.4 + github.com/cometbft/cometbft v0.38.6 github.com/cometbft/cometbft-db v0.11.0 github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/cosmos-sdk v0.47.10 + github.com/cosmos/cosmos-sdk v0.50.5 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.3.2 + //github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/ibc-go/modules/capability v1.0.0 + github.com/cosmos/ibc-go/v8 v8.0.0 github.com/gogo/protobuf v1.3.3 github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.4 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.1 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -31,34 +35,45 @@ require ( github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.16.0 - github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe - google.golang.org/grpc v1.61.0 - google.golang.org/protobuf v1.32.0 + github.com/spf13/viper v1.18.2 + github.com/stretchr/testify v1.9.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 + google.golang.org/grpc v1.62.0 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - cloud.google.com/go v0.111.0 // indirect - cloud.google.com/go/compute v1.23.3 // indirect + cosmossdk.io/core v0.11.0 + cosmossdk.io/log v1.3.1 + cosmossdk.io/tools/confix v0.1.0 + github.com/cosmos/cosmos-db v1.0.2 + github.com/cosmos/gogoproto v1.4.11 + github.com/hashicorp/go-metrics v0.5.2 +) + +require ( + cloud.google.com/go v0.112.0 // indirect + cloud.google.com/go/compute v1.24.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.5 // indirect - cloud.google.com/go/storage v1.30.1 // indirect - cosmossdk.io/api v0.4.0 // indirect - cosmossdk.io/core v0.6.1 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.36.0 // indirect + cosmossdk.io/api v0.7.3 // indirect + cosmossdk.io/client/v2 v2.0.0-beta.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect + cosmossdk.io/x/circuit v0.1.0 // indirect + cosmossdk.io/x/nft v0.1.0 // indirect + cosmossdk.io/x/tx v0.13.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/DataDog/zstd v1.5.2 // indirect - github.com/aws/aws-sdk-go v1.44.203 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect + github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -70,67 +85,68 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.21.0-beta.1 // indirect + github.com/cosmos/iavl v1.0.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect - github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect - github.com/creachadair/taskgroup v0.4.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/creachadair/atomicfile v0.3.1 // indirect + github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect + github.com/distribution/reference v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.1.2 // indirect + github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/merlin v0.1.1 // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.1 // indirect + github.com/hashicorp/go-getter v1.7.3 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -140,54 +156,61 @@ require ( github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.47.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.32.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/btree v1.7.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/otel v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect - go.opentelemetry.io/otel/trace v1.19.0 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect - golang.org/x/net v0.20.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect + go.opentelemetry.io/otel v1.22.0 // indirect + go.opentelemetry.io/otel/metric v1.22.0 // indirect + go.opentelemetry.io/otel/trace v1.22.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/net v0.21.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/term v0.16.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/term v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/api v0.149.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect @@ -195,10 +218,6 @@ require ( replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 -replace cosmossdk.io/api => cosmossdk.io/api v0.3.1 - -replace github.com/cosmos/iavl => github.com/cosmos/iavl v0.20.0 - // pin version! 126854af5e6d has issues with the store so that queries fail replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 diff --git a/go.sum b/go.sum index ed069be0e..a409b2e22 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,11 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -18,7 +15,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -34,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= -cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= +cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -59,7 +55,6 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= @@ -73,8 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= +cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -114,8 +109,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= -cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= @@ -173,12 +168,11 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= +cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -190,11 +184,15 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= -cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= -cosmossdk.io/core v0.6.1 h1:OBy7TI2W+/gyn2z40vVvruK3di+cAluinA6cybFbE7s= -cosmossdk.io/core v0.6.1/go.mod h1:g3MMBCBXtxbDWBURDVnJE7XML4BG5qENhs0gzkcpuFA= +cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= +cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= +cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/collections v0.4.0/go.mod h1:tKTlBL+Cs1oJnS4tT9MIaFWr7BWsUXrc7KPzP1LxRBo= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= @@ -203,92 +201,77 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= -cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= +cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= +cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/tools/confix v0.1.0 h1:2OOZTtQsDT5e7P3FM5xqM0bPfluAxZlAwxqaDmYBE+E= +cosmossdk.io/tools/confix v0.1.0/go.mod h1:TdXKVYs4gEayav5wM+JHT+kTU2J7fozFNqoVaN+8CdY= +cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= +cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= +cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= +cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= +cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= +cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= +cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= +cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= +cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= +cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= +cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= -git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/CosmWasm/wasmd v0.44.0 h1:2sbcoCAvfjCs1O0SWt53xULKjkV06dbSFthEViIC6Zg= -github.com/CosmWasm/wasmd v0.44.0/go.mod h1:tDyYN050qUcdd7LOxGeo2e185sEShyO3nJGl2Cf59+k= +github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE= +github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk= github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/MakeNowJust/heredoc/v2 v2.0.1 h1:rlCHh70XXXv7toz95ajQWOWQnN4WNLt0TdpZYIR/J6A= github.com/MakeNowJust/heredoc/v2 v2.0.1/go.mod h1:6/2Abh5s+hc3g9nbWLe9ObDIOhaRrqsyY9MWy+4JdRM= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= -github.com/NibiruChain/collections v0.4.0 h1:KNJj+CJyqOT/Q33kcVzT2uLYIiwhiFAeZMhGLPge5Og= -github.com/NibiruChain/collections v0.4.0/go.mod h1:tKTlBL+Cs1oJnS4tT9MIaFWr7BWsUXrc7KPzP1LxRBo= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= -github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+RQ= +github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -298,39 +281,16 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= -github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= -github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= -github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= -github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= @@ -338,15 +298,12 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -360,7 +317,6 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -370,6 +326,8 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -386,19 +344,10 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= -github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= -github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.4 h1:xyvvEqlyfK8MgNIIKVJaMsuIp03wxOcFmVkT26+Ikpg= -github.com/cometbft/cometbft v0.37.4/go.mod h1:Cmg5Hp4sNpapm7j+x0xRyt2g0juQfmB752ous+pA0G8= +github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= +github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= -github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -409,78 +358,65 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.47.10 h1:Wxf5yEN3jZbG4fftxAMKB6rpd8ME0mxuCVihpz65dt0= -github.com/cosmos/cosmos-sdk v0.47.10/go.mod h1:UWpgWkhcsBIATS68uUC0del7IiBN4hPv/vqg8Zz23uw= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= +github.com/cosmos/cosmos-sdk v0.50.5 h1:MOEi+DKYgW67YaPgB+Pf+nHbD3V9S/ayitRKJYLfGIA= +github.com/cosmos/cosmos-sdk v0.50.5/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= -github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.3.2 h1:FeUDcBX7VYY0e0iRmcVkPPUjYfAqIc//QuHXo8JHz9c= -github.com/cosmos/ibc-go/v7 v7.3.2/go.mod h1:IMeOXb7gwpZ+/nOG5BuUkdW4weM1ezvN4PQPws4uzOI= +github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= +github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= +github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= +github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= +github.com/cosmos/ibc-go/v8 v8.0.0 h1:QKipnr/NGwc+9L7NZipURvmSIu+nw9jOIWTJuDBqOhg= +github.com/cosmos/ibc-go/v8 v8.0.0/go.mod h1:C6IiJom0F3cIQCD5fKwVPDrDK9j/xTu563AWuOmXois= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= -github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= -github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= +github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= +github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= +github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= +github.com/creachadair/tomledit v0.0.24/go.mod h1:9qHbShRWQzSCcn617cMzg4eab1vbLCOjOshAWSzWr8U= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -490,8 +426,9 @@ github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -503,14 +440,14 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -519,25 +456,17 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -548,6 +477,7 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -556,49 +486,42 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= -github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -633,18 +556,16 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -664,7 +585,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= @@ -685,7 +605,6 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -695,12 +614,10 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -718,26 +635,22 @@ github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMd github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= @@ -746,26 +659,26 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0Q github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= -github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= +github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.2 h1:ErEYO2f//CjKsUDw4SmLzelsK6L3ZmOAR/4P9iS7ruY= +github.com/hashicorp/go-metrics v0.5.2/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= @@ -773,26 +686,27 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -801,8 +715,8 @@ github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0Jr github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= @@ -810,24 +724,9 @@ github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPt github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -837,7 +736,6 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -847,49 +745,30 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= -github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -898,27 +777,19 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -926,18 +797,9 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -951,11 +813,8 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -963,16 +822,12 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -980,28 +835,28 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1012,7 +867,6 @@ github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= @@ -1024,18 +878,14 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= -github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= +github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1046,10 +896,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -1065,18 +914,16 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= +github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1085,7 +932,6 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1093,14 +939,12 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5X github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1111,15 +955,14 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1131,12 +974,14 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= @@ -1145,25 +990,22 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= -github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1171,33 +1013,22 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= -github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= +github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= +github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -1209,17 +1040,8 @@ github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= -github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1245,55 +1067,47 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= +go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= +go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= +go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= +go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= -golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -1304,9 +1118,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= -golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1333,9 +1146,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1373,22 +1185,16 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1401,8 +1207,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1444,8 +1250,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1457,7 +1263,6 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1467,7 +1272,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1478,7 +1282,6 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1498,25 +1301,18 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1525,11 +1321,11 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1549,19 +1345,17 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1579,13 +1373,11 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1602,6 +1394,7 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1610,7 +1403,6 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1636,7 +1428,6 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1644,8 +1435,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1655,12 +1446,6 @@ golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNq golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1710,8 +1495,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY= -google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= +google.golang.org/api v0.162.0 h1:Vhs54HkaEpkMBdgGdOT2P6F0csGG/vxDS0hWHJzmmps= +google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1729,7 +1514,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1737,7 +1521,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= @@ -1763,10 +1546,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1833,12 +1614,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg= -google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1880,8 +1661,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1898,8 +1679,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1914,12 +1695,9 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1935,8 +1713,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1947,16 +1723,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/proto/nibiru/devgas/v1/genesis.proto b/proto/nibiru/devgas/v1/genesis.proto index ed28cb9bd..1d9919768 100644 --- a/proto/nibiru/devgas/v1/genesis.proto +++ b/proto/nibiru/devgas/v1/genesis.proto @@ -21,7 +21,7 @@ message ModuleParams { // developer_shares defines the proportion of the transaction fees to be // distributed to the registered contract owner string developer_shares = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // allowed_denoms defines the list of denoms that are allowed to be paid to diff --git a/proto/nibiru/genmsg/v1/genmsg.proto b/proto/nibiru/genmsg/v1/genmsg.proto index 54d02d2b9..d4a6e8468 100644 --- a/proto/nibiru/genmsg/v1/genmsg.proto +++ b/proto/nibiru/genmsg/v1/genmsg.proto @@ -5,7 +5,6 @@ import "google/protobuf/any.proto"; option go_package = "github.com/NibiruChain/nibiru/x/genmsg/v1"; -// GenesisState represents the messages to be processed during genesis by the genmsg module. -message GenesisState { - repeated google.protobuf.Any messages = 1; -} +// GenesisState represents the messages to be processed during genesis by the +// genmsg module. +message GenesisState { repeated google.protobuf.Any messages = 1; } diff --git a/proto/nibiru/inflation/v1/genesis.proto b/proto/nibiru/inflation/v1/genesis.proto index 773bfaef5..0f703cc58 100644 --- a/proto/nibiru/inflation/v1/genesis.proto +++ b/proto/nibiru/inflation/v1/genesis.proto @@ -26,7 +26,7 @@ message Params { // polynomial_factors takes in the variables to calculate polynomial // inflation repeated string polynomial_factors = 2[ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // inflation_distribution of the minted denom @@ -39,7 +39,7 @@ message Params { // periods_per_year is the number of periods that occur in a year uint64 periods_per_year = 5; - // max_period is the maximum number of periods that have inflation being + // max_period is the maximum number of periods that have inflation being // paid off. After this period, inflation will be disabled. uint64 max_period = 6; diff --git a/proto/nibiru/inflation/v1/inflation.proto b/proto/nibiru/inflation/v1/inflation.proto index cad921ede..101ea8d86 100644 --- a/proto/nibiru/inflation/v1/inflation.proto +++ b/proto/nibiru/inflation/v1/inflation.proto @@ -12,19 +12,19 @@ message InflationDistribution { // staking_rewards defines the proportion of the minted_denom that is // to be allocated as staking rewards string staking_rewards = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // community_pool defines the proportion of the minted_denom that is to // be allocated to the community pool string community_pool = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // strategic_reserves defines the proportion of the minted_denom that // is to be allocated to the strategic reserves module address string strategic_reserves = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/inflation/v1/query.proto b/proto/nibiru/inflation/v1/query.proto index e7b6ec57a..642607da4 100644 --- a/proto/nibiru/inflation/v1/query.proto +++ b/proto/nibiru/inflation/v1/query.proto @@ -104,7 +104,7 @@ message QueryInflationRateRequest {} message QueryInflationRateResponse { // inflation_rate by which the total supply increases within one period string inflation_rate = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/inflation/v1/tx.proto b/proto/nibiru/inflation/v1/tx.proto index da0a31b05..d5e5383ec 100644 --- a/proto/nibiru/inflation/v1/tx.proto +++ b/proto/nibiru/inflation/v1/tx.proto @@ -41,22 +41,22 @@ message MsgEditInflationParams { string sender = 1; bool inflation_enabled = 2; repeated string polynomial_factors = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true ]; InflationDistribution inflation_distribution = 4 [ (gogoproto.nullable) = true ]; string epochs_per_period = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = true ]; string periods_per_year = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = true ]; string max_period = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = true ]; } @@ -72,4 +72,4 @@ message MsgBurn { [ (gogoproto.moretags) = "yaml:\"coin\"", (gogoproto.nullable) = false ]; } -message MsgBurnResponse {} \ No newline at end of file +message MsgBurnResponse {} diff --git a/proto/nibiru/oracle/v1/event.proto b/proto/nibiru/oracle/v1/event.proto index 82284e9b1..858c1b613 100644 --- a/proto/nibiru/oracle/v1/event.proto +++ b/proto/nibiru/oracle/v1/event.proto @@ -12,7 +12,7 @@ option go_package = "github.com/NibiruChain/nibiru/x/oracle/types"; message EventPriceUpdate { string pair = 1; string price = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; int64 timestamp_ms = 3; @@ -54,8 +54,7 @@ message EventAggregatePrevote { string feeder = 2; } - -message EventValidatorPerformance{ +message EventValidatorPerformance { // Validator is the Bech32 address to which the vote will be credited. string validator = 1; @@ -67,11 +66,11 @@ message EventValidatorPerformance{ int64 reward_weight = 3; // Number of valid votes for which the validator will be rewarded - int64 win_count = 4; + int64 win_count = 4; // Number of abstained votes for which there will be no reward or punishment int64 abstain_count = 5; // Number of invalid/punishable votes - int64 miss_count = 6; -} \ No newline at end of file + int64 miss_count = 6; +} diff --git a/proto/nibiru/oracle/v1/oracle.proto b/proto/nibiru/oracle/v1/oracle.proto index 0e12baad2..f4364f997 100644 --- a/proto/nibiru/oracle/v1/oracle.proto +++ b/proto/nibiru/oracle/v1/oracle.proto @@ -19,7 +19,7 @@ message Params { // received for a ballot to pass. string vote_threshold = 2 [ (gogoproto.moretags) = "yaml:\"vote_threshold\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // RewardBand defines a maxium divergence that a price vote can have from the @@ -32,7 +32,7 @@ message Params { // deviation, the band is taken to be 1 standard deviation.a price string reward_band = 3 [ (gogoproto.moretags) = "yaml:\"reward_band\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The set of whitelisted markets, or asset pairs, for the module. @@ -46,7 +46,7 @@ message Params { // penalty for failing a voting period. string slash_fraction = 5 [ (gogoproto.moretags) = "yaml:\"slash_fraction\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // SlashWindow returns the number of voting periods that specify a @@ -56,7 +56,7 @@ message Params { uint64 slash_window = 6 [ (gogoproto.moretags) = "yaml:\"slash_window\"" ]; string min_valid_per_window = 7 [ (gogoproto.moretags) = "yaml:\"min_valid_per_window\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -76,7 +76,7 @@ message Params { // The validator fee ratio that is given to validators every epoch. string validator_fee_ratio = 10 [ (gogoproto.moretags) = "yaml:\"validator_fee_ratio\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -129,7 +129,7 @@ message ExchangeRateTuple { string exchange_rate = 2 [ (gogoproto.moretags) = "yaml:\"exchange_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -137,7 +137,7 @@ message ExchangeRateTuple { message DatedPrice { string exchange_rate = 1 [ (gogoproto.moretags) = "yaml:\"exchange_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; diff --git a/proto/nibiru/oracle/v1/query.proto b/proto/nibiru/oracle/v1/query.proto index 993640b40..fb5a6a632 100644 --- a/proto/nibiru/oracle/v1/query.proto +++ b/proto/nibiru/oracle/v1/query.proto @@ -105,7 +105,7 @@ message QueryExchangeRateRequest { message QueryExchangeRateResponse { // exchange_rate defines the exchange rate of assets voted by validators string exchange_rate = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/oracle/v1/state.proto b/proto/nibiru/oracle/v1/state.proto index 96d9bd959..0749328b6 100644 --- a/proto/nibiru/oracle/v1/state.proto +++ b/proto/nibiru/oracle/v1/state.proto @@ -18,10 +18,10 @@ message PriceSnapshot { ]; string price = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // milliseconds since unix epoch int64 timestamp_ms = 3; -} \ No newline at end of file +} diff --git a/proto/nibiru/oracle/v1/tx.proto b/proto/nibiru/oracle/v1/tx.proto index 299023008..8a1da08a8 100644 --- a/proto/nibiru/oracle/v1/tx.proto +++ b/proto/nibiru/oracle/v1/tx.proto @@ -97,19 +97,19 @@ message MsgEditOracleParams { string sender = 1; string vote_period = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = true ]; // vote_threshold: [cosmossdk.io/math.LegacyDec] TODO: string vote_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true ]; // reward_band: [cosmossdk.io/math.LegacyDec] TODO: string reward_band = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true ]; @@ -117,34 +117,34 @@ message MsgEditOracleParams { // slash_fraction: [cosmossdk.io/math.LegacyDec] TODO: string slash_fraction = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true ]; string slash_window = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = true ]; // min_valid_per_window: [cosmossdk.io/math.LegacyDec] TODO: string min_valid_per_window = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true ]; string twap_lookback_window = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = true ]; string min_voters = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = true ]; // VoteThreshold: [cosmossdk.io/math.LegacyDec] TODO: string validator_fee_ratio = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true ]; } diff --git a/proto/nibiru/perp/v2/event.proto b/proto/nibiru/perp/v2/event.proto index c3854dd85..3e1b3d915 100644 --- a/proto/nibiru/perp/v2/event.proto +++ b/proto/nibiru/perp/v2/event.proto @@ -17,7 +17,7 @@ message PositionChangedEvent { // Position notional (in quote units) after the change. In general, // 'notional = baseAmount * priceQuotePerBase', where size is the baseAmount. string position_notional = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -29,7 +29,7 @@ message PositionChangedEvent { // realize profits and losses after the change string realized_pnl = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -44,7 +44,7 @@ message PositionChangedEvent { (average price on major exchanges). */ string funding_payment = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -55,7 +55,7 @@ message PositionChangedEvent { // the position change. A positve value indicates that the trader received // funds, while a negative value indicates that the trader spent funds. string margin_to_user = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; @@ -75,7 +75,7 @@ message PositionChangedEvent { // increased, while a negative value indicates that the position size // decreased. string exchanged_size = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -84,7 +84,7 @@ message PositionChangedEvent { // notional increased, while a negative value indicates that the position // notional decreased. string exchanged_notional = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -142,19 +142,19 @@ message FundingRateChangedEvent { // The mark price of the pair. string mark_price_twap = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The oracle index price of the pair. string index_price_twap = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The latest premium fraction just calculated. string premium_fraction = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -163,7 +163,7 @@ message FundingRateChangedEvent { // value and the latest cumulative premium fraction on the position, // multiplied by the position size. string cumulative_premium_fraction = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -211,13 +211,13 @@ message AmmUpdatedEvent { // The mark price of the pair. string mark_price_twap = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The oracle index price of the pair. string index_price_twap = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -238,11 +238,11 @@ message MarketUpdatedEvent { // EventShiftPegMultiplier: ABCI event emitted from MsgShiftPegMultiplier message EventShiftPegMultiplier { string old_peg_multiplier = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string new_peg_multiplier = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; cosmos.base.v1beta1.Coin cost_paid = 3 [ (gogoproto.nullable) = false ]; @@ -251,11 +251,11 @@ message EventShiftPegMultiplier { // EventShiftSwapInvariant: ABCI event emitted from MsgShiftSwapInvariant message EventShiftSwapInvariant { string old_swap_invariant = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string new_swap_invariant = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; cosmos.base.v1beta1.Coin cost_paid = 3 [ (gogoproto.nullable) = false ]; diff --git a/proto/nibiru/perp/v2/genesis.proto b/proto/nibiru/perp/v2/genesis.proto index 6e66a77e8..d0e921cc0 100644 --- a/proto/nibiru/perp/v2/genesis.proto +++ b/proto/nibiru/perp/v2/genesis.proto @@ -28,7 +28,7 @@ message GenesisState { string trader = 1; uint64 epoch = 2; string volume = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } @@ -40,11 +40,11 @@ message GenesisState { message Discount { string fee = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string volume = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } @@ -63,14 +63,15 @@ message GenesisState { repeated GlobalVolume global_volumes = 13 [ (gogoproto.nullable) = false ]; - repeated DNRAllocation rebates_allocations = 12 [ (gogoproto.nullable) = false ]; + repeated DNRAllocation rebates_allocations = 12 + [ (gogoproto.nullable) = false ]; string dnr_epoch_name = 14; message GlobalVolume { uint64 epoch = 1; string volume = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/perp/v2/query.proto b/proto/nibiru/perp/v2/query.proto index 7d16b8f0f..70f9234b2 100644 --- a/proto/nibiru/perp/v2/query.proto +++ b/proto/nibiru/perp/v2/query.proto @@ -100,19 +100,19 @@ message QueryPositionResponse { // The position's current notional value, if it were to be entirely closed (in // margin units). string position_notional = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The position's unrealized PnL. string unrealized_pnl = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // margin ratio of the position based on the spot price string margin_ratio = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } diff --git a/proto/nibiru/perp/v2/state.proto b/proto/nibiru/perp/v2/state.proto index 50a2d4f4b..2d4d60abf 100644 --- a/proto/nibiru/perp/v2/state.proto +++ b/proto/nibiru/perp/v2/state.proto @@ -44,19 +44,20 @@ message Market { // whether or not the market is enabled bool enabled = 2; - // the version of the Market, only one market can exist per pair, when one is closed it cannot be reactivated, - // so a new market must be created, this is the version of the market + // the version of the Market, only one market can exist per pair, when one is + // closed it cannot be reactivated, so a new market must be created, this is + // the version of the market uint64 version = 14; // the minimum margin ratio which a user must maintain on this market string maintenance_margin_ratio = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // the maximum leverage a user is able to be taken on this market string max_leverage = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -65,20 +66,20 @@ message Market { // A premium fraction is the difference between mark and index, divided by the // number of payments per day. (mark - index) / # payments in a day string latest_cumulative_premium_fraction = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // the percentage of the notional given to the exchange when trading string exchange_fee_ratio = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // the percentage of the notional transferred to the ecosystem fund when // trading string ecosystem_fund_fee_ratio = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -86,14 +87,14 @@ message Market { // given to out as a reward. Half of the liquidation fee is given to the // liquidator, and the other half is given to the ecosystem fund. string liquidation_fee_ratio = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // the portion of the position size we try to liquidate if the available // margin is higher than liquidation fee string partial_liquidation_ratio = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -112,7 +113,7 @@ message Market { // amount of funding that can be paid out per epoch as a percentage of the // position size string max_funding_rate = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; @@ -140,49 +141,50 @@ message AMM { (gogoproto.nullable) = false ]; - // the version of the AMM, only one AMM can exist per pair, when one is closed it cannot be reactivated, - // so a new AMM must be created, this is the version of the AMM + // the version of the AMM, only one AMM can exist per pair, when one is closed + // it cannot be reactivated, so a new AMM must be created, this is the version + // of the AMM uint64 version = 8; // the amount of base reserves this AMM has string base_reserve = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // the amount of quote reserves this AMM has string quote_reserve = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // sqrt(k) string sqrt_depth = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // the price multiplier of the dynamic AMM string price_multiplier = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // Total long refers to the sum of long open notional in base. string total_long = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // Total short refers to the sum of short open notional in base. string total_short = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The settlement price if the AMM is settled. string settlement_price = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.stdduration) = true, (gogoproto.nullable) = false ]; @@ -201,26 +203,26 @@ message Position { // the position size string size = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // amount of margin remaining in the position string margin = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // value of position in quote assets when opened string open_notional = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The most recent cumulative premium fraction this position has. // Used to calculate the next funding payment. string latest_cumulative_premium_fraction = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; diff --git a/proto/nibiru/perp/v2/tx.proto b/proto/nibiru/perp/v2/tx.proto index 4a8e22893..9153d4f13 100644 --- a/proto/nibiru/perp/v2/tx.proto +++ b/proto/nibiru/perp/v2/tx.proto @@ -60,7 +60,6 @@ service Msg { rpc CloseMarket(MsgCloseMarket) returns (MsgCloseMarketResponse) {} } - // -------------------------- Settle Position -------------------------- /* MsgSettlePosition: Msg to remove margin. */ @@ -97,7 +96,7 @@ message MsgRemoveMarginResponse { // the funding payment applied on this position interaction string funding_payment = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -122,7 +121,7 @@ message MsgAddMargin { message MsgAddMarginResponse { string funding_payment = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -183,17 +182,17 @@ message MsgMarketOrder { nibiru.perp.v2.Direction side = 3; string quote_asset_amount = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; string leverage = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; string base_asset_amount_limit = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } @@ -203,48 +202,48 @@ message MsgMarketOrderResponse { // The amount of quote assets exchanged. string exchanged_notional_value = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of base assets exchanged. string exchanged_position_size = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The funding payment applied on this position change, measured in quote // units. string funding_payment = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of PnL realized on this position changed, measured in quote // units. string realized_pnl = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The unrealized PnL in the position after the position change, measured in // quote units. string unrealized_pnl_after = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of margin the trader has to give to the vault. // A negative value means the vault pays the trader. string margin_to_vault = 7 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The position's notional value after the position change, measured in quote // units. string position_notional = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -264,34 +263,34 @@ message MsgClosePosition { message MsgClosePositionResponse { // The amount of quote assets exchanged. string exchanged_notional_value = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of base assets exchanged. string exchanged_position_size = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The funding payment applied on this position change, measured in quote // units. string funding_payment = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of PnL realized on this position changed, measured in quote // units. string realized_pnl = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of margin the trader receives after closing the position, from // the vault. Should never be negative. string margin_to_trader = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -306,7 +305,7 @@ message MsgPartialClose { ]; string size = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -314,34 +313,34 @@ message MsgPartialClose { message MsgPartialCloseResponse { // The amount of quote assets exchanged. string exchanged_notional_value = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of base assets exchanged. string exchanged_position_size = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The funding payment applied on this position change, measured in quote // units. string funding_payment = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of PnL realized on this position changed, measured in quote // units. string realized_pnl = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // The amount of margin the trader receives after closing the position, from // the vault. Should never be negative. string margin_to_trader = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -414,7 +413,7 @@ message MsgShiftPegMultiplier { (gogoproto.nullable) = false ]; string new_peg_mult = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } @@ -433,7 +432,7 @@ message MsgShiftSwapInvariant { (gogoproto.nullable) = false ]; string new_swap_invariant = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; } @@ -447,7 +446,7 @@ message MsgShiftSwapInvariantResponse {} message MsgWithdrawFromPerpFund { string sender = 1; string amount = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; // Optional denom in case withdrawing assets aside from NUSD. diff --git a/proto/nibiru/spot/v1/pool.proto b/proto/nibiru/spot/v1/pool.proto index d0e67f52d..3b2053d49 100644 --- a/proto/nibiru/spot/v1/pool.proto +++ b/proto/nibiru/spot/v1/pool.proto @@ -11,13 +11,13 @@ option go_package = "github.com/NibiruChain/nibiru/x/spot/types"; // Configuration parameters for the pool. message PoolParams { string swap_fee = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.moretags) = "yaml:\"swap_fee\"", (gogoproto.nullable) = false ]; string exit_fee = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.moretags) = "yaml:\"exit_fee\"", (gogoproto.nullable) = false ]; @@ -28,7 +28,7 @@ message PoolParams { // together may be best with a higher value. This is only used if the // pool_type is set to 1 (stableswap) string A = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"amplification\"", (gogoproto.nullable) = false ]; @@ -54,7 +54,7 @@ message PoolAsset { [ (gogoproto.moretags) = "yaml:\"token\"", (gogoproto.nullable) = false ]; // Weight that is not normalized. This weight must be less than 2^50 string weight = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"weight\"", (gogoproto.nullable) = false ]; @@ -84,7 +84,7 @@ message Pool { // sum of all non-normalized pool weights string total_weight = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"total_weight\"", (gogoproto.nullable) = false ]; diff --git a/proto/nibiru/spot/v1/query.proto b/proto/nibiru/spot/v1/query.proto index 0bc6ad052..5c63cc8bb 100644 --- a/proto/nibiru/spot/v1/query.proto +++ b/proto/nibiru/spot/v1/query.proto @@ -238,7 +238,7 @@ message QueryJoinExactAmountInResponse { // amount of pool shares returned to user after join string pool_shares_out = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"pool_shares_out\"", (gogoproto.nullable) = false ]; @@ -258,7 +258,7 @@ message QueryExitExactAmountInRequest { uint64 pool_id = 1; // amount of pool shares to return to pool string pool_shares_in = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.moretags) = "yaml:\"pool_shares_in\"", (gogoproto.nullable) = false ]; diff --git a/simapp/sim_test.go b/simapp/sim_test.go index a1e1bc4ce..edcc258b2 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -9,23 +9,22 @@ import ( "strings" "testing" - dbm "github.com/cometbft/cometbft-db" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + evidencetypes "cosmossdk.io/x/evidence/types" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" - storetypes "github.com/cosmos/cosmos-sdk/store/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -33,6 +32,7 @@ import ( simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" "github.com/stretchr/testify/require" "github.com/NibiruChain/nibiru/app" diff --git a/simapp/state_test.go b/simapp/state_test.go index 948dbc68e..3d4d64734 100644 --- a/simapp/state_test.go +++ b/simapp/state_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/sims" - "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -89,7 +89,7 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty panic(err) } // compute not bonded balance - notBondedTokens := sdk.ZeroInt() + notBondedTokens := sdkmath.ZeroInt() for _, val := range stakingState.Validators { if val.Status != stakingtypes.Unbonded { continue @@ -151,11 +151,11 @@ func AppStateRandomizedFn( // number of bonded accounts var initialStake, numInitiallyBonded int64 appParams.GetOrGenerate( - cdc, sims.StakePerAccount, &initialStake, r, + sims.StakePerAccount, &initialStake, r, func(r *rand.Rand) { initialStake = r.Int63n(1e12) }, ) appParams.GetOrGenerate( - cdc, sims.InitiallyBondedValidators, &numInitiallyBonded, r, + sims.InitiallyBondedValidators, &numInitiallyBonded, r, func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(300)) }, ) @@ -178,7 +178,7 @@ func AppStateRandomizedFn( Rand: r, GenState: genesisState, Accounts: accs, - InitialStake: math.NewIntFromUint64(uint64(initialStake)), + InitialStake: sdkmath.NewIntFromUint64(uint64(initialStake)), NumBonded: numInitiallyBonded, GenTimestamp: genesisTimestamp, } diff --git a/x/common/address.go b/x/common/address.go index 67bf644d5..ddfa7e238 100644 --- a/x/common/address.go +++ b/x/common/address.go @@ -1,7 +1,6 @@ package common import ( - "github.com/NibiruChain/collections" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,12 +21,12 @@ func StringsToAddrs(strs ...string) []sdk.AccAddress { return addrs } -// TODO: (realu) Move to collections library -var StringValueEncoder collections.ValueEncoder[string] = stringValueEncoder{} - -type stringValueEncoder struct{} - -func (a stringValueEncoder) Encode(value string) []byte { return []byte(value) } -func (a stringValueEncoder) Decode(b []byte) string { return string(b) } -func (a stringValueEncoder) Stringify(value string) string { return value } -func (a stringValueEncoder) Name() string { return "string" } +//// TODO: (realu) Move to collections library +//var StringValueEncoder collections.ValueEncoder[string] = stringValueEncoder{} +// +//type stringValueEncoder struct{} +// +//func (a stringValueEncoder) Encode(value string) []byte { return []byte(value) } +//func (a stringValueEncoder) Decode(b []byte) string { return string(b) } +//func (a stringValueEncoder) Stringify(value string) string { return value } +//func (a stringValueEncoder) Name() string { return "string" } diff --git a/x/common/address_test.go b/x/common/address_test.go index 031a55918..53cabd11b 100644 --- a/x/common/address_test.go +++ b/x/common/address_test.go @@ -3,7 +3,6 @@ package common_test import ( "testing" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/NibiruChain/nibiru/x/common" @@ -19,24 +18,25 @@ func TestAddress(t *testing.T) { }) } -func TestStringValueEncoder(t *testing.T) { - encoder := common.StringValueEncoder - tests := []struct { - given string - }{ - {"hello"}, - {"12345"}, - {""}, - {testutil.AccAddress().String()}, - } - - for _, tc := range tests { - t.Run(tc.given, func(t *testing.T) { - want := tc.given - encoded := encoder.Encode(tc.given) - got := encoder.Decode(encoded) - assert.Equal(t, want, got) - assert.Equal(t, want, encoder.Stringify(got)) - }) - } -} +// +//func TestStringValueEncoder(t *testing.T) { +// encoder := common.StringValueEncoder +// tests := []struct { +// given string +// }{ +// {"hello"}, +// {"12345"}, +// {""}, +// {testutil.AccAddress().String()}, +// } +// +// for _, tc := range tests { +// t.Run(tc.given, func(t *testing.T) { +// want := tc.given +// encoded := encoder.Encode(tc.given) +// got := encoder.Decode(encoded) +// assert.Equal(t, want, got) +// assert.Equal(t, want, encoder.Stringify(got)) +// }) +// } +//} diff --git a/x/common/asset/pair.go b/x/common/asset/pair.go index 09377ae51..a74b00c25 100644 --- a/x/common/asset/pair.go +++ b/x/common/asset/pair.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" + "cosmossdk.io/collections/codec" sdkerrors "cosmossdk.io/errors" - "github.com/NibiruChain/collections" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -138,20 +138,80 @@ func (pair Pair) Size() int { return len(pair) } -var PairKeyEncoder collections.KeyEncoder[Pair] = pairKeyEncoder{} +var PairKeyEncoder codec.KeyCodec[Pair] = pairKeyEncoder{} type pairKeyEncoder struct{} -func (pairKeyEncoder) Stringify(a Pair) string { return a.String() } -func (pairKeyEncoder) Encode(a Pair) []byte { - return collections.StringKeyEncoder.Encode(a.String()) +func (e pairKeyEncoder) Encode(buffer []byte, key Pair) (int, error) { + //TODO implement me + panic("implement me") } -func (pairKeyEncoder) Decode(b []byte) (int, Pair) { - i, s := collections.StringKeyEncoder.Decode(b) - return i, MustNewPair(s) +func (e pairKeyEncoder) Decode(buffer []byte) (int, Pair, error) { + //TODO implement me + panic("implement me") } +func (e pairKeyEncoder) Size(key Pair) int { + //TODO implement me + panic("implement me") +} + +func (e pairKeyEncoder) EncodeJSON(value Pair) ([]byte, error) { + //TODO implement me + panic("implement me") +} + +func (e pairKeyEncoder) DecodeJSON(b []byte) (Pair, error) { + //TODO implement me + panic("implement me") +} + +func (e pairKeyEncoder) Stringify(key Pair) string { + //TODO implement me + panic("implement me") +} + +func (e pairKeyEncoder) KeyType() string { + //TODO implement me + panic("implement me") +} + +func (e pairKeyEncoder) EncodeNonTerminal(buffer []byte, key Pair) (int, error) { + //TODO implement me + panic("implement me") +} + +func (e pairKeyEncoder) DecodeNonTerminal(buffer []byte) (int, Pair, error) { + //TODO implement me + panic("implement me") +} + +func (e pairKeyEncoder) SizeNonTerminal(key Pair) int { + //TODO implement me + panic("implement me") +} + +// +//func (pairKeyEncoder) Stringify(a Pair) string { return a.String() } +//func (pairKeyEncoder) Encode(a Pair) []byte { +// stringCodec := codec.NewUntypedValueCodec(codec.KeyToValueCodec(codec.NewStringKeyCodec[string]())) +// bytes, err := stringCodec.Encode(a.String()) +// if err != nil { +// return nil +// } +// return bytes +//} +// +//func (pairKeyEncoder) Decode(b []byte) (int, Pair) { +// stringCodec := codec.NewStringKeyCodec[string]() +// i, s, err := stringCodec.Decode(b) +// if err != nil { +// panic(err) +// } +// return i, MustNewPair(s) +//} + // MustNewPairs constructs a new asset pair set. A panic will occur if one of // the provided pair names is invalid. func MustNewPairs(pairStrings ...string) (pairs []Pair) { diff --git a/x/common/codec.go b/x/common/codec.go new file mode 100644 index 000000000..8bb5f7bf4 --- /dev/null +++ b/x/common/codec.go @@ -0,0 +1,149 @@ +package common + +import ( + "cosmossdk.io/collections" + collcodec "cosmossdk.io/collections/codec" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + // LegacyDecValue represents a collections.ValueCodec to work with LegacyDec. + LegacyDecValue collcodec.ValueCodec[sdkmath.LegacyDec] = legacyDecValueCodec{} + SdkIntKey collcodec.KeyCodec[sdkmath.Int] = mathIntKeyCodec{} + AccAddressValue collcodec.ValueCodec[sdk.AccAddress] = accAddressValueCodec{} +) + +// Collection Codecs + +// math.LegacyDec Value Codec + +type legacyDecValueCodec struct{} + +func (cdc legacyDecValueCodec) Encode(value sdkmath.LegacyDec) ([]byte, error) { + return value.Marshal() +} + +func (cdc legacyDecValueCodec) Decode(buffer []byte) (sdkmath.LegacyDec, error) { + v := sdkmath.LegacyZeroDec() + err := v.Unmarshal(buffer) + return v, err +} + +func (cdc legacyDecValueCodec) EncodeJSON(value sdkmath.LegacyDec) ([]byte, error) { + return value.MarshalJSON() +} + +func (cdc legacyDecValueCodec) DecodeJSON(buffer []byte) (sdkmath.LegacyDec, error) { + v := sdkmath.LegacyDec{} + err := v.UnmarshalJSON(buffer) + if err != nil { + return sdkmath.LegacyDec{}, err + } + return v, nil +} + +func (cdc legacyDecValueCodec) Stringify(value sdkmath.LegacyDec) string { + return value.String() +} + +func (cdc legacyDecValueCodec) ValueType() string { + return "math.LegacyDec" +} + +// AccAddress Value Codec + +type accAddressValueCodec struct{} + +func (cdc accAddressValueCodec) Encode(value sdk.AccAddress) ([]byte, error) { + return value.Marshal() +} + +func (cdc accAddressValueCodec) Decode(buffer []byte) (sdk.AccAddress, error) { + v := sdk.AccAddress{} + err := v.Unmarshal(buffer) + return v, err +} + +func (cdc accAddressValueCodec) EncodeJSON(value sdk.AccAddress) ([]byte, error) { + return value.MarshalJSON() +} + +func (cdc accAddressValueCodec) DecodeJSON(buffer []byte) (sdk.AccAddress, error) { + v := sdk.AccAddress{} + err := v.UnmarshalJSON(buffer) + if err != nil { + return nil, err + } + return v, nil +} + +func (cdc accAddressValueCodec) Stringify(value sdk.AccAddress) string { + return value.String() +} + +func (cdc accAddressValueCodec) ValueType() string { + return "sdk.AccAddress" +} + +// math.Int Key Codec + +type mathIntKeyCodec struct { + stringDecoder func(string) (sdkmath.Int, error) + keyType string +} + +func (cdc mathIntKeyCodec) Encode(buffer []byte, key sdkmath.Int) (int, error) { + bytes, err := key.Marshal() + if err != nil { + return 0, err + } + copy(bytes, buffer) + return key.Size(), nil +} + +func (cdc mathIntKeyCodec) Decode(buffer []byte) (int, sdkmath.Int, error) { + v := sdkmath.ZeroInt() + err := v.Unmarshal(buffer) + if err != nil { + return 0, v, err + } + return v.Size(), v, nil +} + +func (cdc mathIntKeyCodec) Size(key sdkmath.Int) int { + return key.Size() +} + +func (cdc mathIntKeyCodec) EncodeJSON(value sdkmath.Int) ([]byte, error) { + return collections.StringKey.EncodeJSON(value.String()) +} + +func (cdc mathIntKeyCodec) DecodeJSON(b []byte) (v sdkmath.Int, err error) { + s, err := collections.StringKey.DecodeJSON(b) + if err != nil { + return + } + v, err = cdc.stringDecoder(s) + return +} + +func (cdc mathIntKeyCodec) Stringify(key sdkmath.Int) string { + return key.String() +} + +func (cdc mathIntKeyCodec) KeyType() string { + return cdc.keyType +} + +func (cdc mathIntKeyCodec) EncodeNonTerminal(buffer []byte, key sdkmath.Int) (int, error) { + return cdc.Encode(buffer, key) +} + +func (cdc mathIntKeyCodec) DecodeNonTerminal(buffer []byte) (int, sdkmath.Int, error) { + return cdc.Decode(buffer) +} + +func (cdc mathIntKeyCodec) SizeNonTerminal(key sdkmath.Int) int { + return key.Size() +} diff --git a/x/common/dec.go b/x/common/dec.go index 88ee73ee8..ebff542ce 100644 --- a/x/common/dec.go +++ b/x/common/dec.go @@ -1,11 +1,10 @@ package common import ( + "cosmossdk.io/math" "fmt" "math/big" "strings" - - sdk "github.com/cosmos/cosmos-sdk/types" ) const ( @@ -39,10 +38,10 @@ var ( // - NOTE, MustSqrtDec panics if it is called on a negative number, similar to the // sdk.NewCoin and SqrtBigInt functions. A panic safe version of MustSqrtDec // is available in the SqrtDec method. -func MustSqrtDec(dec sdk.Dec) sdk.Dec { +func MustSqrtDec(dec math.LegacyDec) math.LegacyDec { sqrtBigInt := MustSqrtBigInt(dec.BigInt()) - precision := sdk.NewDecFromBigInt(PRECISION_MULT) - return sdk.NewDecFromBigInt(sqrtBigInt).Quo(precision) + precision := math.LegacyNewDecFromBigInt(PRECISION_MULT) + return math.LegacyNewDecFromBigInt(sqrtBigInt).Quo(precision) } // SqrtDec computes the square root of the input decimal using its @@ -52,8 +51,8 @@ func MustSqrtDec(dec sdk.Dec) sdk.Dec { // The big.Int.Sqrt method is part of the standard library, // thoroughly tested, works at seemingly unbound precision (e.g. for numbers as // large as 10**99. -func SqrtDec(dec sdk.Dec) (sdk.Dec, error) { - var sqrtDec sdk.Dec +func SqrtDec(dec math.LegacyDec) (math.LegacyDec, error) { + var sqrtDec math.LegacyDec var panicErr error = TryCatch(func() { sqrtDec = MustSqrtDec(dec) })() @@ -179,7 +178,7 @@ func BankersRound(quo, rem, halfPrecision *big.Int) *big.Int { // Clamp return the value if it is within the clampValue, otherwise return the clampValue. // e.g. Clamp(1.5, 1) = 1, Clamp(-1.5, 1) = -1, Clamp(0.5, 1) = 0.5 -func Clamp(value sdk.Dec, clampValue sdk.Dec) sdk.Dec { +func Clamp(value math.LegacyDec, clampValue math.LegacyDec) math.LegacyDec { if value.GT(clampValue) { return clampValue } else if value.LT(clampValue.Neg()) { diff --git a/x/common/dec_test.go b/x/common/dec_test.go index a2a1d732e..93195a99a 100644 --- a/x/common/dec_test.go +++ b/x/common/dec_test.go @@ -1,12 +1,11 @@ package common_test import ( + "cosmossdk.io/math" "fmt" "math/big" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/assert" "github.com/NibiruChain/nibiru/x/common" @@ -43,22 +42,22 @@ func TestSqrtBigInt(t *testing.T) { func TestSqrtDec(t *testing.T) { testCases := []struct { - dec sdk.Dec - sqrtDec sdk.Dec + dec math.LegacyDec + sqrtDec math.LegacyDec }{ // -------------------------------------------------------------------- // Cases: 1 or higher - {dec: sdk.OneDec(), sqrtDec: sdk.OneDec()}, - {dec: sdk.NewDec(4), sqrtDec: sdk.NewDec(2)}, - {dec: sdk.NewDec(250_000), sqrtDec: sdk.NewDec(500)}, - {dec: sdk.NewDec(4_819_136_400), sqrtDec: sdk.NewDec(69_420)}, + {dec: math.LegacyOneDec(), sqrtDec: math.LegacyOneDec()}, + {dec: math.LegacyNewDec(4), sqrtDec: math.LegacyNewDec(2)}, + {dec: math.LegacyNewDec(250_000), sqrtDec: math.LegacyNewDec(500)}, + {dec: math.LegacyNewDec(4_819_136_400), sqrtDec: math.LegacyNewDec(69_420)}, // -------------------------------------------------------------------- // Cases: Between 0 and 1 - {dec: sdk.MustNewDecFromStr("0.81"), sqrtDec: sdk.MustNewDecFromStr("0.9")}, - {dec: sdk.MustNewDecFromStr("0.25"), sqrtDec: sdk.MustNewDecFromStr("0.5")}, + {dec: math.LegacyMustNewDecFromStr("0.81"), sqrtDec: math.LegacyMustNewDecFromStr("0.9")}, + {dec: math.LegacyMustNewDecFromStr("0.25"), sqrtDec: math.LegacyMustNewDecFromStr("0.5")}, // ↓ dec 1e-12, sqrtDec: 1e-6 - {dec: sdk.MustNewDecFromStr("0.000000000001"), sqrtDec: sdk.MustNewDecFromStr("0.000001")}, + {dec: math.LegacyMustNewDecFromStr("0.000000000001"), sqrtDec: math.LegacyMustNewDecFromStr("0.000001")}, // -------------------------------------------------------------------- // The math/big library panics if you call sqrt() on a negative number. @@ -66,7 +65,7 @@ func TestSqrtDec(t *testing.T) { t.Run("negative sqrt should panic", func(t *testing.T) { panicString := common.TryCatch(func() { - common.MustSqrtDec(sdk.NewDec(-9)) + common.MustSqrtDec(math.LegacyNewDec(-9)) })().Error() assert.Contains(t, panicString, "square root of negative number") @@ -132,27 +131,27 @@ func TestBankersRound(t *testing.T) { func TestClamp(t *testing.T) { tests := []struct { - value sdk.Dec - clampValue sdk.Dec - expected sdk.Dec + value math.LegacyDec + clampValue math.LegacyDec + expected math.LegacyDec description string }{ { - value: sdk.NewDec(15), - clampValue: sdk.NewDec(1), - expected: sdk.NewDec(1), + value: math.LegacyNewDec(15), + clampValue: math.LegacyNewDec(1), + expected: math.LegacyNewDec(1), description: "Clamping 15 to 1", }, { - value: sdk.NewDec(-15), - clampValue: sdk.NewDec(1), - expected: sdk.NewDec(-1), + value: math.LegacyNewDec(-15), + clampValue: math.LegacyNewDec(1), + expected: math.LegacyNewDec(-1), description: "Clamping -15 to 1", }, { - value: sdk.MustNewDecFromStr("0.5"), - clampValue: sdk.NewDec(1), - expected: sdk.MustNewDecFromStr("0.5"), + value: math.LegacyMustNewDecFromStr("0.5"), + clampValue: math.LegacyNewDec(1), + expected: math.LegacyMustNewDecFromStr("0.5"), description: "Clamping 0.5 to 1", }, } diff --git a/x/common/ewma/ewma.go b/x/common/ewma/ewma.go index efc1a9137..985e9a3fb 100644 --- a/x/common/ewma/ewma.go +++ b/x/common/ewma/ewma.go @@ -1,26 +1,28 @@ package ewma -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + sdkmath "cosmossdk.io/math" +) type MovingAverage interface { - Add(sdk.Dec) - Value() sdk.Dec - Set(sdk.Dec) + Add(sdkmath.LegacyDec) + Value() sdkmath.LegacyDec + Set(sdkmath.LegacyDec) } -func NewMovingAverage(span sdk.Dec) MovingAverage { +func NewMovingAverage(span sdkmath.LegacyDec) MovingAverage { return &variableEWMA{ - value: sdk.ZeroDec(), - decay: sdk.MustNewDecFromStr("2").Quo(span.Add(sdk.OneDec())), + value: sdkmath.LegacyZeroDec(), + decay: sdkmath.LegacyMustNewDecFromStr("2").Quo(span.Add(sdkmath.LegacyOneDec())), } } type variableEWMA struct { - decay sdk.Dec - value sdk.Dec + decay sdkmath.LegacyDec + value sdkmath.LegacyDec } -func (v *variableEWMA) Add(dec sdk.Dec) { +func (v *variableEWMA) Add(dec sdkmath.LegacyDec) { if v.value.IsZero() { v.value = dec @@ -28,13 +30,13 @@ func (v *variableEWMA) Add(dec sdk.Dec) { } // val = val * (1 - decay) + dec * decay - v.value = v.value.Mul(sdk.OneDec().Sub(v.decay)).Add(dec.Mul(v.decay)) + v.value = v.value.Mul(sdkmath.LegacyOneDec().Sub(v.decay)).Add(dec.Mul(v.decay)) } -func (v *variableEWMA) Value() sdk.Dec { +func (v *variableEWMA) Value() sdkmath.LegacyDec { return v.value } -func (v *variableEWMA) Set(dec sdk.Dec) { +func (v *variableEWMA) Set(dec sdkmath.LegacyDec) { v.value = dec } diff --git a/x/common/testutil/cli/network.go b/x/common/testutil/cli/network.go index b80d227eb..1fa8d6c82 100644 --- a/x/common/testutil/cli/network.go +++ b/x/common/testutil/cli/network.go @@ -3,6 +3,7 @@ package cli import ( "bufio" "context" + sdkmath "cosmossdk.io/math" "encoding/json" "errors" "fmt" @@ -14,11 +15,12 @@ import ( "sync" "time" - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/store/pruning/types" + "cosmossdk.io/log" + "cosmossdk.io/store/pruning/types" + sdknetwork "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/cosmos/cosmos-sdk/testutil/sims" - dbm "github.com/cometbft/cometbft-db" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" sdktestutil "github.com/cosmos/cosmos-sdk/testutil" @@ -239,7 +241,7 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { apiListenAddr = cfg.APIAddress } else { var err error - apiListenAddr, _, err = server.FreeTCPAddr() + apiListenAddr, _, _, err = sdknetwork.FreeTCPAddr() if err != nil { return nil, err } @@ -255,7 +257,7 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { if cfg.RPCAddress != "" { tmCfg.RPC.ListenAddress = cfg.RPCAddress } else { - rpcAddr, _, err := server.FreeTCPAddr() + rpcAddr, _, _, err := sdknetwork.FreeTCPAddr() if err != nil { return nil, err } @@ -265,7 +267,7 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { if cfg.GRPCAddress != "" { appCfg.GRPC.Address = cfg.GRPCAddress } else { - _, grpcPort, err := server.FreeTCPAddr() + _, grpcPort, _, err := sdknetwork.FreeTCPAddr() if err != nil { return nil, err } @@ -273,17 +275,18 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { } appCfg.GRPC.Enable = true - _, grpcWebPort, err := server.FreeTCPAddr() - if err != nil { - return nil, err - } - appCfg.GRPCWeb.Address = fmt.Sprintf("0.0.0.0:%s", grpcWebPort) + // TODO: fix + //_, grpcWebPort, _, err := sdknetwork.FreeTCPAddr() + //if err != nil { + // return nil, err + //} + //appCfg.GRPCWeb.Address = fmt.Sprintf("0.0.0.0:%s", grpcWebPort) appCfg.GRPCWeb.Enable = true } loggerNoOp := log.NewNopLogger() if cfg.EnableTMLogging { - loggerNoOp = log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + loggerNoOp = log.NewLogger(os.Stdout) } ctx.Logger = loggerNoOp @@ -307,13 +310,13 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { tmCfg.Moniker = nodeDirName monikers[i] = nodeDirName - proxyAddr, _, err := server.FreeTCPAddr() + proxyAddr, _, _, err := sdknetwork.FreeTCPAddr() if err != nil { return nil, err } tmCfg.ProxyApp = proxyAddr - p2pAddr, _, err := server.FreeTCPAddr() + p2pAddr, _, _, err := sdknetwork.FreeTCPAddr() if err != nil { return nil, err } @@ -374,18 +377,18 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: balances.Sort()}) genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) - commission, err := sdk.NewDecFromStr("0.05") + commission, err := sdkmath.LegacyNewDecFromStr("0.05") if err != nil { return nil, err } createValMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr), + addr.String(), valPubKeys[i], sdk.NewCoin(cfg.BondDenom, cfg.BondedTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(commission, sdkmath.LegacyOneDec(), sdkmath.LegacyOneDec()), + sdkmath.OneInt(), ) if err != nil { return nil, err @@ -397,7 +400,7 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { } memo := fmt.Sprintf("%s@%s:%s", nodeIDs[i], p2pURL.Hostname(), p2pURL.Port()) - fee := sdk.NewCoins(sdk.NewCoin(fmt.Sprintf("%stoken", nodeDirName), sdk.ZeroInt())) + fee := sdk.NewCoins(sdk.NewCoin(fmt.Sprintf("%stoken", nodeDirName), sdkmath.ZeroInt())) txBuilder := cfg.TxConfig.NewTxBuilder() err = txBuilder.SetMsgs(createValMsg) if err != nil { @@ -414,7 +417,18 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { WithKeybase(kb). WithTxConfig(cfg.TxConfig) - err = tx.Sign(txFactory, nodeDirName, txBuilder, true) + clientCtx := client.Context{}. + WithKeyringDir(clientDir). + WithKeyring(kb). + WithHomeDir(tmCfg.RootDir). + WithChainID(cfg.ChainID). + WithInterfaceRegistry(cfg.InterfaceRegistry). + WithCodec(cfg.Codec). + WithLegacyAmino(cfg.LegacyAmino). + WithTxConfig(cfg.TxConfig). + WithAccountRetriever(cfg.AccountRetriever) + + err = tx.Sign(clientCtx.CmdContext, txFactory, nodeDirName, txBuilder, true) if err != nil { return nil, err } @@ -430,17 +444,6 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { serverconfig.WriteConfigFile(filepath.Join(nodeDir, "config", "app.toml"), appCfg) - clientCtx := client.Context{}. - WithKeyringDir(clientDir). - WithKeyring(kb). - WithHomeDir(tmCfg.RootDir). - WithChainID(cfg.ChainID). - WithInterfaceRegistry(cfg.InterfaceRegistry). - WithCodec(cfg.Codec). - WithLegacyAmino(cfg.LegacyAmino). - WithTxConfig(cfg.TxConfig). - WithAccountRetriever(cfg.AccountRetriever) - network.Validators[i] = &Validator{ AppConfig: appCfg, ClientCtx: clientCtx, @@ -485,7 +488,9 @@ func New(logger Logger, baseDir string, cfg Config) (*Network, error) { // Ensure we cleanup incase any test was abruptly halted (e.g. SIGINT) as // any defer in a test would not be called. - server.TrapSignal(network.Cleanup) + + // TODO: fix + //server.TrapSignal(network.Cleanup) return network, err } diff --git a/x/common/testutil/cli/tx.go b/x/common/testutil/cli/tx.go index b7e43b036..f72ec1a64 100644 --- a/x/common/testutil/cli/tx.go +++ b/x/common/testutil/cli/tx.go @@ -2,6 +2,7 @@ package cli import ( "context" + sdkmath "cosmossdk.io/math" "fmt" "github.com/cometbft/cometbft/abci/types" @@ -60,7 +61,7 @@ type execTxOptions struct { } var DEFAULT_TX_OPTIONS = execTxOptions{ - Fees: sdk.NewCoins(sdk.NewCoin(denoms.NIBI, sdk.NewInt(1000))), + Fees: sdk.NewCoins(sdk.NewCoin(denoms.NIBI, sdkmath.NewInt(1000))), Gas: 2000000, SkipConfirmation: true, BroadcastMode: flags.BroadcastSync, @@ -140,7 +141,7 @@ func (chain *Network) BroadcastMsgs( return nil, err } - txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, sdk.NewInt(1000)))) + txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, sdkmath.NewInt(1000)))) txBuilder.SetGasLimit(uint64(1 * common.TO_MICRO)) acc, err := cfg.AccountRetriever.GetAccount(chain.Validators[0].ClientCtx, from) @@ -157,7 +158,7 @@ func (chain *Network) BroadcastMsgs( WithAccountNumber(acc.GetAccountNumber()). WithSequence(acc.GetSequence()) - err = tx.Sign(txFactory, info.Name, txBuilder, true) + err = tx.Sign(context.Background(), txFactory, info.Name, txBuilder, true) if err != nil { return nil, err } diff --git a/x/common/testutil/cli/util.go b/x/common/testutil/cli/util.go index 9e60c46ec..892faac9e 100644 --- a/x/common/testutil/cli/util.go +++ b/x/common/testutil/cli/util.go @@ -3,6 +3,7 @@ package cli import ( "encoding/json" "fmt" + cmtcfg "github.com/cometbft/cometbft/config" "os" "path/filepath" "testing" @@ -59,7 +60,7 @@ func startInProcess(cfg Config, val *Validator) error { nodeKey, proxy.NewLocalClientCreator(app), genDocProvider, - node.DefaultDBProvider, + cmtcfg.DefaultDBProvider, node.DefaultMetricsProvider(tmCfg.Instrumentation), logger.With("module", val.Moniker), ) diff --git a/x/common/testutil/client_ctx.go b/x/common/testutil/client_ctx.go index 76a88332c..8536b9685 100644 --- a/x/common/testutil/client_ctx.go +++ b/x/common/testutil/client_ctx.go @@ -6,7 +6,7 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/types/module" @@ -21,7 +21,7 @@ import ( func SetupClientCtx(t *testing.T) context.Context { home := t.TempDir() logger := log.NewNopLogger() - cfg, err := genutiltest.CreateDefaultTendermintConfig(home) + cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) appCodec := moduletestutil.MakeTestEncodingConfig().Codec diff --git a/x/common/testutil/mock/dex_pool.go b/x/common/testutil/mock/dex_pool.go index 4b8deaf6d..35fe320b9 100644 --- a/x/common/testutil/mock/dex_pool.go +++ b/x/common/testutil/mock/dex_pool.go @@ -1,6 +1,7 @@ package mock import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/spot/types" @@ -12,20 +13,20 @@ func SpotPool(poolId uint64, assets sdk.Coins, shares int64) types.Pool { for i, asset := range assets { poolAssets[i] = types.PoolAsset{ Token: asset, - Weight: sdk.OneInt(), + Weight: sdkmath.OneInt(), } } return types.Pool{ Id: poolId, PoolParams: types.PoolParams{ - SwapFee: sdk.SmallestDec(), - ExitFee: sdk.SmallestDec(), + SwapFee: sdkmath.LegacySmallestDec(), + ExitFee: sdkmath.LegacySmallestDec(), PoolType: types.PoolType_BALANCER, - A: sdk.ZeroInt(), + A: sdkmath.ZeroInt(), }, PoolAssets: poolAssets, TotalShares: sdk.NewInt64Coin(types.GetPoolShareBaseDenom(poolId), shares), - TotalWeight: sdk.NewInt(2), + TotalWeight: sdkmath.NewInt(2), } } @@ -35,19 +36,19 @@ func SpotStablePool(poolId uint64, assets sdk.Coins, shares int64) types.Pool { for i, asset := range assets { poolAssets[i] = types.PoolAsset{ Token: asset, - Weight: sdk.OneInt(), + Weight: sdkmath.OneInt(), } } return types.Pool{ Id: poolId, PoolParams: types.PoolParams{ - SwapFee: sdk.ZeroDec(), - ExitFee: sdk.ZeroDec(), + SwapFee: sdkmath.LegacyZeroDec(), + ExitFee: sdkmath.LegacyZeroDec(), PoolType: types.PoolType_STABLESWAP, - A: sdk.NewInt(100), + A: sdkmath.NewInt(100), }, PoolAssets: poolAssets, TotalShares: sdk.NewInt64Coin(types.GetPoolShareBaseDenom(poolId), shares), - TotalWeight: sdk.NewInt(2), + TotalWeight: sdkmath.NewInt(2), } } diff --git a/x/common/testutil/mock/perp_amm.go b/x/common/testutil/mock/perp_amm.go index 2996e6503..4170b3b8c 100644 --- a/x/common/testutil/mock/perp_amm.go +++ b/x/common/testutil/mock/perp_amm.go @@ -1,8 +1,7 @@ package mock import ( - sdk "github.com/cosmos/cosmos-sdk/types" - + sdkmath "cosmossdk.io/math" asset "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/perp/v2/types" @@ -13,25 +12,25 @@ func TestAMMDefault() *types.AMM { return &types.AMM{ Pair: asset.NewPair(denoms.BTC, denoms.NUSD), Version: 1, - BaseReserve: sdk.NewDec(1e12), - QuoteReserve: sdk.NewDec(1e12), - SqrtDepth: sdk.NewDec(1e12), - PriceMultiplier: sdk.OneDec(), - TotalLong: sdk.ZeroDec(), - TotalShort: sdk.ZeroDec(), - SettlementPrice: sdk.ZeroDec(), + BaseReserve: sdkmath.LegacyNewDec(1e12), + QuoteReserve: sdkmath.LegacyNewDec(1e12), + SqrtDepth: sdkmath.LegacyNewDec(1e12), + PriceMultiplier: sdkmath.LegacyOneDec(), + TotalLong: sdkmath.LegacyZeroDec(), + TotalShort: sdkmath.LegacyZeroDec(), + SettlementPrice: sdkmath.LegacyZeroDec(), } } // default market with sensible values for tests -func TestAMM(sqrtK sdk.Dec, priceMultiplier sdk.Dec) *types.AMM { +func TestAMM(sqrtK sdkmath.LegacyDec, priceMultiplier sdkmath.LegacyDec) *types.AMM { return &types.AMM{ Pair: asset.NewPair(denoms.BTC, denoms.NUSD), BaseReserve: sqrtK, QuoteReserve: sqrtK, SqrtDepth: sqrtK, PriceMultiplier: priceMultiplier, - TotalLong: sdk.ZeroDec(), - TotalShort: sdk.ZeroDec(), + TotalLong: sdkmath.LegacyZeroDec(), + TotalShort: sdkmath.LegacyZeroDec(), } } diff --git a/x/common/testutil/mock/perp_market.go b/x/common/testutil/mock/perp_market.go index 96a1c4167..03e400cf0 100644 --- a/x/common/testutil/mock/perp_market.go +++ b/x/common/testutil/mock/perp_market.go @@ -1,6 +1,7 @@ package mock import ( + sdkmath "cosmossdk.io/math" time "time" sdk "github.com/cosmos/cosmos-sdk/types" @@ -16,15 +17,15 @@ func TestMarket() *types.Market { Pair: asset.NewPair(denoms.BTC, denoms.NUSD), Enabled: true, Version: 1, - MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.0625"), - MaxLeverage: sdk.MustNewDecFromStr("10"), - LatestCumulativePremiumFraction: sdk.ZeroDec(), - ExchangeFeeRatio: sdk.MustNewDecFromStr("0.0010"), - EcosystemFundFeeRatio: sdk.MustNewDecFromStr("0.0010"), - LiquidationFeeRatio: sdk.MustNewDecFromStr("0.0005"), - PartialLiquidationRatio: sdk.MustNewDecFromStr("0.5"), + MaintenanceMarginRatio: sdkmath.LegacyMustNewDecFromStr("0.0625"), + MaxLeverage: sdkmath.LegacyMustNewDecFromStr("10"), + LatestCumulativePremiumFraction: sdkmath.LegacyZeroDec(), + ExchangeFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0010"), + EcosystemFundFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0010"), + LiquidationFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0005"), + PartialLiquidationRatio: sdkmath.LegacyMustNewDecFromStr("0.5"), FundingRateEpochId: "30 min", - MaxFundingRate: sdk.NewDec(1), + MaxFundingRate: sdkmath.LegacyNewDec(1), TwapLookbackWindow: time.Minute * 30, PrepaidBadDebt: sdk.NewInt64Coin(denoms.NUSD, 0), OraclePair: asset.NewPair(denoms.BTC, denoms.USD), diff --git a/x/common/testutil/sample.go b/x/common/testutil/sample.go index fc23896f8..2c100dbf5 100644 --- a/x/common/testutil/sample.go +++ b/x/common/testutil/sample.go @@ -1,19 +1,20 @@ package testutil import ( + storemetrics "cosmossdk.io/store/metrics" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "math/rand" - "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/store" + "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "cosmossdk.io/log" + dbm "github.com/cosmos/cosmos-db" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -53,9 +54,9 @@ func PrivKeyAddressPairs(n int) (keys []cryptotypes.PrivKey, addrs []sdk.AccAddr } func BlankContext(storeKeyName string) sdk.Context { - storeKey := sdk.NewKVStoreKey(storeKeyName) - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) + storeKey := types.NewKVStoreKey(storeKeyName) + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), storemetrics.NewNoOpMetrics()) stateStore.MountStoreWithDB(storeKey, types.StoreTypeIAVL, db) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) return ctx diff --git a/x/common/testutil/testapp/testapp.go b/x/common/testutil/testapp/testapp.go index 3d5f1f989..893e0e32f 100644 --- a/x/common/testutil/testapp/testapp.go +++ b/x/common/testutil/testapp/testapp.go @@ -4,9 +4,9 @@ import ( "encoding/json" "time" + "cosmossdk.io/log" tmdb "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/testutil/sims" diff --git a/x/devgas/v1/ante/ante.go b/x/devgas/v1/ante/ante.go index 1583138bd..f23ca887d 100644 --- a/x/devgas/v1/ante/ante.go +++ b/x/devgas/v1/ante/ante.go @@ -1,6 +1,7 @@ package ante import ( + "cosmossdk.io/math" "encoding/json" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -168,7 +169,7 @@ func (a DevGasPayoutDecorator) getWithdrawAddressesFromMsgs(ctx sdk.Context, msg // FeePayLogic takes the total fees and splits them based on the governance // params and the number of contracts we are executing on. This returns the // amount of fees each contract developer should get. tested in ante_test.go -func FeePayLogic(fees sdk.Coins, govPercent sdk.Dec, numPairs int) sdk.Coins { +func FeePayLogic(fees sdk.Coins, govPercent math.LegacyDec, numPairs int) sdk.Coins { var splitFees sdk.Coins for _, c := range fees.Sort() { rewardAmount := govPercent.MulInt(c.Amount).QuoInt64(int64(numPairs)).RoundInt() diff --git a/x/devgas/v1/ante/ante_test.go b/x/devgas/v1/ante/ante_test.go index 6e4a0d332..e2e91fa36 100644 --- a/x/devgas/v1/ante/ante_test.go +++ b/x/devgas/v1/ante/ante_test.go @@ -1,6 +1,7 @@ package ante_test import ( + "cosmossdk.io/math" "fmt" "strings" "testing" @@ -31,84 +32,84 @@ func TestAnteSuite(t *testing.T) { func (suite *AnteTestSuite) TestFeeLogic() { // We expect all to pass - feeCoins := sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(500)), sdk.NewCoin("utoken", sdk.NewInt(250))) + feeCoins := sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(500)), sdk.NewCoin("utoken", math.NewInt(250))) testCases := []struct { name string incomingFee sdk.Coins - govPercent sdk.Dec + govPercent math.LegacyDec numContracts int expectedFeePayment sdk.Coins }{ { "100% fee / 1 contract", feeCoins, - sdk.NewDecWithPrec(100, 2), + math.LegacyNewDecWithPrec(100, 2), 1, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(500)), sdk.NewCoin("utoken", sdk.NewInt(250))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(500)), sdk.NewCoin("utoken", math.NewInt(250))), }, { "100% fee / 2 contracts", feeCoins, - sdk.NewDecWithPrec(100, 2), + math.LegacyNewDecWithPrec(100, 2), 2, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(250)), sdk.NewCoin("utoken", sdk.NewInt(125))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(250)), sdk.NewCoin("utoken", math.NewInt(125))), }, { "100% fee / 10 contracts", feeCoins, - sdk.NewDecWithPrec(100, 2), + math.LegacyNewDecWithPrec(100, 2), 10, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(50)), sdk.NewCoin("utoken", sdk.NewInt(25))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(50)), sdk.NewCoin("utoken", math.NewInt(25))), }, { "67% fee / 7 contracts", feeCoins, - sdk.NewDecWithPrec(67, 2), + math.LegacyNewDecWithPrec(67, 2), 7, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(48)), sdk.NewCoin("utoken", sdk.NewInt(24))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(48)), sdk.NewCoin("utoken", math.NewInt(24))), }, { "50% fee / 1 contracts", feeCoins, - sdk.NewDecWithPrec(50, 2), + math.LegacyNewDecWithPrec(50, 2), 1, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(250)), sdk.NewCoin("utoken", sdk.NewInt(125))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(250)), sdk.NewCoin("utoken", math.NewInt(125))), }, { "50% fee / 2 contracts", feeCoins, - sdk.NewDecWithPrec(50, 2), + math.LegacyNewDecWithPrec(50, 2), 2, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(125)), sdk.NewCoin("utoken", sdk.NewInt(62))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(125)), sdk.NewCoin("utoken", math.NewInt(62))), }, { "50% fee / 3 contracts", feeCoins, - sdk.NewDecWithPrec(50, 2), + math.LegacyNewDecWithPrec(50, 2), 3, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(83)), sdk.NewCoin("utoken", sdk.NewInt(42))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(83)), sdk.NewCoin("utoken", math.NewInt(42))), }, { "25% fee / 2 contracts", feeCoins, - sdk.NewDecWithPrec(25, 2), + math.LegacyNewDecWithPrec(25, 2), 2, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(62)), sdk.NewCoin("utoken", sdk.NewInt(31))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(62)), sdk.NewCoin("utoken", math.NewInt(31))), }, { "15% fee / 3 contracts", feeCoins, - sdk.NewDecWithPrec(15, 2), + math.LegacyNewDecWithPrec(15, 2), 3, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(25)), sdk.NewCoin("utoken", sdk.NewInt(12))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(25)), sdk.NewCoin("utoken", math.NewInt(12))), }, { "1% fee / 2 contracts", feeCoins, - sdk.NewDecWithPrec(1, 2), + math.LegacyNewDecWithPrec(1, 2), 2, - sdk.NewCoins(sdk.NewCoin("unibi", sdk.NewInt(2)), sdk.NewCoin("utoken", sdk.NewInt(1))), + sdk.NewCoins(sdk.NewCoin("unibi", math.NewInt(2)), sdk.NewCoin("utoken", math.NewInt(1))), }, } @@ -127,8 +128,8 @@ func (suite *AnteTestSuite) TestFeeLogic() { func (suite *AnteTestSuite) TestDevGasPayout() { txGasCoins := sdk.NewCoins( - sdk.NewCoin("unibi", sdk.NewInt(1_000)), - sdk.NewCoin("utoken", sdk.NewInt(500)), + sdk.NewCoin("unibi", math.NewInt(1_000)), + sdk.NewCoin("utoken", math.NewInt(500)), ) _, addrs := testutil.PrivKeyAddressPairs(11) @@ -167,7 +168,7 @@ func (suite *AnteTestSuite) TestDevGasPayout() { // The expected royalty is gas / num_withdrawers / 2. Thus, We // divide gas by (num_withdrawers * 2). The 2 comes from 50% split. // wantWithdrawerRoyalties: num_withdrawers * 2 = 2 - wantWithdrawerRoyalties: txGasCoins.QuoInt(sdk.NewInt(2)), + wantWithdrawerRoyalties: txGasCoins.QuoInt(math.NewInt(2)), wantErr: false, setup: func() (*app.NibiruApp, sdk.Context) { bapp, ctx := testapp.NewNibiruTestAppAndContext() @@ -188,7 +189,7 @@ func (suite *AnteTestSuite) TestDevGasPayout() { // The expected royalty is gas / num_withdrawers / 2. Thus, We // divide gas by (num_withdrawers * 2). The 2 comes from 50% split. // wantWithdrawerRoyalties: num_withdrawers * 2 = 4 - wantWithdrawerRoyalties: txGasCoins.QuoInt(sdk.NewInt(4)), + wantWithdrawerRoyalties: txGasCoins.QuoInt(math.NewInt(4)), wantErr: false, setup: func() (*app.NibiruApp, sdk.Context) { bapp, ctx := testapp.NewNibiruTestAppAndContext() @@ -206,7 +207,7 @@ func (suite *AnteTestSuite) TestDevGasPayout() { // The expected royalty is gas / num_withdrawers / 2. Thus, We // divide gas by (num_withdrawers * 2). The 2 comes from 50% split. // wantWithdrawerRoyalties: num_withdrawers * 2 = 2 - wantWithdrawerRoyalties: txGasCoins.QuoInt(sdk.NewInt(2)), + wantWithdrawerRoyalties: txGasCoins.QuoInt(math.NewInt(2)), wantErr: true, setup: func() (*app.NibiruApp, sdk.Context) { bapp, ctx := testapp.NewNibiruTestAppAndContext() @@ -219,7 +220,7 @@ func (suite *AnteTestSuite) TestDevGasPayout() { // The expected royalty is gas / num_withdrawers / 2. Thus, We // divide gas by (num_withdrawers * 2). The 2 comes from 50% split. // wantWithdrawerRoyalties: num_withdrawers * 2 = 2 - wantWithdrawerRoyalties: txGasCoins.QuoInt(sdk.NewInt(2)), + wantWithdrawerRoyalties: txGasCoins.QuoInt(math.NewInt(2)), wantErr: false, setup: func() (*app.NibiruApp, sdk.Context) { bapp, ctx := testapp.NewNibiruTestAppAndContext() diff --git a/x/devgas/v1/ante/expected_keepers.go b/x/devgas/v1/ante/expected_keepers.go index eefe11c35..6d511d741 100644 --- a/x/devgas/v1/ante/expected_keepers.go +++ b/x/devgas/v1/ante/expected_keepers.go @@ -3,6 +3,7 @@ package ante // Interfaces needed for the for the Nibiru Chain ante handler import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" devgastypes "github.com/NibiruChain/nibiru/x/devgas/v1/types" @@ -10,11 +11,11 @@ import ( type BankKeeper interface { SendCoinsFromAccountToModule( - ctx sdk.Context, senderAddr sdk.AccAddress, + ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, ) error SendCoinsFromModuleToAccount( - ctx sdk.Context, senderModule string, + ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, ) error } diff --git a/x/devgas/v1/genesis.go b/x/devgas/v1/genesis.go index f0e877ec2..35f2104c8 100644 --- a/x/devgas/v1/genesis.go +++ b/x/devgas/v1/genesis.go @@ -3,7 +3,7 @@ package devgas import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/devgas/v1/keeper" "github.com/NibiruChain/nibiru/x/devgas/v1/types" @@ -29,8 +29,16 @@ func InitGenesis( // ExportGenesis export module state func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + iter, err := k.DevGasStore.Iterate(ctx, &collections.Range[string]{}) + if err != nil { + return nil + } + values, err := iter.Values() + if err != nil { + return nil + } return &types.GenesisState{ Params: k.GetParams(ctx), - FeeShare: k.DevGasStore.Iterate(ctx, collections.Range[string]{}).Values(), + FeeShare: values, } } diff --git a/x/devgas/v1/keeper/feeshare.go b/x/devgas/v1/keeper/feeshare.go index cd1493469..56455fed2 100644 --- a/x/devgas/v1/keeper/feeshare.go +++ b/x/devgas/v1/keeper/feeshare.go @@ -23,7 +23,7 @@ func (k Keeper) GetFeeShare( // over every registered Indexer and instructs them to create the relationship // between the primary key PK and the object v. func (k Keeper) SetFeeShare(ctx sdk.Context, feeshare types.FeeShare) { - k.DevGasStore.Insert(ctx, feeshare.ContractAddress, feeshare) + k.DevGasStore.Set(ctx, feeshare.ContractAddress, feeshare) } // IsFeeShareRegistered checks if a contract was registered for receiving diff --git a/x/devgas/v1/keeper/grpc_query.go b/x/devgas/v1/keeper/grpc_query.go index ae7a5a6c9..aecfed07a 100644 --- a/x/devgas/v1/keeper/grpc_query.go +++ b/x/devgas/v1/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "cosmossdk.io/collections" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -35,9 +36,10 @@ func (q Querier) FeeShares( return nil, status.Error(codes.InvalidArgument, "empty request") } ctx := sdk.UnwrapSDKContext(goCtx) - iter := q.DevGasStore.Indexes.Deployer.ExactMatch(ctx, req.Deployer) + iter, _ := q.DevGasStore.Indexes.Deployer.MatchExact(ctx, req.Deployer) + return &types.QueryFeeSharesResponse{ - Feeshare: q.DevGasStore.Collect(ctx, iter), + Feeshare: getFeeShares(ctx, iter, q.DevGasStore), }, nil } @@ -93,8 +95,26 @@ func (q Querier) FeeSharesByWithdrawer( // nolint: dupl return nil, status.Error(codes.InvalidArgument, "empty request") } ctx := sdk.UnwrapSDKContext(goCtx) - iter := q.DevGasStore.Indexes.Withdrawer.ExactMatch(ctx, req.WithdrawerAddress) + iter, _ := q.DevGasStore.Indexes.Withdrawer.MatchExact(ctx, req.WithdrawerAddress) return &types.QueryFeeSharesByWithdrawerResponse{ - Feeshare: q.DevGasStore.Collect(ctx, iter), + Feeshare: getFeeShares(ctx, iter, q.DevGasStore), }, nil } + +// getFeeShares replacement of nibiru collections Collect() +func getFeeShares( + ctx sdk.Context, + iter interface{ PrimaryKeys() ([]string, error) }, + coll collections.IndexedMap[string, types.FeeShare, DevGasIndexes], +) []types.FeeShare { + contracts, _ := iter.PrimaryKeys() + shares := make([]types.FeeShare, len(contracts)) + for index, contract := range contracts { + v, err := coll.Get(ctx, contract) + if err != nil { + panic(err) + } + shares[index] = v + } + return shares +} diff --git a/x/devgas/v1/keeper/keeper.go b/x/devgas/v1/keeper/keeper.go index 97081ccd2..2ed3b5f1b 100644 --- a/x/devgas/v1/keeper/keeper.go +++ b/x/devgas/v1/keeper/keeper.go @@ -1,17 +1,16 @@ package keeper import ( + "cosmossdk.io/log" "fmt" - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cometbft/cometbft/libs/log" - + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" devgastypes "github.com/NibiruChain/nibiru/x/devgas/v1/types" ) @@ -50,7 +49,7 @@ type Keeper struct { // NewKeeper creates new instances of the fees Keeper func NewKeeper( - storeKey storetypes.StoreKey, + storeKey *storetypes.KVStoreKey, cdc codec.BinaryCodec, bk devgastypes.BankKeeper, wk wasmkeeper.Keeper, @@ -58,6 +57,9 @@ func NewKeeper( feeCollector string, authority string, ) Keeper { + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) + return Keeper{ storeKey: storeKey, cdc: cdc, @@ -68,8 +70,10 @@ func NewKeeper( authority: authority, DevGasStore: NewDevGasStore(storeKey, cdc), ModuleParams: collections.NewItem( - storeKey, devgastypes.KeyPrefixParams, - collections.ProtoValueEncoder[devgastypes.ModuleParams](cdc), + sb, + collections.NewPrefix(int(devgastypes.KeyPrefixParams)), + storeKey.String(), + codec.CollValue[devgastypes.ModuleParams](cdc), ), } } diff --git a/x/devgas/v1/keeper/keeper_test.go b/x/devgas/v1/keeper/keeper_test.go index 9be7553eb..8c68c6ae7 100644 --- a/x/devgas/v1/keeper/keeper_test.go +++ b/x/devgas/v1/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "context" "testing" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" @@ -20,9 +21,9 @@ import ( type BankKeeper interface { MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error } type KeeperTestSuite struct { diff --git a/x/devgas/v1/keeper/msg_server.go b/x/devgas/v1/keeper/msg_server.go index 0976557e4..58288140d 100644 --- a/x/devgas/v1/keeper/msg_server.go +++ b/x/devgas/v1/keeper/msg_server.go @@ -281,7 +281,7 @@ func (k Keeper) CancelFeeShare( return nil, err } - err = k.DevGasStore.Delete(ctx, fee.GetContractAddress()) + err = k.DevGasStore.Remove(ctx, fee.GetContractAddress()) if err != nil { return nil, err } diff --git a/x/devgas/v1/keeper/store.go b/x/devgas/v1/keeper/store.go index 93a2ff2db..2d3e6d572 100644 --- a/x/devgas/v1/keeper/store.go +++ b/x/devgas/v1/keeper/store.go @@ -1,9 +1,12 @@ package keeper import ( - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" + collindexes "cosmossdk.io/collections/indexes" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" sdkcodec "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/runtime" devgastypes "github.com/NibiruChain/nibiru/x/devgas/v1/types" ) @@ -13,45 +16,56 @@ type DevGasIndexes struct { // - indexing key (IK): deployer address // - primary key (PK): contract address // - value (V): Dev gas struct - Deployer collections.MultiIndex[string, string, devgastypes.FeeShare] + Deployer collindexes.Multi[string, string, devgastypes.FeeShare] // Withdrawer MultiIndex: // - indexing key (IK): withdrawer address // - primary key (PK): contract address // - value (V): Dev gas struct - Withdrawer collections.MultiIndex[string, string, devgastypes.FeeShare] + Withdrawer collindexes.Multi[string, string, devgastypes.FeeShare] } -func (idxs DevGasIndexes) IndexerList() []collections.Indexer[string, devgastypes.FeeShare] { - return []collections.Indexer[string, devgastypes.FeeShare]{ - idxs.Deployer, idxs.Withdrawer, +func (idxs DevGasIndexes) IndexesList() []collections.Index[string, devgastypes.FeeShare] { + return []collections.Index[string, devgastypes.FeeShare]{ + &idxs.Deployer, &idxs.Withdrawer, } } func NewDevGasStore( - storeKey storetypes.StoreKey, cdc sdkcodec.BinaryCodec, + storeKey *storetypes.KVStoreKey, cdc sdkcodec.BinaryCodec, ) collections.IndexedMap[string, devgastypes.FeeShare, DevGasIndexes] { - primaryKeyEncoder := collections.StringKeyEncoder - valueEncoder := collections.ProtoValueEncoder[devgastypes.FeeShare](cdc) + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) - var namespace collections.Namespace = devgastypes.KeyPrefixFeeShare - var namespaceDeployerIdx collections.Namespace = devgastypes.KeyPrefixDeployer - var namespaceWithdrawerIdx collections.Namespace = devgastypes.KeyPrefixWithdrawer + primaryKeyEncoder := collections.StringKey + valueEncoder := codec.CollValue[devgastypes.FeeShare](cdc) - return collections.NewIndexedMap[string, devgastypes.FeeShare]( - storeKey, namespace, primaryKeyEncoder, valueEncoder, + var namespace = devgastypes.KeyPrefixFeeShare + var namespaceDeployerIdx = devgastypes.KeyPrefixDeployer + var namespaceWithdrawerIdx = devgastypes.KeyPrefixWithdrawer + + return *collections.NewIndexedMap[string, devgastypes.FeeShare]( + sb, + collections.NewPrefix(int(namespace)), + storeKey.String(), + primaryKeyEncoder, + valueEncoder, DevGasIndexes{ - Deployer: collections.NewMultiIndex[string, string, devgastypes.FeeShare]( - storeKey, namespaceDeployerIdx, - collections.StringKeyEncoder, // index key (IK) - collections.StringKeyEncoder, // primary key (PK) - func(v devgastypes.FeeShare) string { return v.DeployerAddress }, + Deployer: *collindexes.NewMulti[string, string, devgastypes.FeeShare]( + sb, + collections.NewPrefix(int(namespaceDeployerIdx)), + storeKey.String(), + collections.StringKey, // index key (IK) + collections.StringKey, // primary key (PK) + func(pk string, v devgastypes.FeeShare) (string, error) { return v.DeployerAddress, nil }, ), - Withdrawer: collections.NewMultiIndex[string, string, devgastypes.FeeShare]( - storeKey, namespaceWithdrawerIdx, - collections.StringKeyEncoder, // index key (IK) - collections.StringKeyEncoder, // primary key (PK) - func(v devgastypes.FeeShare) string { return v.WithdrawerAddress }, + Withdrawer: *collindexes.NewMulti[string, string, devgastypes.FeeShare]( + sb, + collections.NewPrefix(int(namespaceWithdrawerIdx)), + storeKey.String(), + collections.StringKey, // index key (IK) + collections.StringKey, // primary key (PK) + func(pk string, v devgastypes.FeeShare) (string, error) { return v.WithdrawerAddress, nil }, ), }, ) diff --git a/x/devgas/v1/module.go b/x/devgas/v1/module.go index b76044225..8bcdeb835 100644 --- a/x/devgas/v1/module.go +++ b/x/devgas/v1/module.go @@ -147,12 +147,11 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // BeginBlock executes all ABCI BeginBlock logic respective to the fees module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { -} +func (am AppModule) BeginBlock(_ sdk.Context) {} // EndBlock executes all ABCI EndBlock logic respective to the fee-share module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(_ sdk.Context) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } @@ -182,10 +181,20 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // RegisterStoreDecoder implements module.AppModuleSimulation. -func (AppModule) RegisterStoreDecoder(sdk.StoreDecoderRegistry) { +func (AppModule) RegisterStoreDecoder(simtypes.StoreDecoderRegistry) { } // WeightedOperations implements module.AppModuleSimulation. func (AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return nil } + +func (am AppModule) IsOnePerModuleType() { + //TODO implement me + panic("implement me") +} + +func (am AppModule) IsAppModule() { + //TODO implement me + panic("implement me") +} diff --git a/x/devgas/v1/simulation/genesis.go b/x/devgas/v1/simulation/genesis.go index 8fd31e5c9..e5f45316f 100644 --- a/x/devgas/v1/simulation/genesis.go +++ b/x/devgas/v1/simulation/genesis.go @@ -3,11 +3,11 @@ package simulation // DONTCOVER import ( + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" "math/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/NibiruChain/nibiru/x/devgas/v1/types" @@ -17,14 +17,14 @@ const ( DeveloperFeeShare = "developer_fee_share" ) -func GenDeveloperFeeShare(r *rand.Rand) sdk.Dec { - return sdk.NewDecWithPrec(int64(r.Intn(100)), 2) +func GenDeveloperFeeShare(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyNewDecWithPrec(int64(r.Intn(100)), 2) } func RandomizedGenState(simState *module.SimulationState) { - var developerFeeShare sdk.Dec + var developerFeeShare sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, DeveloperFeeShare, &developerFeeShare, simState.Rand, + DeveloperFeeShare, &developerFeeShare, simState.Rand, func(r *rand.Rand) { developerFeeShare = GenDeveloperFeeShare(r) }, ) diff --git a/x/devgas/v1/types/codec.go b/x/devgas/v1/types/codec.go index ecedea2e1..c6d6889e9 100644 --- a/x/devgas/v1/types/codec.go +++ b/x/devgas/v1/types/codec.go @@ -5,7 +5,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" ) var ( @@ -39,7 +38,8 @@ func init() { // Register all Amino interfaces and concrete types on the authz Amino codec // so that this can later be used to properly serialize MsgGrant and MsgExec // instances. - RegisterLegacyAminoCodec(authzcodec.Amino) + // TODO: check! no more Amino in authzcodec + //RegisterLegacyAminoCodec(authzcodec.Amino) } // RegisterInterfaces register implementations diff --git a/x/devgas/v1/types/expected_keepers.go b/x/devgas/v1/types/expected_keepers.go index 1592cf2bf..3e6c436be 100644 --- a/x/devgas/v1/types/expected_keepers.go +++ b/x/devgas/v1/types/expected_keepers.go @@ -1,32 +1,32 @@ package types import ( + "context" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" // "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" - acctypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the expected interface needed to retrieve account info. type AccountKeeper interface { GetModuleAddress(moduleName string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, name string) acctypes.ModuleAccountI + GetModuleAccount(ctx context.Context, name string) sdk.ModuleAccountI - HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool - GetAccount(ctx sdk.Context, addr sdk.AccAddress) (account acctypes.AccountI) + HasAccount(ctx context.Context, addr sdk.AccAddress) bool + GetAccount(ctx context.Context, addr sdk.AccAddress) (account sdk.AccountI) } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins } // WasmKeeper defines the expected interface needed to retrieve cosmwasm contracts. type WasmKeeper interface { - GetContractInfo(ctx sdk.Context, contractAddr sdk.AccAddress) (wasmtypes.ContractInfo, error) + GetContractInfo(ctx context.Context, contractAddr sdk.AccAddress) (wasmtypes.ContractInfo, error) } diff --git a/x/devgas/v1/types/genesis.pb.go b/x/devgas/v1/types/genesis.pb.go index d31dd8b53..962871104 100644 --- a/x/devgas/v1/types/genesis.pb.go +++ b/x/devgas/v1/types/genesis.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -85,7 +85,7 @@ type ModuleParams struct { EnableFeeShare bool `protobuf:"varint,1,opt,name=enable_fee_share,json=enableFeeShare,proto3" json:"enable_fee_share,omitempty"` // developer_shares defines the proportion of the transaction fees to be // distributed to the registered contract owner - DeveloperShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=developer_shares,json=developerShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"developer_shares"` + DeveloperShares cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=developer_shares,json=developerShares,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"developer_shares"` // allowed_denoms defines the list of denoms that are allowed to be paid to // the contract withdraw addresses. If said denom is not in the list, the fees // will ONLY be sent to the community pool. @@ -148,30 +148,30 @@ func init() { func init() { proto.RegisterFile("nibiru/devgas/v1/genesis.proto", fileDescriptor_86a5066ce5bd7311) } var fileDescriptor_86a5066ce5bd7311 = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 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e0, 0x04, 0x60, - 0x92, 0x4f, 0x94, 0xe6, 0xfa, 0xbc, 0xfc, 0xef, 0x3f, 0x21, 0xdc, 0xda, 0xa7, 0xeb, 0x16, 0xee, - 0x40, 0xc4, 0x9d, 0x00, 0xa6, 0x9f, 0xd8, 0xfc, 0xae, 0xba, 0xdd, 0x2e, 0xf4, 0x77, 0x94, 0x7e, - 0x85, 0x3b, 0x2e, 0x64, 0x10, 0x88, 0x18, 0x92, 0x62, 0x50, 0x1a, 0x15, 0x13, 0x59, 0x8d, 0x11, - 0xcd, 0x97, 0xbc, 0x6c, 0x7a, 0x7f, 0x3c, 0x3f, 0x5d, 0x2c, 0x1d, 0x3a, 0x13, 0x21, 0x9b, 0x09, - 0x19, 0x0a, 0x59, 0x7e, 0xfe, 0x4a, 0xf7, 0x86, 0xa5, 0xf7, 0x31, 0x48, 0x3a, 0x86, 0x99, 0xfd, - 0xe3, 0x83, 0xa3, 0xc8, 0x52, 0xff, 0x8d, 0xdb, 0x3c, 0x08, 0xc4, 0x2d, 0xb8, 0x53, 0x17, 0x22, - 0x11, 0x4a, 0xa3, 0x6a, 0x56, 0xad, 0x86, 0xfd, 0xbd, 0x54, 0xc7, 0x4a, 0x1c, 0x9d, 0xad, 0xb6, - 0x04, 0xad, 0xb7, 0x04, 0xbd, 0x6e, 0x09, 0x7a, 0xdc, 0x11, 0x6d, 0xbd, 0x23, 0xda, 0xf3, 0x8e, - 0x68, 0xd7, 0x6c, 0x6f, 0xf3, 0x85, 0x7a, 0x8c, 0xe3, 0x05, 0xf7, 0x23, 0x56, 0x06, 0x76, 0xb7, - 0x17, 0x99, 0x3a, 0xc3, 0xa9, 0xa9, 0x70, 0xfe, 0xbd, 0x05, 0x00, 0x00, 0xff, 0xff, 0x24, 0xf2, - 0x7e, 0x8d, 0x05, 0x02, 0x00, 0x00, + // 361 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xcd, 0x6e, 0xda, 0x40, + 0x14, 0x85, 0x3d, 0x50, 0x21, 0x18, 0x28, 0x45, 0x56, 0x17, 0x16, 0x55, 0x07, 0x8b, 0xaa, 0x92, + 0x57, 0x33, 0x82, 0x6e, 0xdb, 0x0d, 0x45, 0xad, 0x22, 0x25, 0x28, 0x32, 0xbb, 0x6c, 0xd0, 0xd8, + 0xbe, 0xd8, 0x56, 0x6c, 0x8f, 0xe5, 0x31, 0x4e, 0x78, 0x86, 0x6c, 0xf2, 0x26, 0x79, 0x0d, 0x96, + 0x2c, 0xa3, 0x2c, 0x50, 0x04, 0x2f, 0x12, 0xf9, 0x27, 0x09, 0x0a, 0xbb, 0xeb, 0x73, 0xcf, 0xf9, + 0xae, 0x35, 0x07, 0x93, 0xc8, 0xb7, 0xfc, 0x64, 0xc5, 0x1c, 0xc8, 0x5c, 0x2e, 0x59, 0x36, 0x62, + 0x2e, 0x44, 0x20, 0x7d, 0x49, 0xe3, 0x44, 0xa4, 0x42, 0xed, 0x95, 0x7b, 0x5a, 0xee, 0x69, 0x36, + 0xea, 0x7f, 0x3f, 0x49, 0x54, 0xbb, 0x22, 0xd0, 0xff, 0xea, 0x0a, 0x57, 0x14, 0x23, 0xcb, 0xa7, + 0x52, 0x1d, 0xde, 0x21, 0xdc, 0xf9, 0x5f, 0x82, 0xe7, 0x29, 0x4f, 0x41, 0xfd, 0x8d, 0x1b, 0x31, + 0x4f, 0x78, 0x28, 0x35, 0xa4, 0x23, 0xa3, 0x3d, 0x26, 0xf4, 0xe3, 0x21, 0x7a, 0x21, 0x9c, 0x55, + 0x00, 0x97, 0x85, 0x6b, 0xf2, 0x69, 0xb3, 0x1b, 0x28, 0x66, 0x95, 0x51, 0xff, 0xe0, 0xd6, 0x12, + 0x60, 0x21, 0x3d, 0x9e, 0x80, 0x56, 0xd3, 0xeb, 0x46, 0x7b, 0xdc, 0x3f, 0x05, 0xfc, 0x03, 0x98, + 0xe7, 0x8e, 0x2a, 0xdc, 0x5c, 0x56, 0xdf, 0xc3, 0x07, 0x84, 0x3b, 0xc7, 0x74, 0xd5, 0xc0, 0x3d, + 0x88, 0xb8, 0x15, 0xc0, 0xe2, 0x1d, 0x9b, 0xff, 0x57, 0xd3, 0xec, 0x96, 0xfa, 0x2b, 0x4a, 0x9d, + 0xe1, 0x9e, 0x03, 0x19, 0x04, 0x22, 0x86, 0xa4, 0x34, 0x4a, 0xad, 0xa6, 0x23, 0xa3, 0x35, 0xf9, + 0x91, 0x1f, 0x79, 0xda, 0x0d, 0xbe, 0xd9, 0x42, 0x86, 0x42, 0x4a, 0xe7, 0x9a, 0xfa, 0x82, 0x85, + 0x3c, 0xf5, 0xe8, 0x39, 0xb8, 0xdc, 0x5e, 0x4f, 0xc1, 0x36, 0xbf, 0xbc, 0x85, 0x0b, 0x9c, 0x54, + 0x7f, 0xe2, 0x2e, 0x0f, 0x02, 0x71, 0x03, 0xce, 0xc2, 0x81, 0x48, 0x84, 0x52, 0xab, 0xeb, 0x75, + 0xa3, 0x65, 0x7e, 0xae, 0xd4, 0x69, 0x21, 0x4e, 0xce, 0x36, 0x7b, 0x82, 0xb6, 0x7b, 0x82, 0x9e, + 0xf7, 0x04, 0xdd, 0x1f, 0x88, 0xb2, 0x3d, 0x10, 0xe5, 0xf1, 0x40, 0x94, 0x2b, 0xe6, 0xfa, 0xa9, + 0xb7, 0xb2, 0xa8, 0x2d, 0x42, 0x36, 0x2b, 0x5e, 0xe0, 0xaf, 0xc7, 0xfd, 0x88, 0x55, 0x2d, 0xdd, + 0x1e, 0xf5, 0x94, 0xae, 0x63, 0x90, 0x56, 0xa3, 0x68, 0xe4, 0xd7, 0x4b, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x51, 0x22, 0x34, 0x65, 0xfa, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/devgas/v1/types/keys.go b/x/devgas/v1/types/keys.go index 43ee7ee70..46809cf69 100644 --- a/x/devgas/v1/types/keys.go +++ b/x/devgas/v1/types/keys.go @@ -1,9 +1,5 @@ package types -import ( - "github.com/NibiruChain/collections" -) - // constants const ( // module name @@ -19,7 +15,7 @@ const ( // KVStore key and mutli-index prefixes // prefix bytes for the fees persistent store const ( - KeyPrefixFeeShare collections.Namespace = iota + 1 + KeyPrefixFeeShare uint8 = iota + 1 KeyPrefixDeployer KeyPrefixWithdrawer KeyPrefixParams diff --git a/x/devgas/v1/types/params.go b/x/devgas/v1/types/params.go index 03d154a74..0236ff8c7 100644 --- a/x/devgas/v1/types/params.go +++ b/x/devgas/v1/types/params.go @@ -1,15 +1,14 @@ package types import ( + "cosmossdk.io/math" "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" ) // NewParams creates a new Params object func NewParams( enableFeeShare bool, - developerShares sdk.Dec, + developerShares math.LegacyDec, allowedDenoms []string, ) ModuleParams { return ModuleParams{ @@ -37,7 +36,7 @@ func validateBool(i interface{}) error { } func validateShares(i interface{}) error { - v, ok := i.(sdk.Dec) + v, ok := i.(math.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) @@ -51,7 +50,7 @@ func validateShares(i interface{}) error { return fmt.Errorf("value cannot be negative: %T", i) } - if v.GT(sdk.OneDec()) { + if v.GT(math.LegacyOneDec()) { return fmt.Errorf("value cannot be greater than 1: %T", i) } diff --git a/x/devgas/v1/types/params_legacy.go b/x/devgas/v1/types/params_legacy.go index 6737082a5..259708e8a 100644 --- a/x/devgas/v1/types/params_legacy.go +++ b/x/devgas/v1/types/params_legacy.go @@ -3,14 +3,14 @@ package types // TODO: Remove this and params_legacy_test.go after v0.47.x (v16) upgrade import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) // Parameter store key var ( DefaultEnableFeeShare = true - DefaultDeveloperShares = sdk.NewDecWithPrec(50, 2) // 50% + DefaultDeveloperShares = math.LegacyNewDecWithPrec(50, 2) // 50% // DefaultAllowedDenoms = []string(nil) // all allowed DefaultAllowedDenoms = []string{} // all allowed diff --git a/x/epochs/abci.go b/x/epochs/abci.go index 319999944..a53d9f848 100644 --- a/x/epochs/abci.go +++ b/x/epochs/abci.go @@ -40,7 +40,7 @@ func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { EpochStartTime: epochInfo.CurrentEpochStartTime, }) - k.Epochs.Insert(ctx, epochInfo.Identifier, epochInfo) + k.Epochs.Set(ctx, epochInfo.Identifier, epochInfo) k.BeforeEpochStart(ctx, epochInfo.Identifier, epochInfo.CurrentEpoch) return false diff --git a/x/epochs/keeper/epoch.go b/x/epochs/keeper/epoch.go index 48510df30..12bfb8592 100644 --- a/x/epochs/keeper/epoch.go +++ b/x/epochs/keeper/epoch.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" @@ -47,14 +47,14 @@ func (k Keeper) AddEpochInfo(ctx sdk.Context, epoch types.EpochInfo) error { epoch.CurrentEpochStartHeight = ctx.BlockHeight() - k.Epochs.Insert(ctx, epoch.Identifier, epoch) + k.Epochs.Set(ctx, epoch.Identifier, epoch) return nil } // DeleteEpochInfo delete epoch info. func (k Keeper) DeleteEpochInfo(ctx sdk.Context, identifier string) (err error) { - err = k.Epochs.Delete(ctx, identifier) + err = k.Epochs.Remove(ctx, identifier) return } @@ -63,11 +63,11 @@ func (k Keeper) IterateEpochInfo( ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool), ) { - iterate := k.Epochs.Iterate(ctx, &collections.Range[string]{}) + iterate, _ := k.Epochs.Iterate(ctx, &collections.Range[string]{}) i := int64(0) for ; iterate.Valid(); iterate.Next() { - epoch := iterate.Value() + epoch, _ := iterate.Value() stop := fn(i, epoch) if stop { diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go index a1d997938..4417ed071 100644 --- a/x/epochs/keeper/keeper.go +++ b/x/epochs/keeper/keeper.go @@ -1,9 +1,11 @@ package keeper import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" + corestoretypes "cosmossdk.io/core/store" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/runtime" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/cosmos/cosmos-sdk/codec" @@ -11,19 +13,28 @@ import ( ) type Keeper struct { - cdc codec.Codec - storeKey storetypes.StoreKey - hooks types.EpochHooks + cdc codec.Codec + storeService corestoretypes.KVStoreService + hooks types.EpochHooks Epochs collections.Map[string, types.EpochInfo] } -func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey) Keeper { - return Keeper{ - cdc: cdc, - storeKey: storeKey, +func NewKeeper(cdc codec.Codec, storeKey *storetypes.KVStoreKey) Keeper { + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) - Epochs: collections.NewMap[string, types.EpochInfo](storeKey, 1, collections.StringKeyEncoder, collections.ProtoValueEncoder[types.EpochInfo](cdc)), + return Keeper{ + cdc: cdc, + storeService: storeService, + + Epochs: collections.NewMap[string, types.EpochInfo]( + sb, + collections.NewPrefix(1), + storeKey.String(), + collections.StringKey, + codec.CollValue[types.EpochInfo](cdc), + ), } } diff --git a/x/epochs/module.go b/x/epochs/module.go index 1bbd0a53b..c2cfb42da 100644 --- a/x/epochs/module.go +++ b/x/epochs/module.go @@ -132,13 +132,13 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(ctx sdk.Context) { BeginBlocker(ctx, am.keeper) } // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } @@ -157,7 +157,7 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We } // RegisterStoreDecoder registers a decoder for supply module's types. -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { } // WeightedOperations returns the all the gov module operations with their respective weights. @@ -167,3 +167,7 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 1 } + +func (am AppModule) IsOnePerModuleType() {} + +func (am AppModule) IsAppModule() {} diff --git a/x/genmsg/genesis.go b/x/genmsg/genesis.go index b0a46de96..50f0a1ed3 100644 --- a/x/genmsg/genesis.go +++ b/x/genmsg/genesis.go @@ -11,14 +11,16 @@ import ( ) func anyToMsg(ir types.InterfaceRegistry, anyMsg *types.Any) (sdk.Msg, error) { - var sdkMsg sdk.Msg + var sdkMsg sdk.LegacyMsg err := ir.UnpackAny(anyMsg, &sdkMsg) if err != nil { return nil, err } - if err = sdkMsg.ValidateBasic(); err != nil { - return nil, err - } + + // IMPORTANT: https://docs.cosmos.network/v0.50/build/rfc/rfc-001-tx-validation + //if err = sdkMsg.ValidateBasic(); err != nil { + // return nil, err + //} return sdkMsg, nil } diff --git a/x/genmsg/module.go b/x/genmsg/module.go index f20ae9b74..26a31ecc2 100644 --- a/x/genmsg/module.go +++ b/x/genmsg/module.go @@ -79,3 +79,13 @@ func (a AppModule) ConsensusVersion() uint64 { return 0 } func (a AppModule) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} func (a AppModule) RegisterInterfaces(_ types.InterfaceRegistry) {} + +func (am AppModule) IsOnePerModuleType() { + //TODO implement me + panic("implement me") +} + +func (am AppModule) IsAppModule() { + //TODO implement me + panic("implement me") +} diff --git a/x/genmsg/v1/genmsg.pb.go b/x/genmsg/v1/genmsg.pb.go index 2a056f1aa..581589a0d 100644 --- a/x/genmsg/v1/genmsg.pb.go +++ b/x/genmsg/v1/genmsg.pb.go @@ -23,7 +23,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState represents the messages to be processed during genesis by the genmsg module. +// GenesisState represents the messages to be processed during genesis by the +// genmsg module. type GenesisState struct { Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` } diff --git a/x/inflation/client/cli/tx.go b/x/inflation/client/cli/tx.go index a66b46db0..4c8f00c71 100644 --- a/x/inflation/client/cli/tx.go +++ b/x/inflation/client/cli/tx.go @@ -1,12 +1,12 @@ package cli import ( + sdkmath "cosmossdk.io/math" "strings" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" "github.com/NibiruChain/nibiru/x/inflation/types" @@ -97,21 +97,21 @@ $ nibid tx oracle edit-params --staking-proportion 0.6 --community-pool-proporti Sender: clientCtx.GetFromAddress().String(), } - var stakingProportionDec sdk.Dec + var stakingProportionDec sdkmath.LegacyDec if stakingProportion, _ := cmd.Flags().GetString("staking-proportion"); stakingProportion != "" { - stakingProportionDec = sdk.MustNewDecFromStr(stakingProportion) + stakingProportionDec = sdkmath.LegacyMustNewDecFromStr(stakingProportion) msg.InflationDistribution.StakingRewards = stakingProportionDec } - var communityPoolProportionDec sdk.Dec + var communityPoolProportionDec sdkmath.LegacyDec if communityPoolProportion, _ := cmd.Flags().GetString("community-pool-proportion"); communityPoolProportion != "" { - communityPoolProportionDec = sdk.MustNewDecFromStr(communityPoolProportion) + communityPoolProportionDec = sdkmath.LegacyMustNewDecFromStr(communityPoolProportion) msg.InflationDistribution.CommunityPool = communityPoolProportionDec } - var strategicReservesProportionDec sdk.Dec + var strategicReservesProportionDec sdkmath.LegacyDec if strategicReservesProportion, _ := cmd.Flags().GetString("strategic-reserves-proportion"); strategicReservesProportion != "" { - strategicReservesProportionDec = sdk.MustNewDecFromStr(strategicReservesProportion) + strategicReservesProportionDec = sdkmath.LegacyMustNewDecFromStr(strategicReservesProportion) msg.InflationDistribution.StrategicReserves = strategicReservesProportionDec } @@ -125,26 +125,26 @@ $ nibid tx oracle edit-params --staking-proportion 0.6 --community-pool-proporti if polynomialFactors, _ := cmd.Flags().GetString("polynomial-factors"); polynomialFactors != "" { polynomialFactorsArr := strings.Split(polynomialFactors, ",") - realPolynomialFactors := make([]sdk.Dec, len(polynomialFactorsArr)) + realPolynomialFactors := make([]sdkmath.LegacyDec, len(polynomialFactorsArr)) for i, factor := range polynomialFactorsArr { - factorDec := sdk.MustNewDecFromStr(factor) + factorDec := sdkmath.LegacyMustNewDecFromStr(factor) realPolynomialFactors[i] = factorDec } msg.PolynomialFactors = realPolynomialFactors } if epochsPerPeriod, _ := cmd.Flags().GetUint64("epochs-per-period"); epochsPerPeriod != 0 { - epochsPerPeriodInt := sdk.NewIntFromUint64(epochsPerPeriod) + epochsPerPeriodInt := sdkmath.NewIntFromUint64(epochsPerPeriod) msg.EpochsPerPeriod = &epochsPerPeriodInt } if periodsPerYear, _ := cmd.Flags().GetUint64("periods-per-year"); periodsPerYear != 0 { - periodsPerYearInt := sdk.NewIntFromUint64(periodsPerYear) + periodsPerYearInt := sdkmath.NewIntFromUint64(periodsPerYear) msg.PeriodsPerYear = &periodsPerYearInt } if maxPeriod, _ := cmd.Flags().GetUint64("max-period"); maxPeriod != 0 { - maxPeriodInt := sdk.NewIntFromUint64(maxPeriod) + maxPeriodInt := sdkmath.NewIntFromUint64(maxPeriod) msg.MaxPeriod = &maxPeriodInt } diff --git a/x/inflation/genesis.go b/x/inflation/genesis.go index b55da1322..f2b2f7c08 100644 --- a/x/inflation/genesis.go +++ b/x/inflation/genesis.go @@ -32,9 +32,11 @@ func InitGenesis( // ExportGenesis returns a GenesisState for a given context and keeper. func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + period, _ := k.CurrentPeriod.Peek(ctx) + numSkippedEpochs, _ := k.NumSkippedEpochs.Peek(ctx) return &types.GenesisState{ Params: k.GetParams(ctx), - Period: k.CurrentPeriod.Peek(ctx), - SkippedEpochs: k.NumSkippedEpochs.Peek(ctx), + Period: period, + SkippedEpochs: numSkippedEpochs, } } diff --git a/x/inflation/keeper/grpc_query.go b/x/inflation/keeper/grpc_query.go index 39cc78831..cf1918124 100644 --- a/x/inflation/keeper/grpc_query.go +++ b/x/inflation/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -36,7 +37,11 @@ func (k Keeper) Period( _ *types.QueryPeriodRequest, ) (*types.QueryPeriodResponse, error) { ctx := sdk.UnwrapSDKContext(c) - period := k.CurrentPeriod.Peek(ctx) + period, err := k.CurrentPeriod.Peek(ctx) + if err != nil { + k.Logger(ctx).Error("failed to get current period", "error", err) + return nil, err + } return &types.QueryPeriodResponse{Period: period}, nil } @@ -57,7 +62,11 @@ func (k Keeper) SkippedEpochs( _ *types.QuerySkippedEpochsRequest, ) (*types.QuerySkippedEpochsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - skippedEpochs := k.NumSkippedEpochs.Peek(ctx) + skippedEpochs, err := k.NumSkippedEpochs.Peek(ctx) + if err != nil { + k.Logger(ctx).Error("failed to get num skipped epochs", "error", err) + return nil, err + } return &types.QuerySkippedEpochsResponse{SkippedEpochs: skippedEpochs}, nil } @@ -80,7 +89,7 @@ func (k Keeper) CirculatingSupply( ctx := sdk.UnwrapSDKContext(c) circulatingSupply := k.GetCirculatingSupply(ctx, denoms.NIBI) - circulatingToDec := sdk.NewDecFromInt(circulatingSupply) + circulatingToDec := sdkmath.LegacyNewDecFromInt(circulatingSupply) coin := sdk.NewDecCoinFromDec(denoms.NIBI, circulatingToDec) return &types.QueryCirculatingSupplyResponse{CirculatingSupply: coin}, nil diff --git a/x/inflation/keeper/hooks.go b/x/inflation/keeper/hooks.go index 0c78c3e0d..9eabefd3d 100644 --- a/x/inflation/keeper/hooks.go +++ b/x/inflation/keeper/hooks.go @@ -3,9 +3,9 @@ package keeper import ( "fmt" - "github.com/armon/go-metrics" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/hashicorp/go-metrics" "github.com/NibiruChain/nibiru/x/common/denoms" epochstypes "github.com/NibiruChain/nibiru/x/epochs/types" @@ -55,7 +55,7 @@ func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumbe h.K.NumSkippedEpochs.Set(ctx, epochNumber) prevSkippedEpochs = epochNumber } else { - prevSkippedEpochs = h.K.NumSkippedEpochs.Next(ctx) + prevSkippedEpochs, _ = h.K.NumSkippedEpochs.Next(ctx) } h.K.Logger(ctx).Debug( @@ -69,9 +69,13 @@ func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumbe } // mint coins, update supply - period := h.K.CurrentPeriod.Peek(ctx) - epochsPerPeriod := h.K.GetEpochsPerPeriod(ctx) + period, err := h.K.CurrentPeriod.Peek(ctx) + if err != nil { + h.K.Logger(ctx).Error("failed to get current peiod", "error", err) + return + } + epochsPerPeriod := h.K.GetEpochsPerPeriod(ctx) epochMintProvision := types.CalculateEpochMintProvision( params, period, @@ -114,12 +118,20 @@ func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumbe // Given, epochNumber = 42099, period = 0, epochPerPeriod = 30, skippedEpochs = 42069 // => 42099 - 0 * 30 - 42069 >= 30 // => a period has ended! we set a new period - numSkippedEpochs := h.K.NumSkippedEpochs.Peek(ctx) + numSkippedEpochs, err := h.K.NumSkippedEpochs.Peek(ctx) + if err != nil { + h.K.Logger(ctx).Error("failed to get num skipped epochs", "error", err) + return + } + if int64(epochNumber)- int64(epochsPerPeriod*period)- int64(numSkippedEpochs) >= int64(epochsPerPeriod) { - periodBeforeIncrement := h.K.CurrentPeriod.Next(ctx) - + periodBeforeIncrement, err := h.K.CurrentPeriod.Next(ctx) + if err != nil { + h.K.Logger(ctx).Error("failed to get current peiod", "error", err) + return + } h.K.Logger(ctx).Info(fmt.Sprintf("setting new period: %d", periodBeforeIncrement+1)) } diff --git a/x/inflation/keeper/inflation.go b/x/inflation/keeper/inflation.go index 16eabb81a..9a1dff4d2 100644 --- a/x/inflation/keeper/inflation.go +++ b/x/inflation/keeper/inflation.go @@ -127,11 +127,11 @@ func (k Keeper) AllocatePolynomialInflation( func (k Keeper) GetProportions( _ sdk.Context, coin sdk.Coin, - proportion sdk.Dec, + proportion sdkmath.LegacyDec, ) sdk.Coin { return sdk.Coin{ Denom: coin.Denom, - Amount: sdk.NewDecFromInt(coin.Amount).Mul(proportion).TruncateInt(), + Amount: sdkmath.LegacyNewDecFromInt(coin.Amount).Mul(proportion).TruncateInt(), } } @@ -142,30 +142,30 @@ func (k Keeper) GetCirculatingSupply(ctx sdk.Context, mintDenom string) sdkmath. } // GetInflationRate returns the inflation rate for the current period. -func (k Keeper) GetInflationRate(ctx sdk.Context, mintDenom string) sdk.Dec { +func (k Keeper) GetInflationRate(ctx sdk.Context, mintDenom string) sdkmath.LegacyDec { epochMintProvision := k.GetEpochMintProvision(ctx) if epochMintProvision.IsZero() { - return sdk.ZeroDec() + return sdkmath.LegacyZeroDec() } circulatingSupply := k.GetCirculatingSupply(ctx, mintDenom) if circulatingSupply.IsZero() { - return sdk.ZeroDec() + return sdkmath.LegacyZeroDec() } // EpochMintProvision * 365 / circulatingSupply * 100 - circulatingSupplyToDec := sdk.NewDecFromInt(circulatingSupply) + circulatingSupplyToDec := sdkmath.LegacyNewDecFromInt(circulatingSupply) return epochMintProvision. MulInt64(int64(k.GetEpochsPerPeriod(ctx))). MulInt64(int64(k.GetPeriodsPerYear(ctx))). Quo(circulatingSupplyToDec). - Mul(sdk.NewDec(100)) + Mul(sdkmath.LegacyNewDec(100)) } // GetEpochMintProvision retrieves necessary params KV storage // and calculate EpochMintProvision -func (k Keeper) GetEpochMintProvision(ctx sdk.Context) sdk.Dec { - peek := k.CurrentPeriod.Peek(ctx) +func (k Keeper) GetEpochMintProvision(ctx sdk.Context) sdkmath.LegacyDec { + peek, _ := k.CurrentPeriod.Peek(ctx) return types.CalculateEpochMintProvision( k.GetParams(ctx), diff --git a/x/inflation/keeper/keeper.go b/x/inflation/keeper/keeper.go index 43742b843..43123952f 100644 --- a/x/inflation/keeper/keeper.go +++ b/x/inflation/keeper/keeper.go @@ -1,10 +1,11 @@ package keeper import ( - "github.com/NibiruChain/collections" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/collections" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -55,7 +56,7 @@ type Keeper struct { // NewKeeper creates a new mint Keeper instance func NewKeeper( cdc codec.BinaryCodec, - storeKey storetypes.StoreKey, + storeKey *storetypes.KVStoreKey, paramspace paramstypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, @@ -69,6 +70,9 @@ func NewKeeper( panic("the inflation module account has not been set") } + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) + return Keeper{ storeKey: storeKey, cdc: cdc, @@ -79,9 +83,9 @@ func NewKeeper( stakingKeeper: stakingKeeper, sudoKeeper: sudoKeeper, feeCollectorName: feeCollectorName, - CurrentPeriod: collections.NewSequence(storeKey, 0), - NumSkippedEpochs: collections.NewSequence(storeKey, 1), - Params: collections.NewItem(storeKey, 2, collections.ProtoValueEncoder[types.Params](cdc)), + CurrentPeriod: collections.NewSequence(sb, collections.NewPrefix(0), storeKey.String()), + NumSkippedEpochs: collections.NewSequence(sb, collections.NewPrefix(1), storeKey.String()), + Params: collections.NewItem(sb, collections.NewPrefix(2), storeKey.String(), codec.CollValue[types.Params](cdc)), } } diff --git a/x/inflation/keeper/params.go b/x/inflation/keeper/params.go index 3068045de..e05032443 100644 --- a/x/inflation/keeper/params.go +++ b/x/inflation/keeper/params.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/inflation/types" @@ -11,7 +12,7 @@ func (k Keeper) GetParams(ctx sdk.Context) types.Params { return params } -func (k Keeper) GetPolynomialFactors(ctx sdk.Context) (res []sdk.Dec) { +func (k Keeper) GetPolynomialFactors(ctx sdk.Context) (res []sdkmath.LegacyDec) { params, _ := k.Params.Get(ctx) return params.PolynomialFactors } diff --git a/x/inflation/module.go b/x/inflation/module.go index d0ab48ee3..cd3b1ae3d 100644 --- a/x/inflation/module.go +++ b/x/inflation/module.go @@ -123,15 +123,15 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), querier) } -// BeginBlock returns the begin blocker for the inflation module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { -} - -// EndBlock returns the end blocker for the inflation module. It returns no validator -// updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} +//// BeginBlock returns the begin blocker for the inflation module. +//func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { +//} +// +//// EndBlock returns the end blocker for the inflation module. It returns no validator +//// updates. +//func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +// return []abci.ValidatorUpdate{} +//} // InitGenesis performs genesis initialization for the inflation module. It returns // no validator updates. @@ -165,10 +165,14 @@ func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.Weight } // RegisterStoreDecoder registers a decoder for inflation module's types. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) { } // WeightedOperations doesn't return any inflation module operation. func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return []simtypes.WeightedOperation{} } + +func (am AppModule) IsOnePerModuleType() {} + +func (am AppModule) IsAppModule() {} diff --git a/x/inflation/simulation/genesis.go b/x/inflation/simulation/genesis.go index 25add08db..8858d65d1 100644 --- a/x/inflation/simulation/genesis.go +++ b/x/inflation/simulation/genesis.go @@ -3,10 +3,10 @@ package simulation // DONTCOVER import ( + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/NibiruChain/nibiru/x/inflation/types" @@ -17,18 +17,18 @@ func RandomizedGenState(simState *module.SimulationState) { inflationGenesis := types.GenesisState{ Params: types.Params{ InflationEnabled: true, - PolynomialFactors: []sdk.Dec{ - sdk.MustNewDecFromStr("-0.00014851"), - sdk.MustNewDecFromStr("0.07501029"), - sdk.MustNewDecFromStr("-19.04983993"), - sdk.MustNewDecFromStr("3158.89198346"), - sdk.MustNewDecFromStr("-338072.17402939"), - sdk.MustNewDecFromStr("17999834.20786474"), + PolynomialFactors: []sdkmath.LegacyDec{ + sdkmath.LegacyMustNewDecFromStr("-0.00014851"), + sdkmath.LegacyMustNewDecFromStr("0.07501029"), + sdkmath.LegacyMustNewDecFromStr("-19.04983993"), + sdkmath.LegacyMustNewDecFromStr("3158.89198346"), + sdkmath.LegacyMustNewDecFromStr("-338072.17402939"), + sdkmath.LegacyMustNewDecFromStr("17999834.20786474"), }, InflationDistribution: types.InflationDistribution{ - CommunityPool: sdk.NewDecWithPrec(35_142714, 8), // 35.142714% - StakingRewards: sdk.NewDecWithPrec(27_855672, 8), // 27.855672% - StrategicReserves: sdk.NewDecWithPrec(37_001614, 8), // 37.001614% + CommunityPool: sdkmath.LegacyNewDecWithPrec(35_142714, 8), // 35.142714% + StakingRewards: sdkmath.LegacyNewDecWithPrec(27_855672, 8), // 27.855672% + StrategicReserves: sdkmath.LegacyNewDecWithPrec(37_001614, 8), // 37.001614% }, EpochsPerPeriod: 30, PeriodsPerYear: 12, diff --git a/x/inflation/types/genesis.pb.go b/x/inflation/types/genesis.pb.go index 522028269..2801acdc3 100644 --- a/x/inflation/types/genesis.pb.go +++ b/x/inflation/types/genesis.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -96,7 +96,7 @@ type Params struct { InflationEnabled bool `protobuf:"varint,1,opt,name=inflation_enabled,json=inflationEnabled,proto3" json:"inflation_enabled,omitempty"` // polynomial_factors takes in the variables to calculate polynomial // inflation - PolynomialFactors []github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,rep,name=polynomial_factors,json=polynomialFactors,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"polynomial_factors"` + PolynomialFactors []cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,rep,name=polynomial_factors,json=polynomialFactors,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"polynomial_factors"` // inflation_distribution of the minted denom InflationDistribution InflationDistribution `protobuf:"bytes,3,opt,name=inflation_distribution,json=inflationDistribution,proto3" json:"inflation_distribution"` // epochs_per_period is the number of epochs that must pass before a new @@ -196,36 +196,36 @@ func init() { func init() { proto.RegisterFile("nibiru/inflation/v1/genesis.proto", fileDescriptor_2d00e2bb98c08f74) } var fileDescriptor_2d00e2bb98c08f74 = []byte{ - // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xc1, 0x6e, 0x13, 0x31, - 0x10, 0xcd, 0x36, 0x61, 0xa1, 0x2e, 0x94, 0xc6, 0xa5, 0xd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x90, 0x05, 0x8f, 0x8d, 0xdb, 0xbb, 0x05, 0x55, 0xcb, 0x55, 0x2e, 0x2c, - 0xd4, 0x3f, 0xbf, 0x99, 0x85, 0xde, 0xed, 0x2c, 0xf4, 0xfe, 0xcf, 0x42, 0xef, 0xf7, 0x3c, 0x6c, - 0xdc, 0xce, 0xc3, 0xc6, 0xdf, 0x79, 0xd8, 0xf8, 0x41, 0xd6, 0x6c, 0xfe, 0x66, 0x5c, 0xf9, 0x5c, - 0x50, 0x56, 0x11, 0x77, 0x89, 0x93, 0xb5, 0x5b, 0x34, 0x9e, 0x27, 0xbe, 0xb9, 0xc2, 0x8f, 0xf7, - 0x01, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x43, 0x3a, 0xc4, 0xfa, 0x02, 0x00, 0x00, + // 462 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x4e, 0xdb, 0x40, + 0x10, 0xc6, 0x63, 0x92, 0xba, 0x65, 0x69, 0x29, 0x59, 0x0a, 0xb2, 0x40, 0x35, 0x29, 0xa8, 0x52, + 0x44, 0x25, 0x5b, 0xa4, 0xa7, 0x5e, 0x53, 0x68, 0x85, 0x54, 0x55, 0x91, 0x39, 0xb5, 0x17, 0x6b, + 0x6c, 0x0f, 0xf6, 0x8a, 0xd8, 0xbb, 0xda, 0xdd, 0xa0, 0xe4, 0x0d, 0x7a, 0xec, 0xbd, 0x2f, 0xc4, + 0x91, 0x63, 0xd5, 0x03, 0xaa, 0x92, 0x17, 0x41, 0xd9, 0x35, 0x49, 0x0e, 0xb9, 0xed, 0xcc, 0xf7, + 0x9b, 0x3f, 0xfb, 0x69, 0xc8, 0xbb, 0x8a, 0x25, 0x4c, 0x8e, 0x42, 0x56, 0x5d, 0x0f, 0x41, 0x33, + 0x5e, 0x85, 0xb7, 0x67, 0x61, 0x8e, 0x15, 0x2a, 0xa6, 0x02, 0x21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xd3, 0x9c, 0xec, 0x2f, 0x17, 0xc8, 0x98, 0xd2, 0x92, 0x25, 0xa3, 0x79, 0x60, 0x56, 0xdf, 0xea, + 0x9d, 0xae, 0x75, 0xe5, 0xf2, 0x29, 0x38, 0x5f, 0xa9, 0xa8, 0x4d, 0xda, 0x63, 0xeb, 0x44, 0x7a, + 0x4a, 0xda, 0xd6, 0x93, 0x58, 0xa0, 0x8c, 0x6b, 0xfb, 0x5a, 0xc6, 0x9e, 0xd7, 0x56, 0x18, 0xa0, + 0x1c, 0x58, 0x1f, 0xbb, 0x64, 0xc7, 0x02, 0x16, 0x9e, 0x20, 0x48, 0xef, 0x99, 0x41, 0xb7, 0xeb, + 0xfc, 0x00, 0xe5, 0x0f, 0x04, 0x49, 0xdf, 0x12, 0x52, 0xc2, 0xf8, 0xa9, 0x9d, 0x6b, 0x98, 0xcd, + 0x12, 0xc6, 0x75, 0xa3, 0x1e, 0xd9, 0x2b, 0x40, 0xc5, 0xcb, 0x1f, 0x2a, 0x0d, 0x52, 0x63, 0xe6, + 0x3d, 0x37, 0x16, 0xef, 0x16, 0xa0, 0x16, 0x5f, 0xb9, 0xb2, 0x52, 0xff, 0xf2, 0x6e, 0xea, 0x3b, + 0xf7, 0x53, 0xdf, 0xf9, 0x3f, 0xf5, 0x9d, 0xdf, 0x33, 0xbf, 0x71, 0x3f, 0xf3, 0x1b, 0x7f, 0x67, + 0x7e, 0xe3, 0x67, 0x98, 0x33, 0x5d, 0x8c, 0x92, 0x20, 0xe5, 0x65, 0xf8, 0xdd, 0xb8, 0xf2, 0xb9, + 0x00, 0x56, 0x85, 0xf5, 0xf9, 0x8d, 0x57, 0x0e, 0x50, 0x4f, 0x04, 0xaa, 0xc4, 0x35, 0xa7, 0xf7, + 0xf1, 0x31, 0x00, 0x00, 0xff, 0xff, 0xdc, 0xbd, 0xee, 0xca, 0xef, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -619,7 +619,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.PolynomialFactors = append(m.PolynomialFactors, v) if err := m.PolynomialFactors[len(m.PolynomialFactors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/inflation/types/inflation.pb.go b/x/inflation/types/inflation.pb.go index 632c86ebf..cb1c3626a 100644 --- a/x/inflation/types/inflation.pb.go +++ b/x/inflation/types/inflation.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -30,13 +30,13 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type InflationDistribution struct { // staking_rewards defines the proportion of the minted_denom that is // to be allocated as staking rewards - StakingRewards github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=staking_rewards,json=stakingRewards,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"staking_rewards"` + StakingRewards cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=staking_rewards,json=stakingRewards,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"staking_rewards"` // community_pool defines the proportion of the minted_denom that is to // be allocated to the community pool - CommunityPool github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=community_pool,json=communityPool,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_pool"` + CommunityPool cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=community_pool,json=communityPool,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"community_pool"` // strategic_reserves defines the proportion of the minted_denom that // is to be allocated to the strategic reserves module address - StrategicReserves github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=strategic_reserves,json=strategicReserves,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"strategic_reserves"` + StrategicReserves cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=strategic_reserves,json=strategicReserves,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"strategic_reserves"` } func (m *InflationDistribution) Reset() { *m = InflationDistribution{} } @@ -81,25 +81,25 @@ func init() { } var fileDescriptor_37da805e9a324a97 = []byte{ - // 284 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0xcb, 0x4c, 0xca, - 0x2c, 0x2a, 0xd5, 0xcf, 0xcc, 0x4b, 0xcb, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x44, - 0x70, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0x21, 0x8a, 0xf4, 0x10, 0xe2, 0x65, 0x86, - 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x69, 0x19, 0x13, - 0x97, 0xa8, 0x27, 0x4c, 0x99, 0x4b, 0x66, 0x71, 0x49, 0x51, 0x66, 0x52, 0x29, 0x88, 0x2d, 0x14, - 0xce, 0xc5, 0x5f, 0x5c, 0x92, 0x98, 0x9d, 0x99, 0x97, 0x1e, 0x5f, 0x94, 0x5a, 0x9e, 0x58, 0x94, - 0x52, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0xa4, 0x77, 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, - 0xf2, 0x6a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xc9, 0xf9, 0xc5, - 0xb9, 0xf9, 0xc5, 0x50, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x58, 0xcf, - 0x25, 0x35, 0x39, 0x88, 0x0f, 0x6a, 0x4c, 0x10, 0xc4, 0x14, 0xa1, 0x50, 0x2e, 0xbe, 0xe4, 0xfc, - 0xdc, 0xdc, 0xd2, 0xbc, 0xcc, 0x92, 0xca, 0xf8, 0x82, 0xfc, 0xfc, 0x1c, 0x09, 0x26, 0xb2, 0xcc, - 0xe5, 0x85, 0x9b, 0x12, 0x90, 0x9f, 0x9f, 0x23, 0x14, 0xcb, 0x25, 0x54, 0x5c, 0x52, 0x94, 0x58, - 0x92, 0x9a, 0x9e, 0x99, 0x1c, 0x5f, 0x94, 0x5a, 0x9c, 0x5a, 0x54, 0x96, 0x5a, 0x2c, 0xc1, 0x4c, - 0x96, 0xd1, 0x82, 0x70, 0x93, 0x82, 0xa0, 0x06, 0x39, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, - 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, - 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x3e, 0x92, 0xa1, 0x7e, 0xe0, 0x80, 0x77, 0xce, 0x48, 0xcc, 0xcc, - 0xd3, 0x87, 0xc6, 0x54, 0x05, 0x52, 0x5c, 0x81, 0x6d, 0x48, 0x62, 0x03, 0x07, 0xbd, 0x31, 0x20, - 0x00, 0x00, 0xff, 0xff, 0x75, 0xbf, 0x6b, 0xae, 0xcc, 0x01, 0x00, 0x00, + // 288 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xc1, 0x4a, 0xf3, 0x40, + 0x14, 0x85, 0x93, 0xfe, 0xf0, 0x83, 0x01, 0x2b, 0x46, 0x85, 0xa2, 0x30, 0x15, 0xbb, 0x71, 0x95, + 0x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2, 0xf4, 0xfe, 0x1d, 0x9e, 0x77, 0xba, 0xc3, 0xc3, 0x96, + 0x1e, 0x4d, 0x56, 0x25, 0x71, 0xd7, 0x25, 0x71, 0xbf, 0x4b, 0xe2, 0x7e, 0x54, 0xc4, 0x59, 0x57, + 0xc4, 0xf9, 0xac, 0x88, 0xf3, 0x4c, 0x25, 0xd8, 0x45, 0x16, 0x05, 0x1c, 0x13, 0xfa, 0x58, 0xf7, + 0x7a, 0xbf, 0x60, 0xa0, 0x68, 0x3b, 0xc4, 0xdb, 0x9f, 0x29, 0x6c, 0x91, 0x0a, 0x13, 0xfd, 0xaf, + 0x9b, 0xbd, 0xfb, 0x09, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x62, 0x13, 0x24, 0xab, 0x01, 0x00, 0x00, } func (m *InflationDistribution) Marshal() (dAtA []byte, err error) { diff --git a/x/inflation/types/inflation_calculation.go b/x/inflation/types/inflation_calculation.go index 48c152a45..ee0aa8846 100644 --- a/x/inflation/types/inflation_calculation.go +++ b/x/inflation/types/inflation_calculation.go @@ -1,40 +1,40 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) // CalculateEpochMintProvision returns mint provision per epoch func CalculateEpochMintProvision( params Params, period uint64, -) sdk.Dec { +) math.LegacyDec { if params.EpochsPerPeriod == 0 || !params.InflationEnabled || period >= params.MaxPeriod { - return sdk.ZeroDec() + return math.LegacyZeroDec() } // truncating to the nearest integer x := period // Calculate the value of the polynomial at x - polynomialValue := polynomial(params.PolynomialFactors, sdk.NewDec(int64(x))) + polynomialValue := polynomial(params.PolynomialFactors, math.LegacyNewDec(int64(x))) if polynomialValue.IsNegative() { // Just to make sure nothing weird occur - return sdk.ZeroDec() + return math.LegacyZeroDec() } - return polynomialValue.Quo(sdk.NewDec(int64(params.EpochsPerPeriod))) + return polynomialValue.Quo(math.LegacyNewDec(int64(params.EpochsPerPeriod))) } // Compute the value of x given the polynomial factors -func polynomial(factors []sdk.Dec, x sdk.Dec) sdk.Dec { - result := sdk.ZeroDec() +func polynomial(factors []math.LegacyDec, x math.LegacyDec) math.LegacyDec { + result := math.LegacyZeroDec() for i, factor := range factors { result = result.Add(factor.Mul(x.Power(uint64(len(factors) - i - 1)))) } // Multiply by 1 million to get the value in unibi // 1 unibi = 1e6 nibi and the polynomial was fit on nibi token curve. - return result.Mul(sdk.NewDec(1_000_000)) + return result.Mul(math.LegacyNewDec(1_000_000)) } diff --git a/x/inflation/types/interfaces.go b/x/inflation/types/interfaces.go index 1fccafed4..a9623992e 100644 --- a/x/inflation/types/interfaces.go +++ b/x/inflation/types/interfaces.go @@ -1,46 +1,46 @@ package types // noalias import ( + "context" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" ) // AccountKeeper defines the contract required for account APIs. type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI - GetAccount(sdk.Context, sdk.AccAddress) types.AccountI - SetAccount(sdk.Context, types.AccountI) + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI + SetAccount(context.Context, sdk.AccountI) } // BankKeeper defines the contract needed to be fulfilled for banking and supply // dependencies. type BankKeeper interface { - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error SendCoinsFromAccountToModule( - ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, + ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, ) error - MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error - HasSupply(ctx sdk.Context, denom string) bool - GetSupply(ctx sdk.Context, denom string) sdk.Coin + MintCoins(ctx context.Context, name string, amt sdk.Coins) error + BurnCoins(ctx context.Context, name string, amt sdk.Coins) error + HasSupply(ctx context.Context, denom string) bool + GetSupply(ctx context.Context, denom string) sdk.Coin } // DistrKeeper defines the contract needed to be fulfilled for distribution keeper type DistrKeeper interface { - FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error } // StakingKeeper expected staking keeper type StakingKeeper interface { // BondedRatio the fraction of the staking tokens which are currently bonded - BondedRatio(ctx sdk.Context) sdk.Dec - StakingTokenSupply(ctx sdk.Context) sdkmath.Int - TotalBondedTokens(ctx sdk.Context) sdkmath.Int + BondedRatio(ctx context.Context) (sdkmath.LegacyDec, error) + StakingTokenSupply(ctx context.Context) (sdkmath.Int, error) + TotalBondedTokens(ctx context.Context) (sdkmath.Int, error) } type SudoKeeper interface { diff --git a/x/inflation/types/msgs.go b/x/inflation/types/msgs.go index 1cb387041..48b9b424f 100644 --- a/x/inflation/types/msgs.go +++ b/x/inflation/types/msgs.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -58,11 +59,11 @@ func (m MsgEditInflationParams) ValidateBasic() error { return fmt.Errorf("inflation distribution strategic reserves should not be nil") } - sum := sdk.NewDec(0) + sum := sdkmath.LegacyNewDec(0) sum = sum.Add(m.InflationDistribution.CommunityPool) sum = sum.Add(m.InflationDistribution.StakingRewards) sum = sum.Add(m.InflationDistribution.StrategicReserves) - if !sum.Equal(sdk.OneDec()) { + if !sum.Equal(sdkmath.LegacyOneDec()) { return fmt.Errorf("inflation distribution sum should be 1, got %s", sum) } } diff --git a/x/inflation/types/params.go b/x/inflation/types/params.go index 993341bca..a7697a868 100644 --- a/x/inflation/types/params.go +++ b/x/inflation/types/params.go @@ -1,10 +1,9 @@ package types import ( + "cosmossdk.io/math" "errors" "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" ) var ( @@ -19,18 +18,18 @@ var ( var ( DefaultInflation = false - DefaultPolynomialFactors = []sdk.Dec{ - sdk.MustNewDecFromStr("-0.000147085524"), - sdk.MustNewDecFromStr("0.074291982762"), - sdk.MustNewDecFromStr("-18.867415611180"), - sdk.MustNewDecFromStr("3128.641926954698"), - sdk.MustNewDecFromStr("-334834.740631598223"), - sdk.MustNewDecFromStr("17827464.906540066004"), + DefaultPolynomialFactors = []math.LegacyDec{ + math.LegacyMustNewDecFromStr("-0.000147085524"), + math.LegacyMustNewDecFromStr("0.074291982762"), + math.LegacyMustNewDecFromStr("-18.867415611180"), + math.LegacyMustNewDecFromStr("3128.641926954698"), + math.LegacyMustNewDecFromStr("-334834.740631598223"), + math.LegacyMustNewDecFromStr("17827464.906540066004"), } DefaultInflationDistribution = InflationDistribution{ - CommunityPool: sdk.NewDecWithPrec(35_4825, 6), // 35.4825% - StakingRewards: sdk.NewDecWithPrec(28_1250, 6), // 28.1250% - StrategicReserves: sdk.NewDecWithPrec(36_3925, 6), // 36.3925% + CommunityPool: math.LegacyNewDecWithPrec(35_4825, 6), // 35.4825% + StakingRewards: math.LegacyNewDecWithPrec(28_1250, 6), // 28.1250% + StrategicReserves: math.LegacyNewDecWithPrec(36_3925, 6), // 36.3925% } DefaultEpochsPerPeriod = uint64(30) DefaultPeriodsPerYear = uint64(12) @@ -38,7 +37,7 @@ var ( ) func NewParams( - polynomialCalculation []sdk.Dec, + polynomialCalculation []math.LegacyDec, inflationDistribution InflationDistribution, inflationEnabled bool, hasInflationStarted bool, @@ -71,7 +70,7 @@ func DefaultParams() Params { } func validatePolynomialFactors(i interface{}) error { - v, ok := i.([]sdk.Dec) + v, ok := i.([]math.LegacyDec) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -101,7 +100,7 @@ func validateInflationDistribution(i interface{}) error { } totalProportions := v.StakingRewards.Add(v.StrategicReserves).Add(v.CommunityPool) - if !totalProportions.Equal(sdk.OneDec()) { + if !totalProportions.Equal(math.LegacyOneDec()) { return errors.New("total distributions ratio should be 1") } diff --git a/x/inflation/types/query.pb.go b/x/inflation/types/query.pb.go index 4b15226dc..7348237ff 100644 --- a/x/inflation/types/query.pb.go +++ b/x/inflation/types/query.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -412,7 +412,7 @@ var xxx_messageInfo_QueryInflationRateRequest proto.InternalMessageInfo // RPC method. type QueryInflationRateResponse struct { // inflation_rate by which the total supply increases within one period - InflationRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=inflation_rate,json=inflationRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"inflation_rate"` + InflationRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=inflation_rate,json=inflationRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"inflation_rate"` } func (m *QueryInflationRateResponse) Reset() { *m = QueryInflationRateResponse{} } @@ -549,50 +549,51 @@ func init() { func init() { proto.RegisterFile("nibiru/inflation/v1/query.proto", fileDescriptor_9cef9ea5e4d20e5e) } var fileDescriptor_9cef9ea5e4d20e5e = []byte{ - // 686 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00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x2f, 0x52, 0x69, 0x5b, 0x34, - 0x62, 0x62, 0xc7, 0xa3, 0x07, 0x09, 0x55, 0x71, 0x7d, 0x0d, 0x4e, 0x15, 0x56, 0x95, 0x14, 0x5c, - 0x51, 0x74, 0x17, 0x56, 0xa5, 0x5e, 0xb9, 0x07, 0xe6, 0xc1, 0xf2, 0x98, 0x67, 0xfe, 0xd5, 0xe7, - 0xa1, 0xab, 0xd3, 0x9f, 0x4a, 0x11, 0xec, 0x3e, 0x63, 0x3c, 0xde, 0x8a, 0x44, 0x8f, 0x29, 0x26, - 0x78, 0xde, 0xf0, 0x0b, 0x80, 0xb5, 0xd2, 0x14, 0xd3, 0xfd, 0x3d, 0x80, 0xd3, 0x34, 0x0d, 0xb7, - 0xbb, 0x8c, 0xc7, 0x6d, 0x99, 0x27, 0xe8, 0x61, 0x77, 0xd6, 0x67, 0x71, 0xe6, 0x10, 0x4e, 0x1d, - 0xc2, 0xc6, 0x21, 0xfc, 0x84, 0x06, 0x2d, 0xc1, 0xf8, 0x46, 0xf3, 0xf8, 0xb4, 0x56, 0xf9, 0xfa, - 0xab, 0xb6, 0x1a, 0xb2, 0x78, 0x37, 0xe9, 0xe0, 0x40, 0x74, 0x89, 0x71, 0x34, 0xfb, 0x59, 0x53, - 0x3b, 0x7b, 0x24, 0x3e, 0x94, 0x54, 0xe5, 0x35, 0xca, 0x43, 0x74, 0x48, 0x4d, 0x7d, 0x06, 0xde, - 0xd7, 0x42, 0xb7, 0xf7, 0x98, 0x94, 0x74, 0x47, 0xeb, 0x55, 0xf9, 0x36, 0x5a, 0xd0, 0xb1, 0x05, - 0xcd, 0x06, 0x16, 0xe1, 0x84, 0xca, 0x02, 0x6d, 0xdd, 0x58, 0x19, 0x9b, 0xc6, 0xd5, 0x60, 0x7a, - 0xbd, 0x06, 0xe7, 0x74, 0x93, 0x16, 0x8b, 0x82, 0x24, 0x3d, 0x4b, 0x1e, 0x6e, 0x27, 0x52, 0xee, - 0x1f, 0xe6, 0x53, 0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0x46, 0xe5, 0xaa, 0x56, 0xb9, 0x88, 0x16, 0xac, - 0x2a, 0x8b, 0xdc, 0xa2, 0x6f, 0x00, 0x4e, 0x0e, 0xc1, 0x87, 0xd6, 0xcb, 0x67, 0x96, 0xb1, 0xec, - 0x34, 0x6f, 0x54, 0x63, 0xb4, 0x12, 0xad, 0x75, 0x05, 0x2d, 0x59, 0xb5, 0x0e, 0x73, 0xaf, 0xfd, - 0x2c, 0xa0, 0x36, 0xca, 0x4f, 0x1b, 0xb0, 0xa3, 0xfc, 0xb4, 0x32, 0x7c, 0x85, 0x9f, 0x45, 0xbc, - 0x33, 0x4e, 0x34, 0x3c, 0x23, 0x39, 0x19, 0xe4, 0x76, 0x24, 0x27, 0x05, 0x94, 0xaf, 0xe2, 0x24, - 0x43, 0x78, 0xf3, 0xf8, 0xcc, 0x05, 0x27, 0x67, 0x2e, 0xf8, 0x7d, 0xe6, 0x82, 0x0f, 0xe7, 0x6e, - 0xe5, 0xe4, 0xdc, 0xad, 0xfc, 0x38, 0x77, 0x2b, 0xaf, 0xc8, 0xc0, 0xdb, 0xe6, 0xb9, 0x6e, 0xd0, - 0xda, 0xf5, 0x19, 0xcf, 0x9b, 0xbd, 0x19, 0x68, 0xa7, 0x5f, 0x3d, 0x9d, 0xaa, 0xfe, 0x74, 0x36, - 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x40, 0x82, 0x21, 0x19, 0xe9, 0x07, 0x00, 0x00, + // 700 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0x4f, 0x4f, 0x13, 0x4d, + 0x1c, 0xc7, 0xbb, 0x4f, 0x78, 0x6a, 0x1c, 0x03, 0x09, 0x03, 0x31, 0xba, 0x85, 0x2d, 0x96, 0x10, + 0x20, 0x84, 0x99, 0x94, 0x7a, 0xf1, 0x4a, 0xf1, 0x80, 0x51, 0x83, 0xe5, 0xe6, 0xa5,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xea, 0xb1, 0x5a, 0xb1, 0xd6, 0xba, 0x0e, 0x57, 0x9d, 0x5a, 0x47, 0x61, 0xd7, 0x7e, 0x0e, 0xf1, + 0x35, 0xc9, 0x4f, 0x17, 0xa5, 0x93, 0xfc, 0x74, 0x82, 0x7b, 0x8d, 0x9f, 0xc3, 0x4c, 0x1b, 0x4e, + 0x34, 0x3c, 0x13, 0x39, 0x19, 0xe4, 0x76, 0x22, 0x27, 0x43, 0x28, 0x5f, 0xc7, 0x89, 0x41, 0x78, + 0xf7, 0xe4, 0x3c, 0xf0, 0x4e, 0xcf, 0x03, 0xef, 0xd7, 0x79, 0xe0, 0xbd, 0xbf, 0x08, 0x72, 0xa7, + 0x17, 0x41, 0xee, 0xfb, 0x45, 0x90, 0x7b, 0x89, 0x07, 0xbe, 0x7e, 0xcf, 0xf5, 0x80, 0x6a, 0x2b, + 0xa4, 0x2c, 0x1b, 0xf6, 0x7a, 0x60, 0x9c, 0xfe, 0x14, 0x36, 0xf2, 0xfa, 0xf7, 0xb2, 0xf2, 0x27, + 0x00, 0x00, 0xff, 0xff, 0xa2, 0x94, 0x06, 0x83, 0xde, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/inflation/types/tx.pb.go b/x/inflation/types/tx.pb.go index 8d8a555fd..186973bb4 100644 --- a/x/inflation/types/tx.pb.go +++ b/x/inflation/types/tx.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -71,13 +71,13 @@ func (m *MsgToggleInflation) XXX_DiscardUnknown() { var xxx_messageInfo_MsgToggleInflation proto.InternalMessageInfo type MsgEditInflationParams struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - InflationEnabled bool `protobuf:"varint,2,opt,name=inflation_enabled,json=inflationEnabled,proto3" json:"inflation_enabled,omitempty"` - PolynomialFactors []github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,rep,name=polynomial_factors,json=polynomialFactors,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"polynomial_factors,omitempty"` - InflationDistribution *InflationDistribution `protobuf:"bytes,4,opt,name=inflation_distribution,json=inflationDistribution,proto3" json:"inflation_distribution,omitempty"` - EpochsPerPeriod *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=epochs_per_period,json=epochsPerPeriod,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"epochs_per_period,omitempty"` - PeriodsPerYear *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=periods_per_year,json=periodsPerYear,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"periods_per_year,omitempty"` - MaxPeriod *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=max_period,json=maxPeriod,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_period,omitempty"` + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + InflationEnabled bool `protobuf:"varint,2,opt,name=inflation_enabled,json=inflationEnabled,proto3" json:"inflation_enabled,omitempty"` + PolynomialFactors []cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,rep,name=polynomial_factors,json=polynomialFactors,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"polynomial_factors,omitempty"` + InflationDistribution *InflationDistribution `protobuf:"bytes,4,opt,name=inflation_distribution,json=inflationDistribution,proto3" json:"inflation_distribution,omitempty"` + EpochsPerPeriod *cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=epochs_per_period,json=epochsPerPeriod,proto3,customtype=cosmossdk.io/math.Int" json:"epochs_per_period,omitempty"` + PeriodsPerYear *cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=periods_per_year,json=periodsPerYear,proto3,customtype=cosmossdk.io/math.Int" json:"periods_per_year,omitempty"` + MaxPeriod *cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=max_period,json=maxPeriod,proto3,customtype=cosmossdk.io/math.Int" json:"max_period,omitempty"` } func (m *MsgEditInflationParams) Reset() { *m = MsgEditInflationParams{} } @@ -286,50 +286,51 @@ func init() { func init() { proto.RegisterFile("nibiru/inflation/v1/tx.proto", fileDescriptor_9f6843f876608d76) } var fileDescriptor_9f6843f876608d76 = []byte{ - // 686 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x31, 0x4f, 0xdb, 0x4e, - 0x1c, 0x8d, 0x49, 0xfe, 0x01, 0x0e, 0xfd, 0x0b, 0x31, 0x2d, 0x0a, 0x21, 0xb5, 0x53, 0x53, 0x95, - 0x50, 0x84, 0x4f, 0x81, 0x8d, 0xd1, 0x40, 0x25, 0x86, 0x54, 0x91, 0xd5, 0xa1, 0x45, 0xaa, 0xd0, - 0x39, 0x3e, 0xcc, 0xa9, 0xf6, 0x9d, 0x75, 0xe7, 0xa0, 0x64, 0xed, 0xd4, 0x11, 0xa9, 0x5f, 0x80, - 0xb1, 0x73, 0xd5, 0x0f, 0xc1, 0x88, 0xd4, 0xa5, 0xea, 0x10, 0x55, 0xd0, 0xa1, 0x33, 0x9f, 0xa0, - 0xb2, 0xcf, 0x31, 0x51, 0x31, 0x55, 0x61, 0x88, 0xe2, 0xbb, 0xf7, 0xfb, 0xbd, 0xf7, 0xee, 0xfc, - 0x7e, 0x06, 0x75, 0x4a, 0x1c, 0xc2, 0x7b, 0x90, 0xd0, 0x43, 0x1f, 0x45, 0x84, 0x51, 0x78, 0xdc, - 0x82, 0x51, 0xdf, 0x0c, 0x39, 0x8b, 0x98, 0x3a, 0x2f, 0x51, 0x33, 0x43, 0xcd, 0xe3, 0x56, 0xed, - 0xa1, 0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, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xc1, 0xc6, 0x47, 0x4d, 0x1b, 0x06, 0x00, 0x00, + // 692 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xb1, 0x4f, 0xdb, 0x4c, + 0x1c, 0x8d, 0x49, 0xbe, 0x00, 0x87, 0xbe, 0x0f, 0x62, 0x3e, 0x50, 0x08, 0xc1, 0x4e, 0x4d, 0x25, + 0x42, 0x11, 0x3e, 0x05, 0x36, 0xd4, 0xc9, 0x40, 0xab, 0x48, 0x4d, 0x15, 0x59, 0x5d, 0xda, 0x05, + 0x9d, 0xed, 0xc3, 0x39, 0xd5, 0xbe, 0xb3, 0x7c, 0x0e, 0x4a, 0xd6, 0x4e, 0x1d, 0x91, 0xfa, 0x0f, + 0x30, 0x76, 0xee, 0x5f, 0xc1, 0x88, 0xd4, 0xa5, 0xea, 0x10, 0x55, 0xd0, 0xa1, 0x33, 0x43, 0xe7, + 0xca, 0x3e, 0xc7, 0x44, 0x8d, 0xa9, 0xe8, 0x10, 0x29, 0x77, 0xef, 0xf7, 0x7e, 0xef, 0xdd, 0xdd, + 0xfb, 0x19, 0xd4, 0x29, 0xb1, 0x48, 0xd8, 0x87, 0x84, 0x9e, 0x7a, 0x28, 0x22, 0x8c, 0xc2, 0xb3, + 0x16, 0x8c, 0x06, 0x7a, 0x10, 0xb2, 0x88, 0xc9, 0xcb, 0x02, 0xd5, 0x33, 0x54, 0x3f, 0x6b, 0xd5, + 0xfe, 0x77, 0x99, 0xcb, 0x12, 0x1c, 0xc6, 0xff, 0x44, 0x69, 0xad, 0xee, 0x32, 0xe6, 0x7a, 0x18, + 0xa2, 0x80, 0x40, 0x44, 0x29, 0x8b, 0x92, 0x7a, 0x9e, 0xa2, 0x9b, 0x79, 0x32, 0x77, 0x5d, 0x45, + 0x91, 0x62, 0x33, 0xee, 0x33, 0x0e, 0x2d, 0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x16, 0x7f, 0x1f, 0x97, 0xad, 0xdc, 0x34, 0x4c, 0x9f, 0xbd, + 0x06, 0x1f, 0x58, 0x98, 0x5d, 0xc1, 0xe6, 0xbb, 0xcf, 0xdf, 0x3f, 0xcc, 0x6c, 0x68, 0xeb, 0x30, + 0xf7, 0x9b, 0x92, 0xb0, 0xe4, 0x8f, 0x12, 0x58, 0xce, 0x9b, 0xae, 0x9d, 0xfb, 0xd4, 0x72, 0x8a, + 0x6b, 0xfb, 0x7f, 0x51, 0x9c, 0xd9, 0x83, 0x89, 0xbd, 0x6d, 0x6d, 0x6b, 0xda, 0x1e, 0x76, 0x48, + 0xb4, 0x9b, 0x2d, 0x77, 0x03, 0x61, 0xc9, 0x07, 0xa5, 0xe4, 0x3d, 0xeb, 0xf7, 0xa9, 0xc5, 0x68, + 0xed, 0xf1, 0x9f, 0xd0, 0x4c, 0xfc, 0x51, 0x22, 0xbe, 0xae, 0xad, 0xe5, 0xde, 0x8d, 0xd5, 0x0f, + 0xa9, 0xd1, 0xbe, 0xbc, 0x56, 0xa4, 0xab, 0x6b, 0x45, 0xfa, 0x76, 0xad, 0x48, 0xe7, 0x37, 0x4a, + 0xe1, 0xea, 0x46, 0x29, 0x7c, 0xb9, 0x51, 0x0a, 0x6f, 0xa0, 0x4b, 0xa2, 0x5e, 0xdf, 0xd2, 0x6d, + 0xe6, 0xc3, 0x97, 0x09, 0xfd, 0xb0, 0x87, 0x08, 0x1d, 0xb7, 0x1a, 0x4c, 0x34, 0x8b, 0x86, 0x01, + 0xe6, 0x56, 0x39, 0xf9, 0x5e, 0xee, 0xff, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x94, 0x7e, 0xfb, + 0xdd, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1065,7 +1066,7 @@ func (m *MsgEditInflationParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.PolynomialFactors = append(m.PolynomialFactors, v) if err := m.PolynomialFactors[len(m.PolynomialFactors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1137,7 +1138,7 @@ func (m *MsgEditInflationParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.EpochsPerPeriod = &v if err := m.EpochsPerPeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1173,7 +1174,7 @@ func (m *MsgEditInflationParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.PeriodsPerYear = &v if err := m.PeriodsPerYear.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1209,7 +1210,7 @@ func (m *MsgEditInflationParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.MaxPeriod = &v if err := m.MaxPeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/oracle/genesis.go b/x/oracle/genesis.go index a6635d1eb..ccf413aef 100644 --- a/x/oracle/genesis.go +++ b/x/oracle/genesis.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/oracle/keeper" @@ -26,7 +26,7 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data *types.GenesisState panic(err) } - keeper.FeederDelegations.Insert(ctx, voter, feeder) + keeper.FeederDelegations.Set(ctx, voter, feeder) } for _, ex := range data.ExchangeRates { @@ -39,7 +39,7 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data *types.GenesisState panic(err) } - keeper.MissCounters.Insert(ctx, operator, missCounter.MissCounter) + keeper.MissCounters.Set(ctx, operator, missCounter.MissCounter) } for _, aggregatePrevote := range data.AggregateExchangeRatePrevotes { @@ -48,7 +48,7 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data *types.GenesisState panic(err) } - keeper.Prevotes.Insert(ctx, valAddr, aggregatePrevote) + keeper.Prevotes.Set(ctx, valAddr, aggregatePrevote) } for _, aggregateVote := range data.AggregateExchangeRateVotes { @@ -57,21 +57,21 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data *types.GenesisState panic(err) } - keeper.Votes.Insert(ctx, valAddr, aggregateVote) + keeper.Votes.Set(ctx, valAddr, aggregateVote) } if len(data.Pairs) > 0 { for _, tt := range data.Pairs { - keeper.WhitelistedPairs.Insert(ctx, tt) + keeper.WhitelistedPairs.Set(ctx, tt) } } else { for _, item := range data.Params.Whitelist { - keeper.WhitelistedPairs.Insert(ctx, item) + keeper.WhitelistedPairs.Set(ctx, item) } } for _, pr := range data.Rewards { - keeper.Rewards.Insert(ctx, pr.Id, pr) + keeper.Rewards.Set(ctx, pr.Id, pr) } // set last ID based on the last pair reward @@ -97,20 +97,50 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { } feederDelegations := []types.FeederDelegation{} - for _, kv := range keeper.FeederDelegations.Iterate(ctx, collections.Range[sdk.ValAddress]{}).KeyValues() { + iterFeederDelegations, err := keeper.FeederDelegations.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + keeper.Logger(ctx).Error("failed iterating feeder delegations", "error", err) + return nil + } + kvFeederDelegations, err := iterFeederDelegations.KeyValues() + if err != nil { + keeper.Logger(ctx).Error("failed getting feeder delegations key values", "error", err) + return nil + } + for _, kv := range kvFeederDelegations { feederDelegations = append(feederDelegations, types.FeederDelegation{ FeederAddress: kv.Value.String(), ValidatorAddress: kv.Key.String(), }) } + iterExchangeRates, err := keeper.ExchangeRates.Iterate(ctx, &collections.Range[asset.Pair]{}) + if err != nil { + keeper.Logger(ctx).Error("failed iterating exchange rates", "error", err) + return nil + } + kvExchangeRates, err := iterExchangeRates.KeyValues() + if err != nil { + keeper.Logger(ctx).Error("failed getting exchange rates key values", "error", err) + return nil + } exchangeRates := []types.ExchangeRateTuple{} - for _, er := range keeper.ExchangeRates.Iterate(ctx, collections.Range[asset.Pair]{}).KeyValues() { + for _, er := range kvExchangeRates { exchangeRates = append(exchangeRates, types.ExchangeRateTuple{Pair: er.Key, ExchangeRate: er.Value.ExchangeRate}) } + iterMissCounters, err := keeper.MissCounters.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + keeper.Logger(ctx).Error("failed iterating miss counters", "error", err) + return nil + } + kvMissCounters, err := iterMissCounters.KeyValues() + if err != nil { + keeper.Logger(ctx).Error("failed getting miss counters values", "error", err) + return nil + } missCounters := []types.MissCounter{} - for _, mc := range keeper.MissCounters.Iterate(ctx, collections.Range[sdk.ValAddress]{}).KeyValues() { + for _, mc := range kvMissCounters { missCounters = append(missCounters, types.MissCounter{ ValidatorAddress: mc.Key.String(), MissCounter: mc.Value, @@ -118,16 +148,60 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { } var pairs []asset.Pair - pairs = append(pairs, keeper.WhitelistedPairs.Iterate(ctx, collections.Range[asset.Pair]{}).Keys()...) + iterWhitelisterdPairs, err := keeper.WhitelistedPairs.Iterate(ctx, &collections.Range[asset.Pair]{}) + if err != nil { + keeper.Logger(ctx).Error("failed iterating exchange rates", "error", err) + return nil + } + keysWhitelisterdPairs, err := iterWhitelisterdPairs.Keys() + if err != nil { + keeper.Logger(ctx).Error("failed getting exchange rates key values", "error", err) + return nil + } + + pairs = append(pairs, keysWhitelisterdPairs...) + + iterPrevotes, err := keeper.Prevotes.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + keeper.Logger(ctx).Error("failed iterating prevotes", "error", err) + return nil + } + valuesPrevotes, err := iterPrevotes.Values() + if err != nil { + keeper.Logger(ctx).Error("failed getting prevotes values", "error", err) + return nil + } + + iterVotes, err := keeper.Votes.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + keeper.Logger(ctx).Error("failed iterating votes", "error", err) + return nil + } + valuesVotes, err := iterVotes.Values() + if err != nil { + keeper.Logger(ctx).Error("failed getting votes values", "error", err) + return nil + } + + iterRewards, err := keeper.Rewards.Iterate(ctx, &collections.Range[uint64]{}) + if err != nil { + keeper.Logger(ctx).Error("failed iterating rewards", "error", err) + return nil + } + valuesRewards, err := iterRewards.Values() + if err != nil { + keeper.Logger(ctx).Error("failed getting rewards values", "error", err) + return nil + } return types.NewGenesisState( params, exchangeRates, feederDelegations, missCounters, - keeper.Prevotes.Iterate(ctx, collections.Range[sdk.ValAddress]{}).Values(), - keeper.Votes.Iterate(ctx, collections.Range[sdk.ValAddress]{}).Values(), + valuesPrevotes, + valuesVotes, pairs, - keeper.Rewards.Iterate(ctx, collections.Range[uint64]{}).Values(), + valuesRewards, ) } diff --git a/x/oracle/integration/action/price.go b/x/oracle/integration/action/price.go index 0d80f5e10..aa46e725e 100644 --- a/x/oracle/integration/action/price.go +++ b/x/oracle/integration/action/price.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/app" "github.com/NibiruChain/nibiru/x/common/asset" diff --git a/x/oracle/keeper/ballot.go b/x/oracle/keeper/ballot.go index 7af68d545..587d11c91 100644 --- a/x/oracle/keeper/ballot.go +++ b/x/oracle/keeper/ballot.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/omap" @@ -26,7 +26,17 @@ func (k Keeper) groupVotesByPair( ) (pairVotes map[asset.Pair]types.ExchangeRateVotes) { pairVotes = map[asset.Pair]types.ExchangeRateVotes{} - for _, value := range k.Votes.Iterate(ctx, collections.Range[sdk.ValAddress]{}).KeyValues() { + iter, err := k.Votes.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate votes", "error", err) + return + } + kv, err := iter.KeyValues() + if err != nil { + k.Logger(ctx).Error("failed to get votes key values", "error", err) + return + } + for _, value := range kv { voterAddr, aggregateVote := value.Key, value.Value // skip votes from inactive validators @@ -60,10 +70,21 @@ func (k Keeper) groupVotesByPair( // clearVotesAndPrevotes clears all tallied prevotes and votes from the store func (k Keeper) clearVotesAndPrevotes(ctx sdk.Context, votePeriod uint64) { // Clear all aggregate prevotes - for _, prevote := range k.Prevotes.Iterate(ctx, collections.Range[sdk.ValAddress]{}).KeyValues() { + iterPrevotes, err := k.Prevotes.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate prevotes", "error", err) + return + } + kvPrevotes, err := iterPrevotes.KeyValues() + if err != nil { + k.Logger(ctx).Error("failed to get prevotes key values", "error", err) + return + } + + for _, prevote := range kvPrevotes { valAddr, aggregatePrevote := prevote.Key, prevote.Value if ctx.BlockHeight() >= int64(aggregatePrevote.SubmitBlock+votePeriod) { - err := k.Prevotes.Delete(ctx, valAddr) + err := k.Prevotes.Remove(ctx, valAddr) if err != nil { k.Logger(ctx).Error("failed to delete prevote", "error", err) } @@ -71,8 +92,18 @@ func (k Keeper) clearVotesAndPrevotes(ctx sdk.Context, votePeriod uint64) { } // Clear all aggregate votes - for _, valAddr := range k.Votes.Iterate(ctx, collections.Range[sdk.ValAddress]{}).Keys() { - err := k.Votes.Delete(ctx, valAddr) + iterVotes, err := k.Votes.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate votes", "error", err) + return + } + keyVotes, err := iterVotes.Keys() + if err != nil { + k.Logger(ctx).Error("failed to get votes keys", "error", err) + return + } + for _, valAddr := range keyVotes { + err := k.Votes.Remove(ctx, valAddr) if err != nil { k.Logger(ctx).Error("failed to delete vote", "error", err) } @@ -83,7 +114,7 @@ func (k Keeper) clearVotesAndPrevotes(ctx sdk.Context, votePeriod uint64) { func isPassingVoteThreshold( votes types.ExchangeRateVotes, thresholdVotingPower sdkmath.Int, minVoters uint64, ) bool { - totalPower := sdk.NewInt(votes.Power()) + totalPower := sdkmath.NewInt(votes.Power()) if totalPower.IsZero() { return false } @@ -111,8 +142,14 @@ func (k Keeper) removeInvalidVotes( pairVotes map[asset.Pair]types.ExchangeRateVotes, whitelistedPairs set.Set[asset.Pair], ) { + totalBondedTokens, err := k.StakingKeeper.TotalBondedTokens(ctx) + if err != nil { + k.Logger(ctx).Error("failed to get total bonded tokens", "error", err) + return + } + totalBondedPower := sdk.TokensToConsensusPower( - k.StakingKeeper.TotalBondedTokens(ctx), k.StakingKeeper.PowerReduction(ctx), + totalBondedTokens, k.StakingKeeper.PowerReduction(ctx), ) // Iterate through sorted keys for deterministic ordering. @@ -146,9 +183,9 @@ func (k Keeper) removeInvalidVotes( // made by the validators. func Tally( votes types.ExchangeRateVotes, - rewardBand sdk.Dec, + rewardBand sdkmath.LegacyDec, validatorPerformances types.ValidatorPerformances, -) sdk.Dec { +) sdkmath.LegacyDec { weightedMedian := votes.WeightedMedianWithAssertion() standardDeviation := votes.StandardDeviation(weightedMedian) rewardSpread := weightedMedian.Mul(rewardBand.QuoInt64(2)) diff --git a/x/oracle/keeper/ballot_test.go b/x/oracle/keeper/ballot_test.go index b66e78033..b93115387 100644 --- a/x/oracle/keeper/ballot_test.go +++ b/x/oracle/keeper/ballot_test.go @@ -1,15 +1,15 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "sort" "testing" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking" fuzz "github.com/google/gofuzz" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -35,23 +35,24 @@ func TestGroupVotesByPair(t *testing.T) { require.NoError(t, err) _, err = sh.CreateValidator(fixture.Ctx, NewTestMsgCreateValidator(ValAddrs[2], ValPubKeys[2], amt)) require.NoError(t, err) - staking.EndBlocker(fixture.Ctx, &fixture.StakingKeeper) + // TODO: fix! + //staking.EndBlocker(fixture.Ctx, &fixture.StakingKeeper) pairBtc := asset.Registry.Pair(denoms.BTC, denoms.NUSD) pairEth := asset.Registry.Pair(denoms.ETH, denoms.NUSD) btcVotes := types.ExchangeRateVotes{ - {Pair: pairBtc, ExchangeRate: sdk.NewDec(17), Voter: ValAddrs[0], Power: power}, - {Pair: pairBtc, ExchangeRate: sdk.NewDec(10), Voter: ValAddrs[1], Power: power}, - {Pair: pairBtc, ExchangeRate: sdk.NewDec(6), Voter: ValAddrs[2], Power: power}, + {Pair: pairBtc, ExchangeRate: sdkmath.LegacyNewDec(17), Voter: ValAddrs[0], Power: power}, + {Pair: pairBtc, ExchangeRate: sdkmath.LegacyNewDec(10), Voter: ValAddrs[1], Power: power}, + {Pair: pairBtc, ExchangeRate: sdkmath.LegacyNewDec(6), Voter: ValAddrs[2], Power: power}, } ethVotes := types.ExchangeRateVotes{ - {Pair: pairEth, ExchangeRate: sdk.NewDec(1_000), Voter: ValAddrs[0], Power: power}, - {Pair: pairEth, ExchangeRate: sdk.NewDec(1_300), Voter: ValAddrs[1], Power: power}, - {Pair: pairEth, ExchangeRate: sdk.NewDec(2_000), Voter: ValAddrs[2], Power: power}, + {Pair: pairEth, ExchangeRate: sdkmath.LegacyNewDec(1_000), Voter: ValAddrs[0], Power: power}, + {Pair: pairEth, ExchangeRate: sdkmath.LegacyNewDec(1_300), Voter: ValAddrs[1], Power: power}, + {Pair: pairEth, ExchangeRate: sdkmath.LegacyNewDec(2_000), Voter: ValAddrs[2], Power: power}, } for i, v := range btcVotes { - fixture.OracleKeeper.Votes.Insert( + fixture.OracleKeeper.Votes.Set( fixture.Ctx, ValAddrs[i], types.NewAggregateExchangeRateVote( @@ -107,27 +108,28 @@ func TestClearVotesAndPrevotes(t *testing.T) { require.NoError(t, err) _, err = sh.CreateValidator(fixture.Ctx, NewTestMsgCreateValidator(ValAddrs[2], ValPubKeys[2], amt)) require.NoError(t, err) - staking.EndBlocker(fixture.Ctx, &fixture.StakingKeeper) + // TODO: fix + //staking.EndBlocker(fixture.Ctx, &fixture.StakingKeeper) btcVotes := types.ExchangeRateVotes{ - types.NewExchangeRateVote(sdk.NewDec(17), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[0], power), - types.NewExchangeRateVote(sdk.NewDec(10), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[1], power), - types.NewExchangeRateVote(sdk.NewDec(6), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[2], power), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(17), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[0], power), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(10), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[1], power), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(6), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[2], power), } ethVotes := types.ExchangeRateVotes{ - types.NewExchangeRateVote(sdk.NewDec(1000), asset.Registry.Pair(denoms.ETH, denoms.NUSD), ValAddrs[0], power), - types.NewExchangeRateVote(sdk.NewDec(1300), asset.Registry.Pair(denoms.ETH, denoms.NUSD), ValAddrs[1], power), - types.NewExchangeRateVote(sdk.NewDec(2000), asset.Registry.Pair(denoms.ETH, denoms.NUSD), ValAddrs[2], power), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(1000), asset.Registry.Pair(denoms.ETH, denoms.NUSD), ValAddrs[0], power), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(1300), asset.Registry.Pair(denoms.ETH, denoms.NUSD), ValAddrs[1], power), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(2000), asset.Registry.Pair(denoms.ETH, denoms.NUSD), ValAddrs[2], power), } for i := range btcVotes { - fixture.OracleKeeper.Prevotes.Insert(fixture.Ctx, ValAddrs[i], types.AggregateExchangeRatePrevote{ + fixture.OracleKeeper.Prevotes.Set(fixture.Ctx, ValAddrs[i], types.AggregateExchangeRatePrevote{ Hash: "", Voter: ValAddrs[i].String(), SubmitBlock: uint64(fixture.Ctx.BlockHeight()), }) - fixture.OracleKeeper.Votes.Insert(fixture.Ctx, ValAddrs[i], + fixture.OracleKeeper.Votes.Set(fixture.Ctx, ValAddrs[i], types.NewAggregateExchangeRateVote(types.ExchangeRateTuples{ {Pair: btcVotes[i].Pair, ExchangeRate: btcVotes[i].ExchangeRate}, {Pair: ethVotes[i].Pair, ExchangeRate: ethVotes[i].ExchangeRate}, @@ -136,15 +138,22 @@ func TestClearVotesAndPrevotes(t *testing.T) { fixture.OracleKeeper.clearVotesAndPrevotes(fixture.Ctx, 10) - prevoteCounter := len(fixture.OracleKeeper.Prevotes.Iterate(fixture.Ctx, collections.Range[sdk.ValAddress]{}).Keys()) - voteCounter := len(fixture.OracleKeeper.Votes.Iterate(fixture.Ctx, collections.Range[sdk.ValAddress]{}).Keys()) + iterPrevotes, _ := fixture.OracleKeeper.Prevotes.Iterate(fixture.Ctx, &collections.Range[sdk.ValAddress]{}) + iterVotes, _ := fixture.OracleKeeper.Votes.Iterate(fixture.Ctx, &collections.Range[sdk.ValAddress]{}) + keysPrevotes, _ := iterPrevotes.Keys() + keysVotes, _ := iterVotes.Keys() + prevoteCounter := len(keysPrevotes) + voteCounter := len(keysVotes) require.Equal(t, prevoteCounter, 3) require.Equal(t, voteCounter, 0) // vote period starts at b=10, clear the votes at b=0 and below. fixture.OracleKeeper.clearVotesAndPrevotes(fixture.Ctx.WithBlockHeight(fixture.Ctx.BlockHeight()+10), 10) - prevoteCounter = len(fixture.OracleKeeper.Prevotes.Iterate(fixture.Ctx, collections.Range[sdk.ValAddress]{}).Keys()) + + iterPrevotes, _ = fixture.OracleKeeper.Prevotes.Iterate(fixture.Ctx, &collections.Range[sdk.ValAddress]{}) + keysPrevotes, _ = iterPrevotes.Keys() + prevoteCounter = len(keysPrevotes) require.Equal(t, prevoteCounter, 0) } @@ -152,8 +161,8 @@ func TestFuzzTally(t *testing.T) { validators := map[string]int64{} f := fuzz.New().NilChance(0).Funcs( - func(e *sdk.Dec, c fuzz.Continue) { - *e = sdk.NewDec(c.Int63()) + func(e *sdkmath.LegacyDec, c fuzz.Continue) { + *e = sdkmath.LegacyNewDec(c.Int63()) }, func(e *map[string]int64, c fuzz.Continue) { numValidators := c.Intn(100) + 5 @@ -174,7 +183,7 @@ func TestFuzzTally(t *testing.T) { for addr, power := range validators { addr, _ := sdk.ValAddressFromBech32(addr) - var rate sdk.Dec + var rate sdkmath.LegacyDec c.Fuzz(&rate) votes = append(votes, types.NewExchangeRateVote(rate, asset.NewPair(c.RandString(), c.RandString()), addr, power)) @@ -193,7 +202,7 @@ func TestFuzzTally(t *testing.T) { votes := types.ExchangeRateVotes{} f.Fuzz(&votes) - var rewardBand sdk.Dec + var rewardBand sdkmath.LegacyDec f.Fuzz(&rewardBand) require.NotPanics(t, func() { @@ -240,7 +249,7 @@ func TestRemoveInvalidBallots(t *testing.T) { name: "empty key, nonempty votes, not whitelisted", voteMap: VoteMap{ "": types.ExchangeRateVotes{ - {Pair: "", ExchangeRate: sdk.ZeroDec(), Voter: sdk.ValAddress{}, Power: 0}, + {Pair: "", ExchangeRate: sdkmath.LegacyZeroDec(), Voter: sdk.ValAddress{}, Power: 0}, }, }, }, @@ -248,13 +257,13 @@ func TestRemoveInvalidBallots(t *testing.T) { name: "nonempty key, nonempty votes, whitelisted", voteMap: VoteMap{ "x": types.ExchangeRateVotes{ - {Pair: "x", ExchangeRate: sdk.Dec{}, Voter: sdk.ValAddress{123}, Power: 5}, + {Pair: "x", ExchangeRate: sdkmath.LegacyDec{}, Voter: sdk.ValAddress{123}, Power: 5}, }, asset.Registry.Pair(denoms.BTC, denoms.NUSD): types.ExchangeRateVotes{ - {Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), ExchangeRate: sdk.Dec{}, Voter: sdk.ValAddress{123}, Power: 5}, + {Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), ExchangeRate: sdkmath.LegacyDec{}, Voter: sdk.ValAddress{123}, Power: 5}, }, asset.Registry.Pair(denoms.ETH, denoms.NUSD): types.ExchangeRateVotes{ - {Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), ExchangeRate: sdk.Dec{}, Voter: sdk.ValAddress{123}, Power: 5}, + {Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), ExchangeRate: sdkmath.LegacyDec{}, Voter: sdk.ValAddress{123}, Power: 5}, }, }, }, @@ -288,12 +297,12 @@ func TestFuzzPickReferencePair(t *testing.T) { *e = append(*e, asset.NewPair(testutil.RandLetters(5), testutil.RandLetters(5))) } }, - func(e *sdk.Dec, c fuzz.Continue) { - *e = sdk.NewDec(c.Int63()) + func(e *sdkmath.LegacyDec, c fuzz.Continue) { + *e = sdkmath.LegacyNewDec(c.Int63()) }, - func(e *map[asset.Pair]sdk.Dec, c fuzz.Continue) { + func(e *map[asset.Pair]sdkmath.LegacyDec, c fuzz.Continue) { for _, pair := range pairs { - var rate sdk.Dec + var rate sdkmath.LegacyDec c.Fuzz(&rate) (*e)[pair] = rate @@ -314,7 +323,7 @@ func TestFuzzPickReferencePair(t *testing.T) { for addr, power := range validators { addr, _ := sdk.ValAddressFromBech32(addr) - var rate sdk.Dec + var rate sdkmath.LegacyDec c.Fuzz(&rate) votes = append(votes, types.NewExchangeRateVote(rate, pair, addr, power)) @@ -350,10 +359,10 @@ func TestFuzzPickReferencePair(t *testing.T) { func TestZeroBallotPower(t *testing.T) { btcVotess := types.ExchangeRateVotes{ - types.NewExchangeRateVote(sdk.NewDec(17), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[0], 0), - types.NewExchangeRateVote(sdk.NewDec(10), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[1], 0), - types.NewExchangeRateVote(sdk.NewDec(6), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[2], 0), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(17), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[0], 0), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(10), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[1], 0), + types.NewExchangeRateVote(sdkmath.LegacyNewDec(6), asset.Registry.Pair(denoms.BTC, denoms.NUSD), ValAddrs[2], 0), } - assert.False(t, isPassingVoteThreshold(btcVotess, sdk.ZeroInt(), 0)) + assert.False(t, isPassingVoteThreshold(btcVotess, sdkmath.ZeroInt(), 0)) } diff --git a/x/oracle/keeper/hooks.go b/x/oracle/keeper/hooks.go index 69e26117d..d1f663b3b 100644 --- a/x/oracle/keeper/hooks.go +++ b/x/oracle/keeper/hooks.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" @@ -44,7 +45,7 @@ func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ uint64) balances := h.bankKeeper.GetAllBalances(ctx, account.GetAddress()) for _, balance := range balances { - oracleRewards := sdk.NewDecFromInt(balance.Amount).Mul(params.ValidatorFeeRatio).TruncateInt() + oracleRewards := sdkmath.LegacyNewDecFromInt(balance.Amount).Mul(params.ValidatorFeeRatio).TruncateInt() remainder := balance.Amount.Sub(oracleRewards) if !oracleRewards.IsZero() { diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 48f520dbd..bed6ae4bb 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -1,18 +1,21 @@ package keeper import ( + "cosmossdk.io/math" "fmt" + "github.com/NibiruChain/nibiru/x/common" + "github.com/cosmos/cosmos-sdk/runtime" "time" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdkerrors "cosmossdk.io/errors" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/oracle/types" @@ -51,7 +54,7 @@ type Keeper struct { // NewKeeper constructs a new keeper for oracle func NewKeeper( cdc codec.BinaryCodec, - storeKey storetypes.StoreKey, + storeKey *storetypes.KVStoreKey, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, @@ -66,6 +69,9 @@ func NewKeeper( panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) } + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) + k := Keeper{ cdc: cdc, storeKey: storeKey, @@ -75,18 +81,22 @@ func NewKeeper( StakingKeeper: stakingKeeper, SudoKeeper: sudoKeeper, distrModuleName: distrName, - Params: collections.NewItem(storeKey, 11, collections.ProtoValueEncoder[types.Params](cdc)), - ExchangeRates: collections.NewMap(storeKey, 1, asset.PairKeyEncoder, collections.ProtoValueEncoder[types.DatedPrice](cdc)), - PriceSnapshots: collections.NewMap(storeKey, 10, collections.PairKeyEncoder(asset.PairKeyEncoder, collections.TimeKeyEncoder), collections.ProtoValueEncoder[types.PriceSnapshot](cdc)), - FeederDelegations: collections.NewMap(storeKey, 2, collections.ValAddressKeyEncoder, collections.AccAddressValueEncoder), - MissCounters: collections.NewMap(storeKey, 3, collections.ValAddressKeyEncoder, collections.Uint64ValueEncoder), - Prevotes: collections.NewMap(storeKey, 4, collections.ValAddressKeyEncoder, collections.ProtoValueEncoder[types.AggregateExchangeRatePrevote](cdc)), - Votes: collections.NewMap(storeKey, 5, collections.ValAddressKeyEncoder, collections.ProtoValueEncoder[types.AggregateExchangeRateVote](cdc)), - WhitelistedPairs: collections.NewKeySet(storeKey, 6, asset.PairKeyEncoder), + Params: collections.NewItem(sb, collections.NewPrefix(11), storeKey.String(), codec.CollValue[types.Params](cdc)), + ExchangeRates: collections.NewMap(sb, collections.NewPrefix(1), storeKey.String(), asset.PairKeyEncoder, codec.CollValue[types.DatedPrice](cdc)), + PriceSnapshots: collections.NewMap(sb, collections.NewPrefix(10), storeKey.String(), collections.PairKeyCodec(asset.PairKeyEncoder, sdk.TimeKey), codec.CollValue[types.PriceSnapshot](cdc)), + FeederDelegations: collections.NewMap(sb, collections.NewPrefix(2), storeKey.String(), sdk.ValAddressKey, common.AccAddressValue), + MissCounters: collections.NewMap(sb, collections.NewPrefix(3), storeKey.String(), sdk.ValAddressKey, collections.Uint64Value), + Prevotes: collections.NewMap(sb, collections.NewPrefix(4), storeKey.String(), sdk.ValAddressKey, codec.CollValue[types.AggregateExchangeRatePrevote](cdc)), + Votes: collections.NewMap(sb, collections.NewPrefix(5), storeKey.String(), sdk.ValAddressKey, codec.CollValue[types.AggregateExchangeRateVote](cdc)), + WhitelistedPairs: collections.NewKeySet(sb, collections.NewPrefix(6), storeKey.String(), asset.PairKeyEncoder), Rewards: collections.NewMap( - storeKey, 7, - collections.Uint64KeyEncoder, collections.ProtoValueEncoder[types.Rewards](cdc)), - RewardsID: collections.NewSequence(storeKey, 9), + sb, + collections.NewPrefix(7), + storeKey.String(), + collections.Uint64Key, + codec.CollValue[types.Rewards](cdc), + ), + RewardsID: collections.NewSequence(sb, collections.NewPrefix(9), storeKey.String()), } return k } @@ -104,8 +114,10 @@ func (k Keeper) ValidateFeeder( // Thus, we only need to verify consent for price feeder addresses that don't // match the validator address. if !feederAddr.Equals(validatorAddr) { - delegate := k.FeederDelegations.GetOr( - ctx, validatorAddr, sdk.AccAddress(validatorAddr)) + delegate, err := k.FeederDelegations.Get(ctx, validatorAddr) + if err != nil { + delegate = sdk.AccAddress(validatorAddr) + } if !delegate.Equals(feederAddr) { return sdkerrors.Wrapf( types.ErrNoVotingPermission, @@ -114,7 +126,9 @@ func (k Keeper) ValidateFeeder( } // Check that the given validator is in the active set for consensus. - if val := k.StakingKeeper.Validator(ctx, validatorAddr); val == nil || !val.IsBonded() { + val, _ := k.StakingKeeper.Validator(ctx, validatorAddr) + + if val == nil || !val.IsBonded() { return sdkerrors.Wrapf( stakingtypes.ErrNoValidatorFound, "validator %s is not active set", validatorAddr.String()) @@ -123,25 +137,31 @@ func (k Keeper) ValidateFeeder( return nil } -func (k Keeper) GetExchangeRateTwap(ctx sdk.Context, pair asset.Pair) (price sdk.Dec, err error) { +func (k Keeper) GetExchangeRateTwap(ctx sdk.Context, pair asset.Pair) (price math.LegacyDec, err error) { params, err := k.Params.Get(ctx) if err != nil { - return sdk.OneDec().Neg(), err + return math.LegacyOneDec().Neg(), err } - snapshots := k.PriceSnapshots.Iterate( + iter, err := k.PriceSnapshots.Iterate( ctx, - collections.PairRange[asset.Pair, time.Time]{}. - Prefix(pair). + collections.NewPrefixedPairRange[asset.Pair, time.Time](pair). StartInclusive( ctx.BlockTime().Add(-1*params.TwapLookbackWindow)). EndInclusive( ctx.BlockTime()), - ).Values() + ) + if err != nil { + return math.LegacyZeroDec(), err + } + snapshots, err := iter.Values() + if err != nil { + return math.LegacyZeroDec(), err + } if len(snapshots) == 0 { // if there are no snapshots, return -1 for the price - return sdk.OneDec().Neg(), types.ErrNoValidTWAP.Wrapf("no snapshots for pair %s", pair.String()) + return math.LegacyOneDec().Neg(), types.ErrNoValidTWAP.Wrapf("no snapshots for pair %s", pair.String()) } if len(snapshots) == 1 { @@ -151,7 +171,7 @@ func (k Keeper) GetExchangeRateTwap(ctx sdk.Context, pair asset.Pair) (price sdk firstTimestampMs := snapshots[0].TimestampMs if firstTimestampMs > ctx.BlockTime().UnixMilli() { // should never happen, or else we have corrupted state - return sdk.OneDec().Neg(), types.ErrNoValidTWAP.Wrapf( + return math.LegacyOneDec().Neg(), types.ErrNoValidTWAP.Wrapf( "Possible corrupted state. First timestamp %d is after current blocktime %d", firstTimestampMs, ctx.BlockTime().UnixMilli()) } @@ -160,7 +180,7 @@ func (k Keeper) GetExchangeRateTwap(ctx sdk.Context, pair asset.Pair) (price sdk return snapshots[0].Price, nil } - cumulativePrice := sdk.ZeroDec() + cumulativePrice := math.LegacyZeroDec() for i, s := range snapshots { var nextTimestampMs int64 if i == len(snapshots)-1 { @@ -177,19 +197,19 @@ func (k Keeper) GetExchangeRateTwap(ctx sdk.Context, pair asset.Pair) (price sdk return cumulativePrice.QuoInt64(ctx.BlockTime().UnixMilli() - firstTimestampMs), nil } -func (k Keeper) GetExchangeRate(ctx sdk.Context, pair asset.Pair) (price sdk.Dec, err error) { +func (k Keeper) GetExchangeRate(ctx sdk.Context, pair asset.Pair) (price math.LegacyDec, err error) { exchangeRate, err := k.ExchangeRates.Get(ctx, pair) price = exchangeRate.ExchangeRate return } // SetPrice sets the price for a pair as well as the price snapshot. -func (k Keeper) SetPrice(ctx sdk.Context, pair asset.Pair, price sdk.Dec) { - k.ExchangeRates.Insert(ctx, pair, types.DatedPrice{ExchangeRate: price, CreatedBlock: uint64(ctx.BlockHeight())}) +func (k Keeper) SetPrice(ctx sdk.Context, pair asset.Pair, price math.LegacyDec) { + k.ExchangeRates.Set(ctx, pair, types.DatedPrice{ExchangeRate: price, CreatedBlock: uint64(ctx.BlockHeight())}) key := collections.Join(pair, ctx.BlockTime()) timestampMs := ctx.BlockTime().UnixMilli() - k.PriceSnapshots.Insert(ctx, key, types.PriceSnapshot{ + k.PriceSnapshots.Set(ctx, key, types.PriceSnapshot{ Pair: pair, Price: price, TimestampMs: timestampMs, diff --git a/x/oracle/keeper/msg_server.go b/x/oracle/keeper/msg_server.go index c21a8dcd5..bff979905 100644 --- a/x/oracle/keeper/msg_server.go +++ b/x/oracle/keeper/msg_server.go @@ -48,7 +48,7 @@ func (ms msgServer) AggregateExchangeRatePrevote( return nil, sdkerrors.Wrap(types.ErrInvalidHash, err.Error()) } - ms.Keeper.Prevotes.Insert(ctx, valAddr, types.NewAggregateExchangeRatePrevote(voteHash, valAddr, uint64(ctx.BlockHeight()))) + ms.Keeper.Prevotes.Set(ctx, valAddr, types.NewAggregateExchangeRatePrevote(voteHash, valAddr, uint64(ctx.BlockHeight()))) err = ctx.EventManager().EmitTypedEvent(&types.EventAggregatePrevote{ Validator: msg.Validator, @@ -118,10 +118,10 @@ func (ms msgServer) AggregateExchangeRateVote( } // Move aggregate prevote to aggregate vote with given exchange rates - ms.Keeper.Votes.Insert( + ms.Keeper.Votes.Set( ctx, valAddr, types.NewAggregateExchangeRateVote(exchangeRateTuples, valAddr), ) - _ = ms.Keeper.Prevotes.Delete(ctx, valAddr) + _ = ms.Keeper.Prevotes.Remove(ctx, valAddr) priceTuples, err := types.NewExchangeRateTuplesFromString(msg.ExchangeRates) if err != nil { @@ -152,13 +152,13 @@ func (ms msgServer) DelegateFeedConsent( } // Check the delegator is a validator - val := ms.StakingKeeper.Validator(ctx, operatorAddr) + val, _ := ms.StakingKeeper.Validator(ctx, operatorAddr) if val == nil { return nil, sdkerrors.Wrap(stakingtypes.ErrNoValidatorFound, msg.Operator) } // Set the delegation - ms.Keeper.FeederDelegations.Insert(ctx, operatorAddr, delegateAddr) + ms.Keeper.FeederDelegations.Set(ctx, operatorAddr, delegateAddr) err = ctx.EventManager().EmitTypedEvent(&types.EventDelegateFeederConsent{ Feeder: msg.Delegate, diff --git a/x/oracle/keeper/params.go b/x/oracle/keeper/params.go index f45f7b3fb..abdf6252a 100644 --- a/x/oracle/keeper/params.go +++ b/x/oracle/keeper/params.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/oracle/types" @@ -19,7 +20,7 @@ func (k Keeper) VotePeriod(ctx sdk.Context) (res uint64) { } // VoteThreshold returns the minimum percentage of votes that must be received for a votes to pass. -func (k Keeper) VoteThreshold(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) VoteThreshold(ctx sdk.Context) (res sdkmath.LegacyDec) { params, _ := k.Params.Get(ctx) return params.VoteThreshold } @@ -40,7 +41,7 @@ func (k Keeper) MinVoters(ctx sdk.Context) (res uint64) { // then rewards are added to the validator performance. // Note that if the reward band is smaller than 1 standard // deviation, the band is taken to be 1 standard deviation. -func (k Keeper) RewardBand(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) RewardBand(ctx sdk.Context) (res sdkmath.LegacyDec) { params, _ := k.Params.Get(ctx) return params.RewardBand } @@ -52,7 +53,7 @@ func (k Keeper) Whitelist(ctx sdk.Context) (res []asset.Pair) { } // SlashFraction returns oracle voting penalty rate -func (k Keeper) SlashFraction(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) SlashFraction(ctx sdk.Context) (res sdkmath.LegacyDec) { params, _ := k.Params.Get(ctx) return params.SlashFraction } @@ -67,7 +68,7 @@ func (k Keeper) SlashWindow(ctx sdk.Context) (res uint64) { } // MinValidPerWindow returns oracle slashing threshold -func (k Keeper) MinValidPerWindow(ctx sdk.Context) (res sdk.Dec) { +func (k Keeper) MinValidPerWindow(ctx sdk.Context) (res sdkmath.LegacyDec) { params, _ := k.Params.Get(ctx) return params.MinValidPerWindow } diff --git a/x/oracle/keeper/querier.go b/x/oracle/keeper/querier.go index 7e298c6d4..1a3ab7245 100644 --- a/x/oracle/keeper/querier.go +++ b/x/oracle/keeper/querier.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/oracle/types" @@ -84,7 +84,18 @@ func (q querier) ExchangeRates(c context.Context, _ *types.QueryExchangeRatesReq ctx := sdk.UnwrapSDKContext(c) var exchangeRates types.ExchangeRateTuples - for _, er := range q.Keeper.ExchangeRates.Iterate(ctx, collections.Range[asset.Pair]{}).KeyValues() { + iter, err := q.Keeper.ExchangeRates.Iterate(ctx, &collections.Range[asset.Pair]{}) + if err != nil { + q.Logger(ctx).Error("failed to iterate exchange rates", "error", err) + return nil, err + } + kv, err := iter.KeyValues() + if err != nil { + q.Logger(ctx).Error("failed to get exchange rates key values", "error", err) + return nil, err + } + + for _, er := range kv { exchangeRates = append(exchangeRates, types.ExchangeRateTuple{ Pair: er.Key, ExchangeRate: er.Value.ExchangeRate, @@ -96,7 +107,19 @@ func (q querier) ExchangeRates(c context.Context, _ *types.QueryExchangeRatesReq // Actives queries all pairs for which exchange rates exist func (q querier) Actives(c context.Context, _ *types.QueryActivesRequest) (*types.QueryActivesResponse, error) { - return &types.QueryActivesResponse{Actives: q.Keeper.ExchangeRates.Iterate(sdk.UnwrapSDKContext(c), collections.Range[asset.Pair]{}).Keys()}, nil + ctx := sdk.UnwrapSDKContext(c) + + iter, err := q.Keeper.ExchangeRates.Iterate(sdk.UnwrapSDKContext(c), &collections.Range[asset.Pair]{}) + if err != nil { + q.Logger(ctx).Error("failed to iterate exchange rates", "error", err) + return nil, err + } + keys, err := iter.Keys() + if err != nil { + q.Logger(ctx).Error("failed to get exchange rates keys", "error", err) + return nil, err + } + return &types.QueryActivesResponse{Actives: keys}, nil } // VoteTargets queries the voting target list on current vote period @@ -117,8 +140,12 @@ func (q querier) FeederDelegation(c context.Context, req *types.QueryFeederDeleg } ctx := sdk.UnwrapSDKContext(c) + delegations, err := q.Keeper.FeederDelegations.Get(ctx, valAddr) + if delegations == nil { + delegations = sdk.AccAddress(valAddr) + } return &types.QueryFeederDelegationResponse{ - FeederAddr: q.Keeper.FeederDelegations.GetOr(ctx, valAddr, sdk.AccAddress(valAddr)).String(), + FeederAddr: delegations.String(), }, nil } @@ -134,8 +161,12 @@ func (q querier) MissCounter(c context.Context, req *types.QueryMissCounterReque } ctx := sdk.UnwrapSDKContext(c) + missCounter, err := q.MissCounters.Get(ctx, valAddr) + if err != nil { + missCounter = 0 + } return &types.QueryMissCounterResponse{ - MissCounter: q.MissCounters.GetOr(ctx, valAddr, 0), + MissCounter: missCounter, }, nil } @@ -163,7 +194,18 @@ func (q querier) AggregatePrevote(c context.Context, req *types.QueryAggregatePr // AggregatePrevotes queries aggregate prevotes of all validators func (q querier) AggregatePrevotes(c context.Context, _ *types.QueryAggregatePrevotesRequest) (*types.QueryAggregatePrevotesResponse, error) { - return &types.QueryAggregatePrevotesResponse{AggregatePrevotes: q.Prevotes.Iterate(sdk.UnwrapSDKContext(c), collections.Range[sdk.ValAddress]{}).Values()}, nil + ctx := sdk.UnwrapSDKContext(c) + iter, err := q.Prevotes.Iterate(sdk.UnwrapSDKContext(c), &collections.Range[sdk.ValAddress]{}) + if err != nil { + q.Logger(ctx).Error("failed to iterate prevotes", "error", err) + return nil, err + } + values, err := iter.Values() + if err != nil { + q.Logger(ctx).Error("failed to get prevotes values", "error", err) + return nil, err + } + return &types.QueryAggregatePrevotesResponse{AggregatePrevotes: values}, nil } // AggregateVote queries an aggregate vote of a validator @@ -190,5 +232,16 @@ func (q querier) AggregateVote(c context.Context, req *types.QueryAggregateVoteR // AggregateVotes queries aggregate votes of all validators func (q querier) AggregateVotes(c context.Context, _ *types.QueryAggregateVotesRequest) (*types.QueryAggregateVotesResponse, error) { - return &types.QueryAggregateVotesResponse{AggregateVotes: q.Keeper.Votes.Iterate(sdk.UnwrapSDKContext(c), collections.Range[sdk.ValAddress]{}).Values()}, nil + ctx := sdk.UnwrapSDKContext(c) + iter, err := q.Keeper.Votes.Iterate(sdk.UnwrapSDKContext(c), &collections.Range[sdk.ValAddress]{}) + if err != nil { + q.Logger(ctx).Error("failed to iterate votes", "error", err) + return nil, err + } + values, err := iter.Values() + if err != nil { + q.Logger(ctx).Error("failed to get votes values", "error", err) + return nil, err + } + return &types.QueryAggregateVotesResponse{AggregateVotes: values}, nil } diff --git a/x/oracle/keeper/querier_test.go b/x/oracle/keeper/querier_test.go index de20ca86b..16fa62763 100644 --- a/x/oracle/keeper/querier_test.go +++ b/x/oracle/keeper/querier_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" diff --git a/x/oracle/keeper/reward.go b/x/oracle/keeper/reward.go index 75c1fe751..2ffb6629d 100644 --- a/x/oracle/keeper/reward.go +++ b/x/oracle/keeper/reward.go @@ -1,7 +1,8 @@ package keeper import ( - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,8 +16,8 @@ func (k Keeper) AllocateRewards(ctx sdk.Context, funderModule string, totalCoins votePeriodCoins[i] = newCoin } - id := k.RewardsID.Next(ctx) - k.Rewards.Insert(ctx, id, types.Rewards{ + id, _ := k.RewardsID.Next(ctx) + k.Rewards.Set(ctx, id, types.Rewards{ Id: id, VotePeriods: votePeriods, Coins: votePeriodCoins, @@ -42,12 +43,12 @@ func (k Keeper) rewardWinners( var distributedRewards sdk.Coins for _, validatorPerformance := range validatorPerformances { - validator := k.StakingKeeper.Validator(ctx, validatorPerformance.ValAddress) + validator, _ := k.StakingKeeper.Validator(ctx, validatorPerformance.ValAddress) if validator == nil { continue } - rewardPortion, _ := totalRewards.MulDec(sdk.NewDec(validatorPerformance.RewardWeight).QuoInt64(totalRewardWeight)).TruncateDecimal() + rewardPortion, _ := totalRewards.MulDec(sdkmath.LegacyNewDec(validatorPerformance.RewardWeight).QuoInt64(totalRewardWeight)).TruncateDecimal() k.distrKeeper.AllocateTokensToValidator(ctx, validator, sdk.NewDecCoinsFromCoins(rewardPortion...)) distributedRewards = distributedRewards.Add(rewardPortion...) } @@ -63,7 +64,18 @@ func (k Keeper) rewardWinners( func (k Keeper) GatherRewardsForVotePeriod(ctx sdk.Context) sdk.Coins { coins := sdk.NewCoins() // iterate over - for _, rewardId := range k.Rewards.Iterate(ctx, collections.Range[uint64]{}).Keys() { + iter, err := k.Rewards.Iterate(ctx, &collections.Range[uint64]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate rewards", "error", err) + return nil + } + keys, err := iter.Keys() + if err != nil { + k.Logger(ctx).Error("failed to get rewards keys", "error", err) + return nil + } + + for _, rewardId := range keys { pairReward, err := k.Rewards.Get(ctx, rewardId) if err != nil { k.Logger(ctx).Error("Failed to get reward", "err", err) @@ -75,12 +87,12 @@ func (k Keeper) GatherRewardsForVotePeriod(ctx sdk.Context) sdk.Coins { pairReward.VotePeriods -= 1 if pairReward.VotePeriods == 0 { // If the distribution period count drops to 0: the reward instance is removed. - err := k.Rewards.Delete(ctx, rewardId) + err := k.Rewards.Remove(ctx, rewardId) if err != nil { k.Logger(ctx).Error("Failed to delete pair reward", "err", err) } } else { - k.Rewards.Insert(ctx, rewardId, pairReward) + k.Rewards.Set(ctx, rewardId, pairReward) } } diff --git a/x/oracle/keeper/reward_test.go b/x/oracle/keeper/reward_test.go index fe88d7808..3ac0f1465 100644 --- a/x/oracle/keeper/reward_test.go +++ b/x/oracle/keeper/reward_test.go @@ -3,7 +3,7 @@ package keeper import ( "testing" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" diff --git a/x/oracle/keeper/slash.go b/x/oracle/keeper/slash.go index a006fb8e6..e41902328 100644 --- a/x/oracle/keeper/slash.go +++ b/x/oracle/keeper/slash.go @@ -1,9 +1,10 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" ) // SlashAndResetMissCounters do slash any operator who over criteria & clear all operators miss counter to zero @@ -13,7 +14,7 @@ func (k Keeper) SlashAndResetMissCounters(ctx sdk.Context) { // slash_window / vote_period votePeriodsPerWindow := uint64( - sdk.NewDec(int64(k.SlashWindow(ctx))). + sdkmath.LegacyNewDec(int64(k.SlashWindow(ctx))). QuoInt64(int64(k.VotePeriod(ctx))). TruncateInt64(), ) @@ -21,21 +22,37 @@ func (k Keeper) SlashAndResetMissCounters(ctx sdk.Context) { slashFraction := k.SlashFraction(ctx) powerReduction := k.StakingKeeper.PowerReduction(ctx) - for _, mc := range k.MissCounters.Iterate(ctx, collections.Range[sdk.ValAddress]{}).KeyValues() { + iter, err := k.MissCounters.Iterate(ctx, &collections.Range[sdk.ValAddress]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate miss counter", "error", err) + return + } + kv, err := iter.KeyValues() + if err != nil { + k.Logger(ctx).Error("failed to get miss counter key values", "error", err) + return + } + + for _, mc := range kv { operator := mc.Key missCounter := mc.Value // Calculate valid vote rate; (SlashWindow - MissCounter)/SlashWindow - validVoteRate := sdk.NewDecFromInt( - sdk.NewInt(int64(votePeriodsPerWindow - missCounter))). + validVoteRate := sdkmath.LegacyNewDecFromInt( + sdkmath.NewInt(int64(votePeriodsPerWindow - missCounter))). QuoInt64(int64(votePeriodsPerWindow)) // Penalize the validator whose the valid vote rate is smaller than min threshold if validVoteRate.LT(minValidPerWindow) { - validator := k.StakingKeeper.Validator(ctx, operator) + validator, err := k.StakingKeeper.Validator(ctx, operator) + if err != nil { + k.Logger(ctx).Error("failed getting staking keeper validator", "error", err) + continue + } + if validator.IsBonded() && !validator.IsJailed() { consAddr, err := validator.GetConsAddr() if err != nil { - k.Logger(ctx).Error("fail to get consensus address", "validator", validator.GetOperator().String()) + k.Logger(ctx).Error("fail to get consensus address", "validator", validator.GetOperator()) continue } @@ -43,12 +60,12 @@ func (k Keeper) SlashAndResetMissCounters(ctx sdk.Context) { ctx, consAddr, distributionHeight, validator.GetConsensusPower(powerReduction), slashFraction, ) - k.Logger(ctx).Info("slash", "validator", consAddr.String(), "fraction", slashFraction.String()) + k.Logger(ctx).Info("slash", "validator", consAddr, "fraction", slashFraction.String()) k.StakingKeeper.Jail(ctx, consAddr) } } - err := k.MissCounters.Delete(ctx, operator) + err := k.MissCounters.Remove(ctx, operator) if err != nil { k.Logger(ctx).Error("fail to delete miss counter", "operator", operator.String(), "error", err) } diff --git a/x/oracle/keeper/slash_test.go b/x/oracle/keeper/slash_test.go index bf7b86a28..a942f32fa 100644 --- a/x/oracle/keeper/slash_test.go +++ b/x/oracle/keeper/slash_test.go @@ -10,7 +10,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" diff --git a/x/oracle/keeper/test_utils.go b/x/oracle/keeper/test_utils.go index d5b94e807..4c31a3698 100644 --- a/x/oracle/keeper/test_utils.go +++ b/x/oracle/keeper/test_utils.go @@ -2,25 +2,29 @@ package keeper import ( + sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/runtime" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" "testing" "time" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/store" + storemetrics "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/types/module/testutil" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "cosmossdk.io/log" "github.com/NibiruChain/nibiru/x/common/denoms" "github.com/NibiruChain/nibiru/x/oracle/types" "github.com/NibiruChain/nibiru/x/sudo" sudokeeper "github.com/NibiruChain/nibiru/x/sudo/keeper" sudotypes "github.com/NibiruChain/nibiru/x/sudo/types" - dbm "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/secp256k1" - "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -133,20 +137,21 @@ type TestFixture struct { // CreateTestFixture nolint // Creates a base app, with 5 accounts, func CreateTestFixture(t *testing.T) TestFixture { - keyAcc := sdk.NewKVStoreKey(authtypes.StoreKey) - keyBank := sdk.NewKVStoreKey(banktypes.StoreKey) - keyParams := sdk.NewKVStoreKey(paramstypes.StoreKey) - tKeyParams := sdk.NewTransientStoreKey(paramstypes.TStoreKey) - keyOracle := sdk.NewKVStoreKey(types.StoreKey) - keyStaking := sdk.NewKVStoreKey(stakingtypes.StoreKey) - keyDistr := sdk.NewKVStoreKey(distrtypes.StoreKey) - keySudo := sdk.NewKVStoreKey(sudotypes.StoreKey) + keyAcc := storetypes.NewKVStoreKey(authtypes.StoreKey) + keyBank := storetypes.NewKVStoreKey(banktypes.StoreKey) + keyParams := storetypes.NewKVStoreKey(paramstypes.StoreKey) + tKeyParams := storetypes.NewTransientStoreKey(paramstypes.TStoreKey) + keyOracle := storetypes.NewKVStoreKey(types.StoreKey) + keyStaking := storetypes.NewKVStoreKey(stakingtypes.StoreKey) + keyDistr := storetypes.NewKVStoreKey(distrtypes.StoreKey) + keySudo := storetypes.NewKVStoreKey(sudotypes.StoreKey) db := dbm.NewMemDB() - ms := store.NewCommitMultiStore(db) + ms := store.NewCommitMultiStore(db, log.NewTestLogger(t), storemetrics.NewNoOpMetrics()) ctx := sdk.NewContext(ms, tmproto.Header{Time: time.Now().UTC(), Height: 1}, false, log.NewNopLogger()) encodingConfig := MakeEncodingConfig(t) appCodec, legacyAmino := encodingConfig.Codec, encodingConfig.Amino + logger := log.NewTestLogger(t) ms.MountStoreWithDB(keyAcc, storetypes.StoreTypeIAVL, db) ms.MountStoreWithDB(keyBank, storetypes.StoreTypeIAVL, db) @@ -174,21 +179,23 @@ func CreateTestFixture(t *testing.T) TestFixture { distrtypes.ModuleName: nil, types.ModuleName: nil, } - + govModuleAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String() accountKeeper := authkeeper.NewAccountKeeper( appCodec, - keyAcc, + runtime.NewKVStoreService(keyAcc), authtypes.ProtoBaseAccount, maccPerms, - sdk.GetConfig().GetBech32AccountAddrPrefix(), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModuleAddr, ) bankKeeper := bankkeeper.NewBaseKeeper( appCodec, - keyBank, + runtime.NewKVStoreService(keyBank), accountKeeper, blackListAddrs, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModuleAddr, + logger, ) totalSupply := sdk.NewCoins(sdk.NewCoin(denoms.NIBI, InitTokens.MulRaw(int64(len(Addrs)*10)))) @@ -196,10 +203,12 @@ func CreateTestFixture(t *testing.T) TestFixture { stakingKeeper := stakingkeeper.NewKeeper( appCodec, - keyStaking, + runtime.NewKVStoreService(keyStaking), accountKeeper, bankKeeper, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + govModuleAddr, + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), + authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()), ) stakingParams := stakingtypes.DefaultParams() @@ -208,18 +217,20 @@ func CreateTestFixture(t *testing.T) TestFixture { distrKeeper := distrkeeper.NewKeeper( appCodec, - keyDistr, + runtime.NewKVStoreService(keyDistr), accountKeeper, bankKeeper, stakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - distrKeeper.SetFeePool(ctx, distrtypes.InitialFeePool()) + // TODO: set fee pool properly + //distrKeeper.SetFeePool(ctx, distrtypes.InitialFeePool()) distrParams := distrtypes.DefaultParams() - distrParams.CommunityTax = sdk.NewDecWithPrec(2, 2) - distrParams.BaseProposerReward = sdk.NewDecWithPrec(1, 2) - distrParams.BonusProposerReward = sdk.NewDecWithPrec(4, 2) - distrKeeper.SetParams(ctx, distrParams) + distrParams.CommunityTax = sdkmath.LegacyNewDecWithPrec(2, 2) + distrParams.BaseProposerReward = sdkmath.LegacyNewDecWithPrec(1, 2) + distrParams.BonusProposerReward = sdkmath.LegacyNewDecWithPrec(4, 2) + // TODO: set params properly + //distrKeeper.SetParams(ctx, distrParams) stakingKeeper.SetHooks(stakingtypes.NewMultiStakingHooks(distrKeeper.Hooks())) feeCollectorAcc := authtypes.NewEmptyModuleAccount(authtypes.FeeCollectorName) @@ -260,7 +271,7 @@ func CreateTestFixture(t *testing.T) TestFixture { defaults := types.DefaultParams() for _, pair := range defaults.Whitelist { - keeper.WhitelistedPairs.Insert(ctx, pair) + keeper.WhitelistedPairs.Set(ctx, pair) } keeper.Params.Set(ctx, defaults) @@ -276,12 +287,12 @@ func CreateTestFixture(t *testing.T) TestFixture { // NewTestMsgCreateValidator test msg creator func NewTestMsgCreateValidator( - address sdk.ValAddress, pubKey cryptotypes.PubKey, amt sdk.Int, + address sdk.ValAddress, pubKey cryptotypes.PubKey, amt sdkmath.Int, ) *stakingtypes.MsgCreateValidator { - commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) + commission := stakingtypes.NewCommissionRates(sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()) msg, _ := stakingtypes.NewMsgCreateValidator( - address, pubKey, sdk.NewCoin(denoms.NIBI, amt), - stakingtypes.Description{}, commission, sdk.OneInt(), + address.String(), pubKey, sdk.NewCoin(denoms.NIBI, amt), + stakingtypes.Description{}, commission, sdkmath.OneInt(), ) return msg @@ -305,7 +316,7 @@ func AllocateRewards(t *testing.T, input TestFixture, rewards sdk.Coins, votePer var ( testStakingAmt = sdk.TokensFromConsensusPower(10, sdk.DefaultPowerReduction) - testExchangeRate = sdk.NewDec(1700) + testExchangeRate = sdkmath.LegacyNewDec(1700) ) func Setup(t *testing.T) (TestFixture, types.MsgServer) { @@ -333,7 +344,8 @@ func Setup(t *testing.T) (TestFixture, types.MsgServer) { require.NoError(t, err) _, err = sh.CreateValidator(fixture.Ctx, NewTestMsgCreateValidator(ValAddrs[4], ValPubKeys[4], testStakingAmt)) require.NoError(t, err) - staking.EndBlocker(fixture.Ctx, &fixture.StakingKeeper) + // TODO: check the endblocker + //staking.EndBlocker(fixture.Ctx, &fixture.StakingKeeper) return fixture, h } diff --git a/x/oracle/keeper/update_exchange_rates.go b/x/oracle/keeper/update_exchange_rates.go index dff65f9dc..f4b5e31b0 100644 --- a/x/oracle/keeper/update_exchange_rates.go +++ b/x/oracle/keeper/update_exchange_rates.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/omap" @@ -54,9 +54,13 @@ func (k Keeper) incrementMissCounters( ) { for _, validatorPerformance := range validatorPerformances { if int(validatorPerformance.MissCount) > 0 { - k.MissCounters.Insert( + missCounters, err := k.MissCounters.Get(ctx, validatorPerformance.ValAddress) + if err != nil { + missCounters = uint64(0) + } + k.MissCounters.Set( ctx, validatorPerformance.ValAddress, - k.MissCounters.GetOr(ctx, validatorPerformance.ValAddress, 0)+uint64(validatorPerformance.MissCount), + missCounters+uint64(validatorPerformance.MissCount), ) k.Logger(ctx).Info("vote miss", "validator", validatorPerformance.ValAddress.String()) @@ -111,13 +115,25 @@ func (k Keeper) getPairVotes( func (k Keeper) clearExchangeRates(ctx sdk.Context, pairVotes map[asset.Pair]types.ExchangeRateVotes) { params, _ := k.Params.Get(ctx) - for _, key := range k.ExchangeRates.Iterate(ctx, collections.Range[asset.Pair]{}).Keys() { + iter, err := k.ExchangeRates.Iterate(ctx, &collections.Range[asset.Pair]{}) + defer iter.Close() + + if err != nil { + k.Logger(ctx).Error("failed to iterate exchange rates", "error", err) + return + } + keys, err := iter.Keys() + if err != nil { + k.Logger(ctx).Error("failed to get exchange rate keys", "error", err) + return + } + for _, key := range keys { _, isValid := pairVotes[key] previousExchangeRate, _ := k.ExchangeRates.Get(ctx, key) isExpired := previousExchangeRate.CreatedBlock+params.ExpirationBlocks <= uint64(ctx.BlockHeight()) if isValid || isExpired { - err := k.ExchangeRates.Delete(ctx, key) + err := k.ExchangeRates.Remove(ctx, key) if err != nil { k.Logger(ctx).Error("failed to delete exchange rate", "pair", key.String(), "error", err) } @@ -130,14 +146,28 @@ func (k Keeper) clearExchangeRates(ctx sdk.Context, pairVotes map[asset.Pair]typ func (k Keeper) newValidatorPerformances(ctx sdk.Context) types.ValidatorPerformances { validatorPerformances := make(map[string]types.ValidatorPerformance) - maxValidators := k.StakingKeeper.MaxValidators(ctx) + maxValidators, err := k.StakingKeeper.MaxValidators(ctx) + if err != nil { + k.Logger(ctx).Error("failed getting max validators", "error", err) + return validatorPerformances + } + powerReduction := k.StakingKeeper.PowerReduction(ctx) - iterator := k.StakingKeeper.ValidatorsPowerStoreIterator(ctx) + iterator, err := k.StakingKeeper.ValidatorsPowerStoreIterator(ctx) + if err != nil { + k.Logger(ctx).Error("failed getting validators power store iterator", "error", err) + return validatorPerformances + } + defer iterator.Close() for i := 0; iterator.Valid() && i < int(maxValidators); iterator.Next() { - validator := k.StakingKeeper.Validator(ctx, iterator.Value()) + validator, err := k.StakingKeeper.Validator(ctx, iterator.Value()) + if err != nil { + k.Logger(ctx).Error("failed getting validator", "error", err) + return validatorPerformances + } // exclude not bonded if !validator.IsBonded() { @@ -145,8 +175,8 @@ func (k Keeper) newValidatorPerformances(ctx sdk.Context) types.ValidatorPerform } valAddr := validator.GetOperator() - validatorPerformances[valAddr.String()] = types.NewValidatorPerformance( - validator.GetConsensusPower(powerReduction), valAddr, + validatorPerformances[valAddr] = types.NewValidatorPerformance( + validator.GetConsensusPower(powerReduction), sdk.ValAddress(valAddr), ) i++ } diff --git a/x/oracle/keeper/update_exchange_rates_test.go b/x/oracle/keeper/update_exchange_rates_test.go index f82c33f6b..b3c36cfd0 100644 --- a/x/oracle/keeper/update_exchange_rates_test.go +++ b/x/oracle/keeper/update_exchange_rates_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" diff --git a/x/oracle/keeper/whitelist.go b/x/oracle/keeper/whitelist.go index f1662c19e..5fb288e45 100644 --- a/x/oracle/keeper/whitelist.go +++ b/x/oracle/keeper/whitelist.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/set" @@ -11,12 +11,23 @@ import ( // IsWhitelistedPair returns existence of a pair in the voting target list func (k Keeper) IsWhitelistedPair(ctx sdk.Context, pair asset.Pair) bool { - return k.WhitelistedPairs.Has(ctx, pair) + pairs, _ := k.WhitelistedPairs.Has(ctx, pair) + return pairs } // GetWhitelistedPairs returns the whitelisted pairs list on current vote period func (k Keeper) GetWhitelistedPairs(ctx sdk.Context) []asset.Pair { - return k.WhitelistedPairs.Iterate(ctx, collections.Range[asset.Pair]{}).Keys() + iter, err := k.WhitelistedPairs.Iterate(ctx, &collections.Range[asset.Pair]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate whitelister pairs", "error", err) + return nil + } + keys, err := iter.Keys() + if err != nil { + k.Logger(ctx).Error("failed to get whitelisted pairs keys", "error", err) + return nil + } + return keys } // refreshWhitelist updates the whitelist by detecting possible changes between @@ -37,11 +48,21 @@ func (k Keeper) refreshWhitelist(ctx sdk.Context, nextWhitelist []asset.Pair, cu } if updateRequired { - for _, p := range k.WhitelistedPairs.Iterate(ctx, collections.Range[asset.Pair]{}).Keys() { - k.WhitelistedPairs.Delete(ctx, p) + iter, err := k.WhitelistedPairs.Iterate(ctx, &collections.Range[asset.Pair]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate whitelister pairs", "error", err) + return + } + keys, err := iter.Keys() + if err != nil { + k.Logger(ctx).Error("failed to get whitelisted pairs keys", "error", err) + return + } + for _, p := range keys { + k.WhitelistedPairs.Remove(ctx, p) } for _, pair := range nextWhitelist { - k.WhitelistedPairs.Insert(ctx, pair) + k.WhitelistedPairs.Set(ctx, pair) } } } diff --git a/x/oracle/keeper/whitelist_test.go b/x/oracle/keeper/whitelist_test.go index 6061d73e3..8f5f4737e 100644 --- a/x/oracle/keeper/whitelist_test.go +++ b/x/oracle/keeper/whitelist_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" diff --git a/x/oracle/module.go b/x/oracle/module.go index d69df8fdc..105bf6353 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -144,10 +144,10 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock returns the begin blocker for the oracle module. -func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (AppModule) BeginBlock(_ sdk.Context) {} // EndBlock returns the end blocker for the oracle module. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context) []abci.ValidatorUpdate { EndBlocker(ctx, am.keeper) return []abci.ValidatorUpdate{} } @@ -168,7 +168,7 @@ func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.Weight } // RegisterStoreDecoder registers a decoder for oracle module's types -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) } @@ -179,3 +179,13 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp am.accountKeeper, am.bankKeeper, am.keeper, ) } + +func (am AppModule) IsOnePerModuleType() { + //TODO implement me + panic("implement me") +} + +func (am AppModule) IsAppModule() { + //TODO implement me + panic("implement me") +} diff --git a/x/oracle/simulation/decoder.go b/x/oracle/simulation/decoder.go index 25935f631..e7fa97715 100644 --- a/x/oracle/simulation/decoder.go +++ b/x/oracle/simulation/decoder.go @@ -2,13 +2,14 @@ package simulation import ( "fmt" + "github.com/NibiruChain/nibiru/x/common" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" gogotypes "github.com/cosmos/gogoproto/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/oracle/types" ) @@ -19,7 +20,9 @@ func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { return func(kvA, kvB kv.Pair) string { switch kvA.Key[0] { case 1: - return fmt.Sprintf("%v\n%v", collections.DecValueEncoder.Decode(kvA.Value), collections.DecValueEncoder.Decode(kvB.Value)) + kvAValue, _ := common.LegacyDecValue.Decode(kvA.Value) + kvBValue, _ := common.LegacyDecValue.Decode(kvB.Value) + return fmt.Sprintf("%v\n%v", kvAValue, kvBValue) case 2: return fmt.Sprintf("%v\n%v", sdk.AccAddress(kvA.Value), sdk.AccAddress(kvB.Value)) case 3: @@ -38,8 +41,8 @@ func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { cdc.MustUnmarshal(kvB.Value, &voteB) return fmt.Sprintf("%v\n%v", voteA, voteB) case 6: - _, a := collections.StringKeyEncoder.Decode(kvA.Key[1:]) - _, b := collections.StringKeyEncoder.Decode(kvB.Key[1:]) + _, a, _ := collections.StringKey.Decode(kvA.Key[1:]) + _, b, _ := collections.StringKey.Decode(kvB.Key[1:]) return fmt.Sprintf("%s\n%s", a, b) default: panic(fmt.Sprintf("invalid oracle key prefix %X", kvA.Key[:1])) diff --git a/x/oracle/simulation/genesis.go b/x/oracle/simulation/genesis.go index 4ad41260f..e63c60259 100644 --- a/x/oracle/simulation/genesis.go +++ b/x/oracle/simulation/genesis.go @@ -3,6 +3,7 @@ package simulation // DONTCOVER import ( + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" "math/rand" @@ -10,7 +11,6 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/NibiruChain/nibiru/x/oracle/types" @@ -31,13 +31,13 @@ func GenVotePeriod(r *rand.Rand) uint64 { } // GenVoteThreshold randomized VoteThreshold -func GenVoteThreshold(r *rand.Rand) sdk.Dec { - return sdk.NewDecWithPrec(333, 3).Add(sdk.NewDecWithPrec(int64(r.Intn(333)), 3)) +func GenVoteThreshold(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyNewDecWithPrec(333, 3).Add(sdkmath.LegacyNewDecWithPrec(int64(r.Intn(333)), 3)) } // GenRewardBand randomized RewardBand -func GenRewardBand(r *rand.Rand) sdk.Dec { - return sdk.ZeroDec().Add(sdk.NewDecWithPrec(int64(r.Intn(100)), 3)) +func GenRewardBand(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyZeroDec().Add(sdkmath.LegacyNewDecWithPrec(int64(r.Intn(100)), 3)) } // GenRewardDistributionWindow randomized RewardDistributionWindow @@ -46,8 +46,8 @@ func GenRewardDistributionWindow(r *rand.Rand) uint64 { } // GenSlashFraction randomized SlashFraction -func GenSlashFraction(r *rand.Rand) sdk.Dec { - return sdk.ZeroDec().Add(sdk.NewDecWithPrec(int64(r.Intn(100)), 3)) +func GenSlashFraction(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyZeroDec().Add(sdkmath.LegacyNewDecWithPrec(int64(r.Intn(100)), 3)) } // GenSlashWindow randomized SlashWindow @@ -56,39 +56,39 @@ func GenSlashWindow(r *rand.Rand) uint64 { } // GenMinValidPerWindow randomized MinValidPerWindow -func GenMinValidPerWindow(r *rand.Rand) sdk.Dec { - return sdk.ZeroDec().Add(sdk.NewDecWithPrec(int64(r.Intn(500)), 3)) +func GenMinValidPerWindow(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyZeroDec().Add(sdkmath.LegacyNewDecWithPrec(int64(r.Intn(500)), 3)) } // RandomizedGenState generates a random GenesisState for oracle func RandomizedGenState(simState *module.SimulationState) { - var voteThreshold sdk.Dec + var voteThreshold sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, voteThresholdKey, &voteThreshold, simState.Rand, + voteThresholdKey, &voteThreshold, simState.Rand, func(r *rand.Rand) { voteThreshold = GenVoteThreshold(r) }, ) - var rewardBand sdk.Dec + var rewardBand sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, rewardBandKey, &rewardBand, simState.Rand, + rewardBandKey, &rewardBand, simState.Rand, func(r *rand.Rand) { rewardBand = GenRewardBand(r) }, ) - var slashFraction sdk.Dec + var slashFraction sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, slashFractionKey, &slashFraction, simState.Rand, + slashFractionKey, &slashFraction, simState.Rand, func(r *rand.Rand) { slashFraction = GenSlashFraction(r) }, ) var slashWindow uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, slashWindowKey, &slashWindow, simState.Rand, + slashWindowKey, &slashWindow, simState.Rand, func(r *rand.Rand) { slashWindow = GenSlashWindow(r) }, ) - var minValidPerWindow sdk.Dec + var minValidPerWindow sdkmath.LegacyDec simState.AppParams.GetOrGenerate( - simState.Cdc, minValidPerWindowKey, &minValidPerWindow, simState.Rand, + minValidPerWindowKey, &minValidPerWindow, simState.Rand, func(r *rand.Rand) { minValidPerWindow = GenMinValidPerWindow(r) }, ) @@ -108,7 +108,7 @@ func RandomizedGenState(simState *module.SimulationState) { MinValidPerWindow: minValidPerWindow, }, []types.ExchangeRateTuple{ - {Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), ExchangeRate: sdk.NewDec(20_000)}, + {Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), ExchangeRate: sdkmath.LegacyNewDec(20_000)}, }, []types.FeederDelegation{}, []types.MissCounter{}, diff --git a/x/oracle/simulation/operations.go b/x/oracle/simulation/operations.go index 6db5cf5be..9acfa5d88 100644 --- a/x/oracle/simulation/operations.go +++ b/x/oracle/simulation/operations.go @@ -3,6 +3,7 @@ package simulation // DONTCOVER import ( + sdkmath "cosmossdk.io/math" "math/rand" "strings" @@ -51,19 +52,19 @@ func WeightedOperations( weightMsgAggregateExchangeRateVote int weightMsgDelegateFeedConsent int ) - appParams.GetOrGenerate(cdc, OpWeightMsgAggregateExchangeRatePrevote, &weightMsgAggregateExchangeRatePrevote, nil, + appParams.GetOrGenerate(OpWeightMsgAggregateExchangeRatePrevote, &weightMsgAggregateExchangeRatePrevote, nil, func(_ *rand.Rand) { weightMsgAggregateExchangeRatePrevote = params.DefaultWeightMsgSend * 2 }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgAggregateExchangeRateVote, &weightMsgAggregateExchangeRateVote, nil, + appParams.GetOrGenerate(OpWeightMsgAggregateExchangeRateVote, &weightMsgAggregateExchangeRateVote, nil, func(_ *rand.Rand) { weightMsgAggregateExchangeRateVote = params.DefaultWeightMsgSend * 2 }, ) - appParams.GetOrGenerate(cdc, OpWeightMsgDelegateFeedConsent, &weightMsgDelegateFeedConsent, nil, + appParams.GetOrGenerate(OpWeightMsgDelegateFeedConsent, &weightMsgDelegateFeedConsent, nil, func(_ *rand.Rand) { weightMsgDelegateFeedConsent = params.DefaultWeightMsgDelegate // TODO: temp fix }, @@ -95,21 +96,24 @@ func SimulateMsgAggregateExchangeRatePrevote(ak types.AccountKeeper, bk types.Ba address := sdk.ValAddress(simAccount.Address) // ensure the validator exists - val := k.StakingKeeper.Validator(ctx, address) + val, _ := k.StakingKeeper.Validator(ctx, address) if val == nil || !val.IsBonded() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAggregateExchangeRatePrevote, "unable to find validator"), nil, nil } exchangeRatesStr := "" for _, pair := range whitelist { - price := sdk.NewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10000)), int64(1)) + price := sdkmath.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 10000)), int64(1)) exchangeRatesStr += price.String() + pair.String() + "," } exchangeRatesStr = strings.TrimRight(exchangeRatesStr, ",") voteHash := types.GetAggregateVoteHash(salt, exchangeRatesStr, address) - feederAddr := k.FeederDelegations.GetOr(ctx, address, sdk.AccAddress(address)) + feederAddr, err := k.FeederDelegations.Get(ctx, address) + if err != nil { + feederAddr = sdk.AccAddress(address) + } feederSimAccount, _ := simtypes.FindAccount(accs, feederAddr) feederAccount := ak.GetAccount(ctx, feederAddr) @@ -145,7 +149,7 @@ func SimulateMsgAggregateExchangeRatePrevote(ak types.AccountKeeper, bk types.Ba voteHashMap[address.String()] = exchangeRatesStr - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } @@ -159,7 +163,7 @@ func SimulateMsgAggregateExchangeRateVote(ak types.AccountKeeper, bk types.BankK address := sdk.ValAddress(simAccount.Address) // ensure the validator exists - val := k.StakingKeeper.Validator(ctx, address) + val, _ := k.StakingKeeper.Validator(ctx, address) if val == nil || !val.IsBonded() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAggregateExchangeRateVote, "unable to find validator"), nil, nil } @@ -181,7 +185,10 @@ func SimulateMsgAggregateExchangeRateVote(ak types.AccountKeeper, bk types.BankK return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgAggregateExchangeRateVote, "reveal period of submitted vote do not match with registered prevote"), nil, nil } - feederAddr := k.FeederDelegations.GetOr(ctx, address, sdk.AccAddress(address)) + feederAddr, err := k.FeederDelegations.Get(ctx, address) + if err != nil { + feederAddr = sdk.AccAddress(address) + } feederSimAccount, _ := simtypes.FindAccount(accs, feederAddr) feederAccount := ak.GetAccount(ctx, feederAddr) spendableCoins := bk.SpendableCoins(ctx, feederAddr) @@ -214,7 +221,7 @@ func SimulateMsgAggregateExchangeRateVote(ak types.AccountKeeper, bk types.BankK return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } @@ -231,13 +238,13 @@ func SimulateMsgDelegateFeedConsent(ak types.AccountKeeper, bk types.BankKeeper, account := ak.GetAccount(ctx, simAccount.Address) // ensure the validator exists - val := k.StakingKeeper.Validator(ctx, valAddress) + val, _ := k.StakingKeeper.Validator(ctx, valAddress) if val == nil { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDelegateFeedConsent, "unable to find validator"), nil, nil } // ensure the target address is not a validator - val2 := k.StakingKeeper.Validator(ctx, delegateValAddress) + val2, _ := k.StakingKeeper.Validator(ctx, delegateValAddress) if val2 != nil { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDelegateFeedConsent, "unable to delegate to validator"), nil, nil } @@ -271,6 +278,6 @@ func SimulateMsgDelegateFeedConsent(ak types.AccountKeeper, bk types.BankKeeper, return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } diff --git a/x/oracle/types/ballot.go b/x/oracle/types/ballot.go index 7081caef1..4b97a43ea 100644 --- a/x/oracle/types/ballot.go +++ b/x/oracle/types/ballot.go @@ -1,6 +1,7 @@ package types import ( + "cosmossdk.io/math" "encoding/json" "sort" @@ -16,13 +17,13 @@ import ( // ExchangeRateVote is a convenience wrapper to reduce redundant lookup cost type ExchangeRateVote struct { Pair asset.Pair - ExchangeRate sdk.Dec // aka price + ExchangeRate math.LegacyDec // aka price Voter sdk.ValAddress Power int64 // how much tendermint consensus power this vote should have } // NewExchangeRateVote returns a new ExchangeRateVote instance -func NewExchangeRateVote(rate sdk.Dec, pair asset.Pair, voter sdk.ValAddress, power int64) ExchangeRateVote { +func NewExchangeRateVote(rate math.LegacyDec, pair asset.Pair, voter sdk.ValAddress, power int64) ExchangeRateVote { return ExchangeRateVote{ ExchangeRate: rate, Pair: pair, @@ -35,8 +36,8 @@ func NewExchangeRateVote(rate sdk.Dec, pair asset.Pair, voter sdk.ValAddress, po type ExchangeRateVotes []ExchangeRateVote // ToMap return organized exchange rate map by validator -func (pb ExchangeRateVotes) ToMap() map[string]sdk.Dec { - validatorExchangeRateMap := make(map[string]sdk.Dec) +func (pb ExchangeRateVotes) ToMap() map[string]math.LegacyDec { + validatorExchangeRateMap := make(map[string]math.LegacyDec) for _, vote := range pb { if vote.ExchangeRate.IsPositive() { validatorExchangeRateMap[string(vote.Voter)] = vote.ExchangeRate @@ -47,7 +48,7 @@ func (pb ExchangeRateVotes) ToMap() map[string]sdk.Dec { } // ToCrossRate return cross_rate(base/exchange_rate) votes -func (pb ExchangeRateVotes) ToCrossRate(bases map[string]sdk.Dec) (cb ExchangeRateVotes) { +func (pb ExchangeRateVotes) ToCrossRate(bases map[string]math.LegacyDec) (cb ExchangeRateVotes) { for i := range pb { vote := pb[i] @@ -55,7 +56,7 @@ func (pb ExchangeRateVotes) ToCrossRate(bases map[string]sdk.Dec) (cb ExchangeRa vote.ExchangeRate = exchangeRateRT.Quo(vote.ExchangeRate) } else { // If we can't get reference exchange rate, we just convert the vote as abstain vote - vote.ExchangeRate = sdk.ZeroDec() + vote.ExchangeRate = math.LegacyZeroDec() vote.Power = 0 } @@ -88,7 +89,7 @@ func (v ExchangeRateVotes) Power() int64 { // WeightedMedian returns the median weighted by the power of the ExchangeRateVote. // CONTRACT: votes must be sorted -func (votes ExchangeRateVotes) WeightedMedian() sdk.Dec { +func (votes ExchangeRateVotes) WeightedMedian() math.LegacyDec { totalPower := votes.Power() if votes.Len() > 0 { pivot := int64(0) @@ -101,11 +102,11 @@ func (votes ExchangeRateVotes) WeightedMedian() sdk.Dec { } } } - return sdk.ZeroDec() + return math.LegacyZeroDec() } // WeightedMedianWithAssertion returns the median weighted by the power of the ExchangeRateVote. -func (pb ExchangeRateVotes) WeightedMedianWithAssertion() sdk.Dec { +func (pb ExchangeRateVotes) WeightedMedianWithAssertion() math.LegacyDec { sort.Sort(pb) totalPower := pb.Power() if pb.Len() > 0 { @@ -119,22 +120,22 @@ func (pb ExchangeRateVotes) WeightedMedianWithAssertion() sdk.Dec { } } } - return sdk.ZeroDec() + return math.LegacyZeroDec() } // StandardDeviation returns the standard deviation by the power of the ExchangeRateVote. -func (pb ExchangeRateVotes) StandardDeviation(median sdk.Dec) (standardDeviation sdk.Dec) { +func (pb ExchangeRateVotes) StandardDeviation(median math.LegacyDec) (standardDeviation math.LegacyDec) { if len(pb) == 0 { - return sdk.ZeroDec() + return math.LegacyZeroDec() } defer func() { if e := recover(); e != nil { - standardDeviation = sdk.ZeroDec() + standardDeviation = math.LegacyZeroDec() } }() - sum := sdk.ZeroDec() + sum := math.LegacyZeroDec() n := 0 for _, v := range pb { // ignore abstain votes in std dev calculation @@ -149,7 +150,7 @@ func (pb ExchangeRateVotes) StandardDeviation(median sdk.Dec) (standardDeviation standardDeviation, err := common.SqrtDec(variance) if err != nil { - return sdk.ZeroDec() + return math.LegacyZeroDec() } return diff --git a/x/oracle/types/ballot_test.go b/x/oracle/types/ballot_test.go index 9a2e5fbb0..bf556ff05 100644 --- a/x/oracle/types/ballot_test.go +++ b/x/oracle/types/ballot_test.go @@ -1,6 +1,7 @@ package types_test import ( + sdkmath "cosmossdk.io/math" "fmt" "math" "sort" @@ -29,19 +30,19 @@ func TestExchangeRateVotesToMap(t *testing.T) { { Voter: sdk.ValAddress(secp256k1.GenPrivKey().PubKey().Address()), Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), - ExchangeRate: sdk.NewDec(1600), + ExchangeRate: sdkmath.LegacyNewDec(1600), Power: 100, }, { Voter: sdk.ValAddress(secp256k1.GenPrivKey().PubKey().Address()), Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), - ExchangeRate: sdk.ZeroDec(), + ExchangeRate: sdkmath.LegacyZeroDec(), Power: 100, }, { Voter: sdk.ValAddress(secp256k1.GenPrivKey().PubKey().Address()), Pair: asset.Registry.Pair(denoms.BTC, denoms.NUSD), - ExchangeRate: sdk.NewDec(1500), + ExchangeRate: sdkmath.LegacyNewDec(1500), Power: 100, }, }, @@ -66,24 +67,24 @@ func TestExchangeRateVotesToMap(t *testing.T) { func TestToCrossRate(t *testing.T) { data := []struct { - base sdk.Dec - quote sdk.Dec - expected sdk.Dec + base sdkmath.LegacyDec + quote sdkmath.LegacyDec + expected sdkmath.LegacyDec }{ { - base: sdk.NewDec(1600), - quote: sdk.NewDec(100), - expected: sdk.NewDec(16), + base: sdkmath.LegacyNewDec(1600), + quote: sdkmath.LegacyNewDec(100), + expected: sdkmath.LegacyNewDec(16), }, { - base: sdk.ZeroDec(), - quote: sdk.NewDec(100), - expected: sdk.NewDec(16), + base: sdkmath.LegacyZeroDec(), + quote: sdkmath.LegacyNewDec(100), + expected: sdkmath.LegacyNewDec(16), }, { - base: sdk.NewDec(1600), - quote: sdk.ZeroDec(), - expected: sdk.NewDec(16), + base: sdkmath.LegacyNewDec(1600), + quote: sdkmath.LegacyZeroDec(), + expected: sdkmath.LegacyNewDec(16), }, } @@ -101,7 +102,7 @@ func TestToCrossRate(t *testing.T) { if !data.base.IsZero() && !data.quote.IsZero() { cb = append(cb, types.NewExchangeRateVote(data.base.Quo(data.quote), asset.Registry.Pair(denoms.BTC, denoms.NUSD), valAddr, 100)) } else { - cb = append(cb, types.NewExchangeRateVote(sdk.ZeroDec(), asset.Registry.Pair(denoms.BTC, denoms.NUSD), valAddr, 0)) + cb = append(cb, types.NewExchangeRateVote(sdkmath.LegacyZeroDec(), asset.Registry.Pair(denoms.BTC, denoms.NUSD), valAddr, 0)) } } @@ -112,15 +113,15 @@ func TestToCrossRate(t *testing.T) { } func TestSqrt(t *testing.T) { - num := sdk.NewDecWithPrec(144, 4) + num := sdkmath.LegacyNewDecWithPrec(144, 4) floatNum, err := strconv.ParseFloat(num.String(), 64) require.NoError(t, err) floatNum = math.Sqrt(floatNum) - num, err = sdk.NewDecFromStr(fmt.Sprintf("%f", floatNum)) + num, err = sdkmath.LegacyNewDecFromStr(fmt.Sprintf("%f", floatNum)) require.NoError(t, err) - require.Equal(t, sdk.NewDecWithPrec(12, 2), num) + require.Equal(t, sdkmath.LegacyNewDecWithPrec(12, 2), num) } func TestPBPower(t *testing.T) { @@ -130,9 +131,10 @@ func TestPBPower(t *testing.T) { totalPower := int64(0) for i := 0; i < len(sk.Validators()); i++ { - power := sk.Validator(ctx, valAccAddrs[i]).GetConsensusPower(sdk.DefaultPowerReduction) + val, _ := sk.Validator(ctx, valAccAddrs[i]) + power := val.GetConsensusPower(sdk.DefaultPowerReduction) vote := types.NewExchangeRateVote( - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), asset.Registry.Pair(denoms.ETH, denoms.NUSD), valAccAddrs[i], power, @@ -151,7 +153,7 @@ func TestPBPower(t *testing.T) { pubKey := secp256k1.GenPrivKey().PubKey() faceValAddr := sdk.ValAddress(pubKey.Address()) fakeVote := types.NewExchangeRateVote( - sdk.OneDec(), + sdkmath.LegacyOneDec(), asset.Registry.Pair(denoms.ETH, denoms.NUSD), faceValAddr, 0, @@ -166,42 +168,42 @@ func TestPBWeightedMedian(t *testing.T) { inputs []int64 weights []int64 isValidator []bool - median sdk.Dec + median sdkmath.LegacyDec }{ { // Supermajority one number []int64{1, 2, 10, 100000}, []int64{1, 1, 100, 1}, []bool{true, true, true, true}, - sdk.NewDec(10), + sdkmath.LegacyNewDec(10), }, { // Adding fake validator doesn't change outcome []int64{1, 2, 10, 100000, 10000000000}, []int64{1, 1, 100, 1, 10000}, []bool{true, true, true, true, false}, - sdk.NewDec(10), + sdkmath.LegacyNewDec(10), }, { // Tie votes []int64{1, 2, 3, 4}, []int64{1, 100, 100, 1}, []bool{true, true, true, true}, - sdk.NewDec(2), + sdkmath.LegacyNewDec(2), }, { // No votes []int64{}, []int64{}, []bool{true, true, true, true}, - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), }, { // not sorted []int64{2, 1, 10, 100000}, []int64{1, 1, 100, 1}, []bool{true, true, true, true}, - sdk.NewDec(10), + sdkmath.LegacyNewDec(10), }, } @@ -216,7 +218,7 @@ func TestPBWeightedMedian(t *testing.T) { } vote := types.NewExchangeRateVote( - sdk.NewDec(int64(input)), + sdkmath.LegacyNewDec(int64(input)), asset.Registry.Pair(denoms.ETH, denoms.NUSD), valAddr, power, @@ -235,42 +237,42 @@ func TestPBStandardDeviation(t *testing.T) { inputs []float64 weights []int64 isValidator []bool - standardDeviation sdk.Dec + standardDeviation sdkmath.LegacyDec }{ { // Supermajority one number []float64{1.0, 2.0, 10.0, 100000.0}, []int64{1, 1, 100, 1}, []bool{true, true, true, true}, - sdk.MustNewDecFromStr("49995.000362536000000000"), + sdkmath.LegacyMustNewDecFromStr("49995.000362536000000000"), }, { // Adding fake validator doesn't change outcome []float64{1.0, 2.0, 10.0, 100000.0, 10000000000}, []int64{1, 1, 100, 1, 10000}, []bool{true, true, true, true, false}, - sdk.MustNewDecFromStr("4472135950.751005519000000000"), + sdkmath.LegacyMustNewDecFromStr("4472135950.751005519000000000"), }, { // Tie votes []float64{1.0, 2.0, 3.0, 4.0}, []int64{1, 100, 100, 1}, []bool{true, true, true, true}, - sdk.MustNewDecFromStr("1.224744871000000000"), + sdkmath.LegacyMustNewDecFromStr("1.224744871000000000"), }, { // No votes []float64{}, []int64{}, []bool{true, true, true, true}, - sdk.NewDecWithPrec(0, 0), + sdkmath.LegacyNewDecWithPrec(0, 0), }, { // Abstain votes are ignored []float64{1.0, 2.0, 10.0, 100000.0, -99999999999.0, 0}, []int64{1, 1, 100, 1, 1, 1}, []bool{true, true, true, true, true, true}, - sdk.MustNewDecFromStr("49995.000362536000000000"), + sdkmath.LegacyMustNewDecFromStr("49995.000362536000000000"), }, } @@ -286,7 +288,7 @@ func TestPBStandardDeviation(t *testing.T) { } vote := types.NewExchangeRateVote( - sdk.NewDecWithPrec(int64(input*base), int64(types.OracleDecPrecision)), + sdkmath.LegacyNewDecWithPrec(int64(input*base), int64(types.OracleDecPrecision)), asset.Registry.Pair(denoms.ETH, denoms.NUSD), valAddr, power, @@ -301,11 +303,11 @@ func TestPBStandardDeviation(t *testing.T) { func TestPBStandardDeviationOverflow(t *testing.T) { valAddr := sdk.ValAddress(secp256k1.GenPrivKey().PubKey().Address()) - exchangeRate, err := sdk.NewDecFromStr("100000000000000000000000000000000000000000000000000000000.0") + exchangeRate, err := sdkmath.LegacyNewDecFromStr("100000000000000000000000000000000000000000000000000000000.0") require.NoError(t, err) pb := types.ExchangeRateVotes{types.NewExchangeRateVote( - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), asset.Registry.Pair(denoms.ETH, denoms.NUSD), valAddr, 2, @@ -316,7 +318,7 @@ func TestPBStandardDeviationOverflow(t *testing.T) { 1, )} - require.Equal(t, sdk.ZeroDec(), pb.StandardDeviation(pb.WeightedMedianWithAssertion())) + require.Equal(t, sdkmath.LegacyZeroDec(), pb.StandardDeviation(pb.WeightedMedianWithAssertion())) } func TestNewClaim(t *testing.T) { diff --git a/x/oracle/types/event.pb.go b/x/oracle/types/event.pb.go index fb48c177f..8fef316f8 100644 --- a/x/oracle/types/event.pb.go +++ b/x/oracle/types/event.pb.go @@ -4,8 +4,8 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -27,9 +27,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Emitted when a price is posted type EventPriceUpdate struct { - Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` - TimestampMs int64 `protobuf:"varint,3,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` + Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` + TimestampMs int64 `protobuf:"varint,3,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` } func (m *EventPriceUpdate) Reset() { *m = EventPriceUpdate{} } @@ -358,39 +358,40 @@ func init() { func init() { proto.RegisterFile("nibiru/oracle/v1/event.proto", fileDescriptor_94ec441b793fc0ea) } var fileDescriptor_94ec441b793fc0ea = []byte{ - // 510 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xdd, 0x6e, 0xd3, 0x30, - 0x14, 0x6e, 0xe8, 0x56, 0x51, 0xb7, 0x48, 0x93, 0x05, 0xa8, 0x94, 0x2e, 0xdd, 0x3a, 0x09, 0xf5, - 0x02, 0x12, 0x0d, 0x9e, 0x80, 0xb6, 0xdb, 0xdd, 0x50, 0x15, 0xc1, 0x26, 0x71, 0x53, 0xb9, 0xc9, - 0x99, 0x6b, 0x91, 0xd8, 0x91, 0xed, 0x26, 0xe3, 0x29, 0xe0, 0x1d, 0xb8, 0xe3, 0x49, 0x76, 0xb9, - 0x4b, 0xc4, 0xc5, 0x40, 0xed, 0x8b, 0x20, 0x3b, 0xee, 0xf8, 0xd9, 0x05, 0xd2, 0xae, 0x72, 0xfc, - 0x7d, 0x9f, 0xbf, 0x7c, 0xc9, 0x39, 0x07, 0xf5, 0x38,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, - 0x0d, 0xe0, 0xc7, 0xa8, 0x71, 0x6e, 0xe5, 0x55, 0xca, 0xc8, 0x9d, 0x06, 0x5f, 0x3c, 0x84, 0xad, - 0xe9, 0x6b, 0x4a, 0xa5, 0x75, 0x3d, 0x15, 0x1a, 0xee, 0x66, 0x86, 0xcf, 0x50, 0xc3, 0x7e, 0x8c, - 0x49, 0x5f, 0x1f, 0xb6, 0x5e, 0x1e, 0x04, 0xff, 0x36, 0x2a, 0x38, 0xba, 0x88, 0x17, 0x84, 0x53, - 0x88, 0x88, 0x86, 0xb7, 0xcb, 0x3c, 0x85, 0x51, 0xd7, 0xfc, 0xaf, 0xaf, 0x3f, 0xfa, 0xf8, 0x16, - 0xa5, 0x22, 0x67, 0x37, 0x38, 0x41, 0x8f, 0xfe, 0x0e, 0x39, 0x95, 0x50, 0xdc, 0x39, 0xe7, 0x60, - 0xe5, 0xa1, 0x27, 0xd6, 0xef, 0x74, 0x23, 0x9d, 0x82, 0x3c, 0x17, 0x32, 0x23, 0x3c, 0xfe, 0x9f, - 0xe7, 0x3e, 0x6a, 0x17, 0x42, 0x33, 0x4e, 0x67, 0xb9, 0x28, 0x9d, 0x73, 0x3d, 0x6a, 0x55, 0xd8, - 0xd4, 0x40, 0xf8, 0x00, 0x3d, 0x90, 0x50, 0x12, 0x99, 0xcc, 0x4a, 0x60, 0x74, 0xa1, 0x5d, 0x2f, - 0xdb, 0x15, 0x78, 0x66, 0x31, 0xfc, 0x14, 0x35, 0x4b, 0xc6, 0x67, 0xb1, 0x58, 0x72, 0xdd, 0xd9, - 0xb2, 0x82, 0xfb, 0x25, 0xe3, 0x63, 0x73, 0x36, 0x0e, 0x64, 0xae, 0x34, 0xb9, 0x11, 0x6c, 0x57, - 0x0e, 0x0e, 0xac, 0x44, 0xbb, 0x08, 0x65, 0x4c, 0x29, 0xa7, 0x68, 0x58, 0x45, 0xd3, 0x20, 0x96, - 0x1e, 0x1d, 0x5f, 0xae, 0x7c, 0xef, 0x6a, 0xe5, 0x7b, 0x3f, 0x57, 0xbe, 0xf7, 0x79, 0xed, 0xd7, - 0xae, 0xd6, 0x7e, 0xed, 0xdb, 0xda, 0xaf, 0xbd, 0x7f, 0xfe, 0xc7, 0x64, 0xbe, 0xb1, 0x0d, 0x1a, - 0x2f, 0x08, 0xe3, 0xa1, 0xdb, 0xa1, 0x8b, 0xcd, 0x16, 0xd9, 0x19, 0x9d, 0x37, 0xec, 0x3a, 0xbc, - 0xfa, 0x15, 0x00, 0x00, 0xff, 0xff, 0x5f, 0xd7, 0x9a, 0x89, 0x93, 0x03, 0x00, 0x00, + // 514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xc1, 0x6e, 0x13, 0x3d, + 0x14, 0x85, 0x33, 0x7f, 0xda, 0xe8, 0x8f, 0x13, 0xa4, 0xca, 0x02, 0x14, 0xd2, 0x74, 0xd2, 0x26, + 0x9b, 0x2c, 0xd0, 0x8c, 0x0a, 0x2b, 0x96, 0x24, 0x6d, 0x57, 0x14, 0x45, 0x23, 0x68, 0x25, 0x36, + 0x91, 0x33, 0xb9, 0x75, 0x2c, 0x32, 0xbe, 0x23, 0xdb, 0x99, 0x69, 0xf7, 0x3c, 0x00, 0xef, 0xc0, + 0x8e, 0x27, 0xe9, 0xb2, 0x4b, 0xc4, 0xa2, 0xa0, 0xe4, 0x45, 0x90, 0x3d, 0x93, 0x22, 0xe8, 0x02, + 0xa9, 0x3b, 0xfb, 0x3b, 0xc7, 0x27, 0x27, 0x73, 0x75, 0x49, 0x47, 0x8a, 0xa9, 0x50, 0xcb, 0x10, + 0x15, 0x8b, 0x17, 0x10, 0x66, 0x87, 0x21, 0x64, 0x20, 0x4d, 0x90, 0x2a, 0x34, 0x48, 0x77, 0x0a, + 0x35, 0x28, 0xd4, 0x20, 0x3b, 0x6c, 0xef, 0xdd, 0xf3, 0x97, 0x9a, 0x7b, 0xd0, 0x7e,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xb9, 0x59, 0x1d, 0x73, 0x95, 0x82, 0x9e, + 0xd6, 0xdc, 0x0e, 0xbc, 0xfc, 0x15, 0x00, 0x00, 0xff, 0xff, 0x14, 0x1c, 0xae, 0x7e, 0x88, 0x03, + 0x00, 0x00, } func (m *EventPriceUpdate) Marshal() (dAtA []byte, err error) { diff --git a/x/oracle/types/expected_keeper.go b/x/oracle/types/expected_keeper.go index 0d53c0395..22537888a 100644 --- a/x/oracle/types/expected_keeper.go +++ b/x/oracle/types/expected_keeper.go @@ -1,45 +1,47 @@ package types import ( + "context" + "cosmossdk.io/core/store" + "cosmossdk.io/math" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // StakingKeeper is expected keeper for staking module type StakingKeeper interface { - Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI // get validator by operator address; nil when validator not found - TotalBondedTokens(sdk.Context) sdkmath.Int // total bonded tokens within the validator set - Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdkmath.Int // slash the validator and delegators of the validator, specifying offense height, offense power, and slash fraction - Jail(sdk.Context, sdk.ConsAddress) // jail a validator - ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator // an iterator for the current validator power store - MaxValidators(sdk.Context) uint32 // MaxValidators returns the maximum amount of bonded validators - PowerReduction(ctx sdk.Context) (res sdkmath.Int) + Validator(ctx context.Context, address sdk.ValAddress) (stakingtypes.ValidatorI, error) // get validator by operator address; nil when validator not found + TotalBondedTokens(context.Context) (sdkmath.Int, error) // total bonded tokens within the validator set + Slash(context.Context, sdk.ConsAddress, int64, int64, math.LegacyDec) (sdkmath.Int, error) // slash the validator and delegators of the validator, specifying offense height, offense power, and slash fraction + Jail(context.Context, sdk.ConsAddress) error // jail a validator + ValidatorsPowerStoreIterator(ctx context.Context) (store.Iterator, error) // an iterator for the current validator power store + MaxValidators(context.Context) (uint32, error) // MaxValidators returns the maximum amount of bonded validators + PowerReduction(ctx context.Context) (res sdkmath.Int) } // DistributionKeeper is expected keeper for distribution module type DistributionKeeper interface { - AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) + AllocateTokensToValidator(ctx context.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) error // only used for simulation - GetValidatorOutstandingRewardsCoins(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins + GetValidatorOutstandingRewardsCoins(ctx context.Context, val sdk.ValAddress) (sdk.DecCoins, error) } // AccountKeeper is expected keeper for auth module type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI // only used for simulation + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI // only used for simulation } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromModuleToModule(ctx context.Context, senderModule string, recipientModule string, amt sdk.Coins) error // only used for simulation - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins } type SudoKeeper interface { diff --git a/x/oracle/types/msgs.go b/x/oracle/types/msgs.go index 317566226..771cee390 100644 --- a/x/oracle/types/msgs.go +++ b/x/oracle/types/msgs.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto/tmhash" "github.com/cosmos/cosmos-sdk/types/errors" @@ -139,7 +140,7 @@ func (msg MsgAggregateExchangeRateVote) ValidateBasic() error { for _, exchangeRate := range exchangeRates { // Check overflow bit length - if exchangeRate.ExchangeRate.BigInt().BitLen() > 255+sdk.DecimalPrecisionBits { + if exchangeRate.ExchangeRate.BigInt().BitLen() > 255+sdkmath.LegacyDecimalPrecisionBits { return sdkerrors.Wrap(ErrInvalidExchangeRate, "overflow") } } diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index fc2b10c6d..8b3e233ad 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -4,9 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -36,7 +36,7 @@ type Params struct { VotePeriod uint64 `protobuf:"varint,1,opt,name=vote_period,json=votePeriod,proto3" json:"vote_period,omitempty" yaml:"vote_period"` // VoteThreshold specifies the minimum proportion of votes that must be // received for a ballot to pass. - VoteThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=vote_threshold,json=voteThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_threshold" yaml:"vote_threshold"` + VoteThreshold cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=vote_threshold,json=voteThreshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"vote_threshold" yaml:"vote_threshold"` // RewardBand defines a maxium divergence that a price vote can have from the // weighted median in the ballot. If a vote lies within the valid range // defined by: @@ -45,20 +45,20 @@ type Params struct { // then rewards are added to the validator performance. // Note that if the reward band is smaller than 1 standard // deviation, the band is taken to be 1 standard deviation.a price - RewardBand github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=reward_band,json=rewardBand,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_band" yaml:"reward_band"` + RewardBand cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=reward_band,json=rewardBand,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_band" yaml:"reward_band"` // The set of whitelisted markets, or asset pairs, for the module. // Ex. '["unibi:uusd","ubtc:uusd"]' Whitelist []github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,4,rep,name=whitelist,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"whitelist,omitempty" yaml:"whitelist"` // SlashFraction returns the proportion of an oracle's stake that gets // slashed in the event of slashing. `SlashFraction` specifies the exact // penalty for failing a voting period. - SlashFraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_fraction,json=slashFraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction" yaml:"slash_fraction"` + SlashFraction cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=slash_fraction,json=slashFraction,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slash_fraction" yaml:"slash_fraction"` // SlashWindow returns the number of voting periods that specify a // "slash window". After each slash window, all oracles that have missed more // than the penalty threshold are slashed. Missing the penalty threshold is // synonymous with submitting fewer valid votes than `MinValidPerWindow`. - SlashWindow uint64 `protobuf:"varint,6,opt,name=slash_window,json=slashWindow,proto3" json:"slash_window,omitempty" yaml:"slash_window"` - MinValidPerWindow github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=min_valid_per_window,json=minValidPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_valid_per_window" yaml:"min_valid_per_window"` + SlashWindow uint64 `protobuf:"varint,6,opt,name=slash_window,json=slashWindow,proto3" json:"slash_window,omitempty" yaml:"slash_window"` + MinValidPerWindow cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=min_valid_per_window,json=minValidPerWindow,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_valid_per_window" yaml:"min_valid_per_window"` // Amount of time to look back for TWAP calculations. // Ex: "900.000000069s" corresponds to 900 seconds and 69 nanoseconds in JSON. TwapLookbackWindow time.Duration `protobuf:"bytes,8,opt,name=twap_lookback_window,json=twapLookbackWindow,proto3,stdduration" json:"twap_lookback_window,omitempty" yaml:"twap_lookback_window"` @@ -66,8 +66,8 @@ type Params struct { // considered a passing ballot. Recommended at least 4. MinVoters uint64 `protobuf:"varint,9,opt,name=min_voters,json=minVoters,proto3" json:"min_voters,omitempty" yaml:"min_voters"` // The validator fee ratio that is given to validators every epoch. - ValidatorFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=validator_fee_ratio,json=validatorFeeRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"validator_fee_ratio" yaml:"validator_fee_ratio"` - ExpirationBlocks uint64 `protobuf:"varint,11,opt,name=expiration_blocks,json=expirationBlocks,proto3" json:"expiration_blocks,omitempty" yaml:"expiration_blocks"` + ValidatorFeeRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=validator_fee_ratio,json=validatorFeeRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"validator_fee_ratio" yaml:"validator_fee_ratio"` + ExpirationBlocks uint64 `protobuf:"varint,11,opt,name=expiration_blocks,json=expirationBlocks,proto3" json:"expiration_blocks,omitempty" yaml:"expiration_blocks"` } func (m *Params) Reset() { *m = Params{} } @@ -221,7 +221,7 @@ var xxx_messageInfo_AggregateExchangeRateVote proto.InternalMessageInfo // ExchangeRateTuple - struct to store interpreted exchange rates data to store type ExchangeRateTuple struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair" yaml:"pair"` - ExchangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exchange_rate,json=exchangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchange_rate" yaml:"exchange_rate"` + ExchangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=exchange_rate,json=exchangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchange_rate" yaml:"exchange_rate"` } func (m *ExchangeRateTuple) Reset() { *m = ExchangeRateTuple{} } @@ -257,8 +257,8 @@ func (m *ExchangeRateTuple) XXX_DiscardUnknown() { var xxx_messageInfo_ExchangeRateTuple proto.InternalMessageInfo type DatedPrice struct { - ExchangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=exchange_rate,json=exchangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchange_rate" yaml:"exchange_rate"` - CreatedBlock uint64 `protobuf:"varint,2,opt,name=created_block,json=createdBlock,proto3" json:"created_block,omitempty" yaml:"created_block"` + ExchangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=exchange_rate,json=exchangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchange_rate" yaml:"exchange_rate"` + CreatedBlock uint64 `protobuf:"varint,2,opt,name=created_block,json=createdBlock,proto3" json:"created_block,omitempty" yaml:"created_block"` } func (m *DatedPrice) Reset() { *m = DatedPrice{} } @@ -379,69 +379,68 @@ func init() { func init() { proto.RegisterFile("nibiru/oracle/v1/oracle.proto", fileDescriptor_43d45df86ea09ed4) } var fileDescriptor_43d45df86ea09ed4 = []byte{ - // 979 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xe6, 0x57, 0xe3, 0xb1, 0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0x76, 0xd6, 0xb2, 0x9e, 0x9c, 0xb7, 0x6a, 0xcf, 0xcf, - 0x5b, 0xb5, 0x5f, 0xcf, 0x5b, 0xb5, 0xaf, 0xef, 0xff, 0xd3, 0x30, 0x98, 0x2f, 0x19, 0x5d, 0xa5, - 0x60, 0x49, 0x5f, 0xc0, 0xef, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x73, 0x48, 0x19, 0x08, 0xe7, - 0x08, 0x00, 0x00, + // 975 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xf6, 0xe6, 0xab, 0xf1, 0xd8, 0x29, 0xc9, 0x34, 0x85, 0x4d, 0x5a, 0xbc, 0x61, 0x2a, 0xa1, + 0x1c, 0xaa, 0x5d, 0xa5, 0x80, 0x10, 0x01, 0x0e, 0x75, 0x43, 0x44, 0xa4, 0x0a, 0x59, 0xa3, 0x0a, + 0xa4, 0x0a, 0xc9, 0xcc, 0xee, 0x4e, 0x76, 0x47, 0xd9, 0xdd, 0x31, 0x33, 0xe3, 0x7c, 0xfc, 0x03, + 0x8e, 0x3d, 0xa1, 0x1c, 0x73, 0x46, 0xe2, 0xc8, 0x7f, 0xe8, 0xb1, 0x47, 0xd4, 0xc3, 0x16, 0x12, + 0x0e, 0x88, 0xa3, 0x7f, 0x01, 0x9a, 0xd9, 0x49, 0xec, 0xc4, 0x96, 0xb0, 0x2a, 0x6e, 0x7e, 0xdf, + 0x67, 0xe6, 0x79, 0xbf, 0x9e, 0x9d, 0xd7, 0xe0, 0xfd, 0x82, 0x85, 0x4c, 0xf4, 0x03, 0x2e, 0x48, + 0x94, 0xd1, 0xe0, 0x70, 0xcb, 0xfe, 0xf2, 0x7b, 0x82, 0x2b, 0x0e, 0x97, 0x2b, 0xd8, 0xb7, 0xce, + 0xc3, 0xad, 0xf5, 0xd5, 0x84, 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x44, 0x24, 0xc1, 0x2d, 0x6c, + 0xd6, 0x8a, 0x84, 0xb7, 0xc1, 0x0c, 0xb3, 0x4b, 0x14, 0xcf, 0xb0, 0x18, 0x7e, 0x00, 0x9a, 0x23, + 0x0b, 0x54, 0x56, 0xc4, 0xb8, 0x31, 0x5c, 0xa3, 0x12, 0x7e, 0x02, 0xe6, 0xf5, 0x66, 0x96, 0xee, + 0xac, 0x91, 0xe2, 0x9a, 0x5f, 0xd5, 0xe3, 0xeb, 0xdd, 0xed, 0xdb, 0xdd, 0xed, 0x3f, 0xe1, 0xac, + 0x68, 0xcf, 0xe9, 0x8a, 0x71, 0x75, 0xba, 0xbd, 0xfb, 0xf2, 0xbc, 0xe5, 0xbc, 0x3a, 0x6f, 0x39, + 0x7f, 0x9c, 0xb7, 0x9c, 0x17, 0x17, 0xad, 0xda, 0xab, 0x8b, 0x56, 0xed, 0xf7, 0x8b, 0x56, 0xed, + 0xf9, 0xc3, 0xff, 0x1a, 0xbb, 0xfd, 0xf3, 0xa1, 0x4e, 0x7a, 0x54, 0x86, 0x0b, 0xe6, 0x7d, 0xfd, + 0xe8, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, 0x04, 0x07, 0xb8, 0x9a, 0x08, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index c072f3a3a..b111716c3 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -1,6 +1,7 @@ package types import ( + "cosmossdk.io/math" "fmt" time "time" @@ -8,8 +9,6 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" - - sdk "github.com/cosmos/cosmos-sdk/types" ) // Parameter keys @@ -37,8 +36,8 @@ const ( // Default parameter values var ( - DefaultVoteThreshold = sdk.OneDec().Quo(sdk.NewDec(3)) // 33.33% - DefaultRewardBand = sdk.NewDecWithPrec(2, 2) // 2% (-1, 1) + DefaultVoteThreshold = math.LegacyOneDec().Quo(math.LegacyNewDec(3)) // 33.33% + DefaultRewardBand = math.LegacyNewDecWithPrec(2, 2) // 2% (-1, 1) DefaultWhitelist = []asset.Pair{ // paired against the US fiat dollar asset.Registry.Pair(denoms.BTC, denoms.USD), @@ -52,10 +51,10 @@ var ( // asset.Registry.Pair(denoms.SOL, denoms.USD), // asset.Registry.Pair(denoms.ADA, denoms.USD), } - DefaultSlashFraction = sdk.NewDecWithPrec(5, 3) // 0.5% - DefaultMinValidPerWindow = sdk.NewDecWithPrec(69, 2) // 69% - DefaultTwapLookbackWindow = time.Duration(15 * time.Minute) // 15 minutes - DefaultValidatorFeeRatio = sdk.NewDecWithPrec(5, 2) // 0.05% + DefaultSlashFraction = math.LegacyNewDecWithPrec(5, 3) // 0.5% + DefaultMinValidPerWindow = math.LegacyNewDecWithPrec(69, 2) // 69% + DefaultTwapLookbackWindow = time.Duration(15 * time.Minute) // 15 minutes + DefaultValidatorFeeRatio = math.LegacyNewDecWithPrec(5, 2) // 0.05% ) // DefaultParams creates default oracle module parameters @@ -87,7 +86,7 @@ func (p Params) Validate() error { return fmt.Errorf("oracle parameter VotePeriod must be > 0, is %d", p.VotePeriod) } - if p.VoteThreshold.LTE(sdk.NewDecWithPrec(33, 2)) { + if p.VoteThreshold.LTE(math.LegacyNewDecWithPrec(33, 2)) { return fmt.Errorf("oracle parameter VoteThreshold must be greater than 33 percent") } @@ -95,11 +94,11 @@ func (p Params) Validate() error { return fmt.Errorf("oracle parameter MinVoters must be greater than 0") } - if p.RewardBand.GT(sdk.OneDec()) || p.RewardBand.IsNegative() { + if p.RewardBand.GT(math.LegacyOneDec()) || p.RewardBand.IsNegative() { return fmt.Errorf("oracle parameter RewardBand must be between [0, 1]") } - if p.SlashFraction.GT(sdk.OneDec()) || p.SlashFraction.IsNegative() { + if p.SlashFraction.GT(math.LegacyOneDec()) || p.SlashFraction.IsNegative() { return fmt.Errorf("oracle parameter SlashFraction must be between [0, 1]") } @@ -107,11 +106,11 @@ func (p Params) Validate() error { return fmt.Errorf("oracle parameter SlashWindow must be greater than or equal with VotePeriod") } - if p.MinValidPerWindow.GT(sdk.OneDec()) || p.MinValidPerWindow.IsNegative() { + if p.MinValidPerWindow.GT(math.LegacyOneDec()) || p.MinValidPerWindow.IsNegative() { return fmt.Errorf("oracle parameter MinValidPerWindow must be between [0, 1]") } - if p.ValidatorFeeRatio.GT(sdk.OneDec()) || p.ValidatorFeeRatio.IsNegative() { + if p.ValidatorFeeRatio.GT(math.LegacyOneDec()) || p.ValidatorFeeRatio.IsNegative() { return fmt.Errorf("oracle parameter ValidatorFeeRatio must be between [0, 1]") } diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 3d82a1d37..71c335131 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -5,10 +5,10 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -76,7 +76,7 @@ var xxx_messageInfo_QueryExchangeRateRequest proto.InternalMessageInfo // Query/ExchangeRate RPC method. type QueryExchangeRateResponse struct { // exchange_rate defines the exchange rate of assets voted by validators - ExchangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=exchange_rate,json=exchangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchange_rate"` + ExchangeRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=exchange_rate,json=exchangeRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchange_rate"` } func (m *QueryExchangeRateResponse) Reset() { *m = QueryExchangeRateResponse{} } @@ -987,77 +987,77 @@ func init() { func init() { proto.RegisterFile("nibiru/oracle/v1/query.proto", fileDescriptor_16aef2382d1249a8) } var fileDescriptor_16aef2382d1249a8 = []byte{ - // 1105 bytes of a gzipped FileDescriptorProto + // 1109 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0x3d, 0x50, 0x52, 0x18, 0xc7, 0xae, 0x33, 0x04, 0x91, 0x6e, 0x13, 0xbb, 0x2c, 0x4d, - 0xd4, 0x36, 0xc9, 0x2e, 0x4e, 0x50, 0x51, 0xf8, 0x21, 0x70, 0x12, 0x22, 0x81, 0x1a, 0x08, 0xa6, - 0x8a, 0x50, 0x85, 0x64, 0x8d, 0xd7, 0xd3, 0xcd, 0xaa, 0xf6, 0xce, 0x76, 0x67, 0x6d, 0x12, 0x01, + 0x14, 0xc7, 0x3d, 0x10, 0x52, 0x78, 0x8e, 0xd3, 0x64, 0x08, 0x22, 0xdd, 0x24, 0x76, 0xd9, 0x36, + 0x55, 0xdb, 0xa4, 0xbb, 0x38, 0x41, 0x45, 0xe1, 0x87, 0x20, 0x3f, 0x88, 0x00, 0x25, 0x10, 0x4c, + 0x15, 0xa1, 0x0a, 0xc9, 0x1a, 0xaf, 0xa7, 0x9b, 0x55, 0xed, 0x1d, 0x77, 0x67, 0x6d, 0x12, 0x01, 0x97, 0x0a, 0x10, 0x47, 0x24, 0x84, 0xb8, 0x41, 0x2f, 0x48, 0x88, 0x33, 0x70, 0x87, 0x53, 0x8f, - 0x95, 0xb8, 0x20, 0x0e, 0x05, 0x25, 0x1c, 0xf8, 0x33, 0xd0, 0xce, 0x8c, 0xd7, 0xbb, 0x5e, 0x8f, - 0xbc, 0x38, 0xe2, 0x94, 0x68, 0xde, 0xdb, 0xf7, 0xfd, 0xbc, 0x37, 0xb3, 0xf3, 0xf5, 0xc2, 0x79, - 0xd7, 0x69, 0x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, 0xbf, 0x86, 0x57, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x52, 0x3d, + 0x86, 0xb2, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/oracle/types/state.pb.go b/x/oracle/types/state.pb.go index 1569bbca1..a7fc5ebb5 100644 --- a/x/oracle/types/state.pb.go +++ b/x/oracle/types/state.pb.go @@ -4,10 +4,10 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -30,7 +30,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // a snapshot of the prices at a given point in time type PriceSnapshot struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair" yaml:"pair"` - Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` + Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` // milliseconds since unix epoch TimestampMs int64 `protobuf:"varint,3,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` } @@ -82,28 +82,28 @@ func init() { func init() { proto.RegisterFile("nibiru/oracle/v1/state.proto", fileDescriptor_125e6c5a6e45c0d0) } var fileDescriptor_125e6c5a6e45c0d0 = []byte{ - // 329 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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94, - 0xa3, 0x62, 0x37, 0x65, 0xf1, 0x62, 0x0c, 0x52, 0xb3, 0xaa, 0xfe, 0xcc, 0x38, 0x2a, 0x85, 0x9a, - 0x81, 0xb5, 0xc2, 0xd1, 0x21, 0xc8, 0xfc, 0x73, 0xd5, 0xae, 0xcf, 0x41, 0x4d, 0xce, 0xbb, 0x85, - 0xae, 0x3b, 0x2a, 0xad, 0xf1, 0x20, 0xda, 0x32, 0x45, 0xae, 0xf1, 0xaf, 0xd4, 0xd3, 0x4a, 0x7f, - 0xfc, 0x43, 0x5f, 0xdd, 0xd8, 0x7f, 0x4e, 0xed, 0xe3, 0x13, 0x73, 0x73, 0x23, 0x2c, 0x1d, 0x08, - 0x3e, 0xf2, 0x87, 0xe3, 0xa3, 0x68, 0xd7, 0x49, 0x25, 0xac, 0x03, 0x65, 0x1e, 0x94, 0x6d, 0xd4, - 0x3a, 0x61, 0xaf, 0x36, 0xaa, 0x7f, 0xaf, 0x5d, 0xdb, 0xfe, 0xe5, 0x62, 0x4d, 0xc2, 0xe5, 0x9a, - 0x84, 0x1f, 0x6b, 0x12, 0xbe, 0x6c, 0x48, 0xb0, 0xdc, 0x90, 0xe0, 0x6d, 0x43, 0x82, 0xbb, 0x93, - 0xbf, 0x9e, 0x52, 0x8d, 0xb2, 0xac, 0xa6, 0xdb, 0xe5, 0x9c, 0xce, 0xbe, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x21, 0xeb, 0xd1, 0x23, 0xcc, 0x01, 0x00, 0x00, + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xc1, 0x4a, 0x2b, 0x31, + 0x14, 0x40, 0x67, 0x5e, 0xdf, 0x7b, 0xf0, 0xa6, 0x4f, 0x90, 0xc1, 0x45, 0xa9, 0x35, 0xad, 0x75, + 0xd3, 0x85, 0x24, 0x0c, 0xae, 0x74, 0x59, 0x45, 0x5c, 0xa8, 0x94, 0xba, 0x13, 0x41, 0xee, 0xc4, + 0x30, 0x13, 0x6c, 0x72, 0xc3, 0x24, 0x2d, 0xf6, 0x2f, 0xfc, 0xac, 0x82, 0x9b, 0x2e, 0xc5, 0x45, + 0x91, 0xf6, 0x0f, 0xfc, 0x02, 0x99, 0xc9, 0xe0, 0xc6, 0x85, 0xbb, 0x90, 0x93, 0x9c, 0x73, 0xb9, + 0x51, 0x47, 0xcb, 0x54, 0x16, 0x53, 0x86, 0x05, 0xf0, 0x89, 0x60, 0xb3, 0x84, 0x59, 0x07, 0x4e, + 0x50, 0x53, 0xa0, 0xc3, 0x78, 0xdb, 0x53, 0xea, 0x29, 0x9d, 0x25, 0xed, 0x9d, 0x0c, 0x33, 0xac, + 0x20, 0x2b, 0x4f, 0xfe, 0x5d, 0xbb, 0x93, 0x21, 0x66, 0x13, 0xc1, 0xc0, 0x48, 0x06, 0x5a, 0xa3, + 0x03, 0x27, 0x51, 0xdb, 0x9a, 0xee, 0x7d, 0x6b, 0xd4, 0x3e, 0x8f, 0x09, 0x47, 0xab, 0xd0, 0xb2, + 0x14, 0x6c, 0x09, 0x53, 0xe1, 0x20, 0x61, 0x1c, 0xa5, 0xf6, 0xbc, 0xff, 0x12, 0x46, 0x5b, 0xa3, + 0x42, 0x72, 0x71, 0xa3, 0xc1, 0xd8, 0x1c, 0x5d, 0x7c, 0x17, 0xfd, 0x36, 0x20, 0x8b, 0x56, 0xd8, + 0x0b, 0x07, 0xff, 0x86, 0x17, 0x8b, 0x55, 0x37, 0x78, 0x5b, 0x75, 0x93, 0x4c, 0xba, 0x7c, 0x9a, + 0x52, 0x8e, 0x8a, 0x5d, 0x57, 0xc5, 0xd3, 0x1c, 0xa4, 0x66, 0x75, 0xfd, 0x89, 0x71, 0x54, 0x0a, + 0x35, 0x03, 0x6b, 0x85, 0xa3, 0x23, 0x90, 0xc5, 0xc7, 0xaa, 0xdb, 0x9c, 0x83, 0x9a, 0x9c, 0xf4, + 0x4b, 0x5d, 0x7f, 0x5c, 0x59, 0xe3, 0xe3, 0xe8, 0x8f, 0x29, 0x73, 0xad, 0x5f, 0x95, 0xfe, 0xa0, + 0xd6, 0xef, 0xfa, 0x31, 0xed, 0xc3, 0x23, 0x95, 0xc8, 0x14, 0xb8, 0x9c, 0x5e, 0x8a, 0x0c, 0xf8, + 0xfc, 0x4c, 0xf0, 0xb1, 0xff, 0x11, 0xef, 0x47, 0xff, 0x9d, 0x54, 0xc2, 0x3a, 0x50, 0xe6, 0x5e, + 0xd9, 0x56, 0xa3, 0x17, 0x0e, 0x1a, 0xe3, 0xe6, 0xd7, 0xdd, 0x95, 0x1d, 0x9e, 0x2f, 0xd6, 0x24, + 0x5c, 0xae, 0x49, 0xf8, 0xbe, 0x26, 0xe1, 0xf3, 0x86, 0x04, 0xcb, 0x0d, 0x09, 0x5e, 0x37, 0x24, + 0xb8, 0x3d, 0xfc, 0x69, 0xfe, 0x7a, 0x7f, 0x6e, 0x6e, 0x84, 0x4d, 0xff, 0x56, 0xcb, 0x39, 0xfa, + 0x0c, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xf6, 0x16, 0xa1, 0xc1, 0x01, 0x00, 0x00, } func (m *PriceSnapshot) Marshal() (dAtA []byte, err error) { diff --git a/x/oracle/types/test_utils.go b/x/oracle/types/test_utils.go index 67b51d075..45238e55f 100644 --- a/x/oracle/types/test_utils.go +++ b/x/oracle/types/test_utils.go @@ -2,6 +2,9 @@ package types import ( + "context" + storetypes "cosmossdk.io/store/types" + "errors" "math" "math/rand" "time" @@ -66,47 +69,49 @@ func (sk DummyStakingKeeper) Validators() []MockValidator { } // Validator nolint -func (sk DummyStakingKeeper) Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI { +func (sk DummyStakingKeeper) Validator(ctx context.Context, address sdk.ValAddress) (stakingtypes.ValidatorI, error) { for _, validator := range sk.validators { - if validator.GetOperator().Equals(address) { - return validator + if validator.GetOperator() == address.String() { + return validator, nil } } - return nil + return nil, errors.New("validator not found") } // TotalBondedTokens nolint -func (DummyStakingKeeper) TotalBondedTokens(_ sdk.Context) sdk.Int { - return sdk.ZeroInt() +func (DummyStakingKeeper) TotalBondedTokens(context.Context) (sdkmath.Int, error) { + return sdkmath.ZeroInt(), nil } // Slash nolint -func (DummyStakingKeeper) Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdkmath.Int { - return sdkmath.ZeroInt() +func (DummyStakingKeeper) Slash(context.Context, sdk.ConsAddress, int64, int64, sdkmath.LegacyDec) (sdkmath.Int, error) { + return sdkmath.ZeroInt(), nil } // ValidatorsPowerStoreIterator nolint -func (DummyStakingKeeper) ValidatorsPowerStoreIterator(ctx sdk.Context) sdk.Iterator { - return sdk.KVStoreReversePrefixIterator(nil, nil) +func (DummyStakingKeeper) ValidatorsPowerStoreIterator(context context.Context) (storetypes.Iterator, error) { + return storetypes.KVStoreReversePrefixIterator(nil, nil), nil } // Jail nolint -func (DummyStakingKeeper) Jail(sdk.Context, sdk.ConsAddress) { +func (DummyStakingKeeper) Jail(context.Context, sdk.ConsAddress) error { + return nil } // GetLastValidatorPower nolint -func (sk DummyStakingKeeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) (power int64) { - return sk.Validator(ctx, operator).GetConsensusPower(sdk.DefaultPowerReduction) +func (sk DummyStakingKeeper) GetLastValidatorPower(ctx context.Context, operator sdk.ValAddress) (power int64) { + val, _ := sk.Validator(ctx, operator) + return val.GetConsensusPower(sdk.DefaultPowerReduction) } // MaxValidators returns the maximum amount of bonded validators -func (DummyStakingKeeper) MaxValidators(sdk.Context) uint32 { - return 100 +func (DummyStakingKeeper) MaxValidators(context.Context) (uint32, error) { + return 100, nil } // PowerReduction - is the amount of staking tokens required for 1 unit of consensus-engine power -func (DummyStakingKeeper) PowerReduction(ctx sdk.Context) (res sdk.Int) { +func (DummyStakingKeeper) PowerReduction(ctx context.Context) (res sdkmath.Int) { res = sdk.DefaultPowerReduction return } @@ -125,30 +130,38 @@ func (MockValidator) GetStatus() stakingtypes.BondStatus { return stakingty func (MockValidator) IsBonded() bool { return true } func (MockValidator) IsUnbonded() bool { return false } func (MockValidator) IsUnbonding() bool { return false } -func (v MockValidator) GetOperator() sdk.ValAddress { return v.valOperAddr } +func (v MockValidator) GetOperator() string { return v.valOperAddr.String() } func (MockValidator) ConsPubKey() (cryptotypes.PubKey, error) { return nil, nil } func (MockValidator) TmConsPublicKey() (tmprotocrypto.PublicKey, error) { return tmprotocrypto.PublicKey{}, nil } -func (MockValidator) GetConsAddr() (sdk.ConsAddress, error) { return nil, nil } -func (v MockValidator) GetTokens() sdk.Int { +func (MockValidator) GetConsAddr() ([]byte, error) { return nil, nil } +func (v MockValidator) GetTokens() sdkmath.Int { return sdk.TokensFromConsensusPower(v.power, sdk.DefaultPowerReduction) } -func (v MockValidator) GetBondedTokens() sdk.Int { +func (v MockValidator) GetBondedTokens() sdkmath.Int { return sdk.TokensFromConsensusPower(v.power, sdk.DefaultPowerReduction) } -func (v MockValidator) GetConsensusPower(powerReduction sdk.Int) int64 { return v.power } -func (v *MockValidator) SetConsensusPower(power int64) { v.power = power } -func (v MockValidator) GetCommission() sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) GetMinSelfDelegation() sdk.Int { return sdk.OneInt() } -func (v MockValidator) GetDelegatorShares() sdk.Dec { return sdk.NewDec(v.power) } -func (v MockValidator) TokensFromShares(sdk.Dec) sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) TokensFromSharesTruncated(sdk.Dec) sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) TokensFromSharesRoundUp(sdk.Dec) sdk.Dec { return sdk.ZeroDec() } -func (v MockValidator) SharesFromTokens(amt sdk.Int) (sdk.Dec, error) { return sdk.ZeroDec(), nil } -func (v MockValidator) SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) { - return sdk.ZeroDec(), nil +func (v MockValidator) GetConsensusPower(powerReduction sdkmath.Int) int64 { return v.power } +func (v *MockValidator) SetConsensusPower(power int64) { v.power = power } +func (v MockValidator) GetCommission() sdkmath.LegacyDec { return sdkmath.LegacyZeroDec() } +func (v MockValidator) GetMinSelfDelegation() sdkmath.Int { return sdkmath.OneInt() } +func (v MockValidator) GetDelegatorShares() sdkmath.LegacyDec { return sdkmath.LegacyNewDec(v.power) } +func (v MockValidator) TokensFromShares(sdkmath.LegacyDec) sdkmath.LegacyDec { + return sdkmath.LegacyZeroDec() +} +func (v MockValidator) TokensFromSharesTruncated(sdkmath.LegacyDec) sdkmath.LegacyDec { + return sdkmath.LegacyZeroDec() +} +func (v MockValidator) TokensFromSharesRoundUp(sdkmath.LegacyDec) sdkmath.LegacyDec { + return sdkmath.LegacyZeroDec() +} +func (v MockValidator) SharesFromTokens(amt sdkmath.Int) (sdkmath.LegacyDec, error) { + return sdkmath.LegacyZeroDec(), nil +} +func (v MockValidator) SharesFromTokensTruncated(amt sdkmath.Int) (sdkmath.LegacyDec, error) { + return sdkmath.LegacyZeroDec(), nil } func NewMockValidator(valAddr sdk.ValAddress, power int64) MockValidator { diff --git a/x/oracle/types/tx.pb.go b/x/oracle/types/tx.pb.go index 559b17c45..65bb861c0 100644 --- a/x/oracle/types/tx.pb.go +++ b/x/oracle/types/tx.pb.go @@ -5,8 +5,8 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -280,22 +280,22 @@ var xxx_messageInfo_MsgDelegateFeedConsentResponse proto.InternalMessageInfo // MsgEditOracleParams: gRPC tx message for updating the x/oracle module params // [SUDO] Only callable by sudoers. type MsgEditOracleParams struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - VotePeriod *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=vote_period,json=votePeriod,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"vote_period,omitempty"` + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + VotePeriod *cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=vote_period,json=votePeriod,proto3,customtype=cosmossdk.io/math.Int" json:"vote_period,omitempty"` // vote_threshold: [cosmossdk.io/math.LegacyDec] TODO: - VoteThreshold *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=vote_threshold,json=voteThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"vote_threshold,omitempty"` + VoteThreshold *cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=vote_threshold,json=voteThreshold,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"vote_threshold,omitempty"` // reward_band: [cosmossdk.io/math.LegacyDec] TODO: - RewardBand *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=reward_band,json=rewardBand,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"reward_band,omitempty"` - Whitelist []string `protobuf:"bytes,5,rep,name=whitelist,proto3" json:"whitelist,omitempty"` + RewardBand *cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=reward_band,json=rewardBand,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"reward_band,omitempty"` + Whitelist []string `protobuf:"bytes,5,rep,name=whitelist,proto3" json:"whitelist,omitempty"` // slash_fraction: [cosmossdk.io/math.LegacyDec] TODO: - SlashFraction *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=slash_fraction,json=slashFraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction,omitempty"` - SlashWindow *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=slash_window,json=slashWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"slash_window,omitempty"` + SlashFraction *cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=slash_fraction,json=slashFraction,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slash_fraction,omitempty"` + SlashWindow *cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=slash_window,json=slashWindow,proto3,customtype=cosmossdk.io/math.Int" json:"slash_window,omitempty"` // min_valid_per_window: [cosmossdk.io/math.LegacyDec] TODO: - MinValidPerWindow *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=min_valid_per_window,json=minValidPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_valid_per_window,omitempty"` - TwapLookbackWindow *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,9,opt,name=twap_lookback_window,json=twapLookbackWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"twap_lookback_window,omitempty"` - MinVoters *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,10,opt,name=min_voters,json=minVoters,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_voters,omitempty"` + MinValidPerWindow *cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=min_valid_per_window,json=minValidPerWindow,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_valid_per_window,omitempty"` + TwapLookbackWindow *cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=twap_lookback_window,json=twapLookbackWindow,proto3,customtype=cosmossdk.io/math.Int" json:"twap_lookback_window,omitempty"` + MinVoters *cosmossdk_io_math.Int `protobuf:"bytes,10,opt,name=min_voters,json=minVoters,proto3,customtype=cosmossdk.io/math.Int" json:"min_voters,omitempty"` // VoteThreshold: [cosmossdk.io/math.LegacyDec] TODO: - ValidatorFeeRatio *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=validator_fee_ratio,json=validatorFeeRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"validator_fee_ratio,omitempty"` + ValidatorFeeRatio *cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=validator_fee_ratio,json=validatorFeeRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"validator_fee_ratio,omitempty"` } func (m *MsgEditOracleParams) Reset() { *m = MsgEditOracleParams{} } @@ -405,65 +405,65 @@ func init() { func init() { proto.RegisterFile("nibiru/oracle/v1/tx.proto", fileDescriptor_11e362c65eb610f4) } var fileDescriptor_11e362c65eb610f4 = []byte{ - // 915 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x96, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0xd7, 0x4d, 0xba, 0x64, 0x67, 0x49, 0x9b, 0x7a, 0xd3, 0xc8, 0xd9, 0x06, 0x3b, 0xb8, - 0x10, 0x12, 0x89, 0xb5, 0x49, 0x90, 0x40, 0xf4, 0x04, 0x69, 0x1b, 0x09, 0x89, 0xa5, 0xc1, 0x82, - 0x20, 0x71, 0xc0, 0xcc, 0xae, 0x5f, 0x6c, 0x2b, 0x5e, 0x8f, 0x35, 0x33, 0xcd, 0xa6, 0x57, 0xc4, - 0x01, 0x6e, 0x48, 0x3d, 0x71, 0xcb, 0x07, 0x40, 0xe2, 0x6b, 0xf4, 0x58, 0x89, 0x0b, 0xe2, 0xb0, - 0x42, 0x09, 0x42, 0x9c, 0x38, 0xec, 0x27, 0x40, 0x33, 0x1e, 0xbb, 0xdb, 0xcd, 0xb6, 0xcd, 0xee, - 0x29, 0xce, 0xbc, 0xff, 0xfc, 0xde, 0xff, 0x3d, 0x7b, 0xde, 0x2c, 0x5a, 0x4d, 0xe3, 0x4e, 0x4c, - 0x1f, 0xba, 0x84, 0xe2, 0x6e, 0x02, 0xee, 0xf1, 0xb6, 0xcb, 0x4f, 0x9c, 0x8c, 0x12, 0x4e, 0xf4, - 0xa5, 0x3c, 0xe4, 0xe4, 0x21, 0xe7, 0x78, 0xbb, 0xb9, 0x1c,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, 0x3f, 0x9f, 0x9b, 0x95, 0xa7, 0xe7, 0x66, 0xe5, 0x8f, 0x73, 0xb3, 0xf2, 0xcd, 0xbb, 0x23, - 0x07, 0xe7, 0x73, 0x89, 0xb9, 0x1b, 0xe1, 0x38, 0x2d, 0x90, 0x27, 0x05, 0x54, 0x1e, 0xa1, 0x4e, - 0x55, 0xfe, 0x74, 0x7a, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0xca, 0xa5, 0x9a, 0xbc, - 0x09, 0x00, 0x00, + // 919 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x36, 0x7f, 0x88, 0xc7, 0xa4, 0x4d, 0xc7, 0x49, 0xb4, 0x71, 0x52, 0x6f, 0xd8, 0x40, + 0x49, 0x24, 0xb2, 0x4b, 0x82, 0x04, 0xa2, 0x42, 0xa8, 0xa4, 0x69, 0x24, 0x50, 0x43, 0xa3, 0xa5, + 0x0a, 0x12, 0x17, 0x6b, 0xec, 0x7d, 0xd9, 0x1d, 0x65, 0xbd, 0xb3, 0xda, 0x99, 0xc6, 0xc9, 0x15, + 0x71, 0x80, 0x1b, 0x52, 0x4f, 0xdc, 0xf2, 0x01, 0x90, 0xf8, 0x1a, 0x3d, 0x56, 0xe2, 0x82, 0x38, + 0x58, 0x28, 0xe1, 0x80, 0x84, 0xc4, 0xc1, 0x9f, 0x00, 0xcd, 0xec, 0xec, 0x36, 0xb5, 0xdd, 0xc6, + 0xbe, 0xad, 0xe7, 0xf7, 0xe7, 0xfd, 0xe6, 0xed, 0xcc, 0x5b, 0xa3, 0xa5, 0x98, 0x36, 0x69, 0xfa, + 0xd4, 0x65, 0x29, 0x69, 0x45, 0xe0, 0x9e, 0x6c, 0xb9, 0xe2, 0xd4, 0x49, 0x52, 0x26, 0x18, 0x9e, + 0xcb, 0x20, 0x27, 0x83, 0x9c, 0x93, 0xad, 0xda, 0x7c, 0xc0, 0x02, 0xa6, 0x40, 0x57, 0x3e, 0x65, + 0xbc, 0xda, 0x4a, 0xc0, 0x58, 0x10, 0x81, 0x4b, 0x12, 0xea, 0x92, 0x38, 0x66, 0x82, 0x08, 0xca, + 0x62, 0xae, 0xd1, 0x3b, 0x03, 0x05, 0xb4, 0x9f, 0x82, 0xed, 0xdf, 0x0c, 0x64, 0xed, 0xf3, 0xe0, + 0x8b, 0x20, 0x48, 0x21, 0x20, 0x02, 0x1e, 0x9e, 0xb6, 0x42, 0x12, 0x07, 0xe0, 0x11, 0x01, 0x07, + 0x29, 0x9c, 0x30, 0x01, 0x78, 0x0d, 0x4d, 0x86, 0x84, 0x87, 0xa6, 0xb1, 0x6a, 0xac, 0x97, 0x77, + 0x6e, 0xf5, 0xba, 0x56, 0xe5, 0x8c, 0xb4, 0xa3, 0x7b, 0xb6, 0x5c, 0xb5, 0x3d, 0x05, 0xe2, 0x0d, + 0x34, 0x7d, 0x04, 0xe0, 0x43, 0x6a, 0xde, 0x50, 0xb4, 0xdb, 0xbd, 0xae, 0x35, 0x9b, 0xd1, 0xb2, + 0x75, 0xdb, 0xd3, 0x04, 0xbc, 0x8d, 0xca, 0x27, 0x24, 0xa2, 0x3e, 0x11, 0x2c, 0x35, 0x27, 0x14, + 0x7b, 0xbe, 0xd7, 0xb5, 0xe6, 0x32, 0x76, 0x01, 0xd9, 0xde, 0x4b, 0xda, 0xbd, 0x99, 0x1f, 0xcf, + 0xad, 0xd2, 0x3f, 0xe7, 0x56, 0xc9, 0xde, 0x40, 0xef, 0x5f, 0x13, 0xd8, 0x03, 0x9e, 0xb0, 0x98, + 0x83, 0xfd, 0x9f, 0x81, 0x56, 0x5e, 0xc7, 0x3d, 0xd4, 0x3b, 0xe3, 0x24, 0x12, 0x83, 0x3b, 0x93, + 0xab, 0xb6, 0xa7, 0x40, 0x7c, 0x1f, 0xdd, 0x04, 0x2d, 0x6c,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 0x2e, 0xea, 0xc6, 0xcf, 0x97, + 0xf5, 0xd2, 0x8b, 0xcb, 0x7a, 0xe9, 0x8f, 0xcb, 0x7a, 0xe9, 0xbb, 0x0f, 0x02, 0x2a, 0xc2, 0xa7, + 0x4d, 0xa7, 0xc5, 0xda, 0xee, 0xd7, 0xca, 0xe6, 0x41, 0x48, 0x68, 0x9c, 0x5b, 0x9e, 0xe6, 0xa6, + 0xe2, 0x2c, 0x01, 0xde, 0x9c, 0x56, 0xff, 0x5f, 0x3e, 0xfa, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x7b, + 0x78, 0x3f, 0xc2, 0x41, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1905,7 +1905,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.VotePeriod = &v if err := m.VotePeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1941,7 +1941,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.VoteThreshold = &v if err := m.VoteThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1977,7 +1977,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.RewardBand = &v if err := m.RewardBand.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2045,7 +2045,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.SlashFraction = &v if err := m.SlashFraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2081,7 +2081,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.SlashWindow = &v if err := m.SlashWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2117,7 +2117,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.MinValidPerWindow = &v if err := m.MinValidPerWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2153,7 +2153,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.TwapLookbackWindow = &v if err := m.TwapLookbackWindow.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2189,7 +2189,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int + var v cosmossdk_io_math.Int m.MinVoters = &v if err := m.MinVoters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2225,7 +2225,7 @@ func (m *MsgEditOracleParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec + var v cosmossdk_io_math.LegacyDec m.ValidatorFeeRatio = &v if err := m.ValidatorFeeRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/oracle/types/vote.go b/x/oracle/types/vote.go index a82e6d351..ea6847fc9 100644 --- a/x/oracle/types/vote.go +++ b/x/oracle/types/vote.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" "fmt" "strings" @@ -49,7 +50,7 @@ func (v AggregateExchangeRateVote) String() string { } // NewExchangeRateTuple creates a ExchangeRateTuple instance -func NewExchangeRateTuple(pair asset.Pair, exchangeRate sdk.Dec) ExchangeRateTuple { +func NewExchangeRateTuple(pair asset.Pair, exchangeRate sdkmath.LegacyDec) ExchangeRateTuple { return ExchangeRateTuple{ pair, exchangeRate, @@ -101,7 +102,7 @@ func NewExchangeRateTupleFromString(s string) (ExchangeRateTuple, error) { return ExchangeRateTuple{}, fmt.Errorf("invalid pair definition %s: %w", split[0], err) } - dec, err := sdk.NewDecFromStr(split[1]) + dec, err := sdkmath.LegacyNewDecFromStr(split[1]) if err != nil { return ExchangeRateTuple{}, fmt.Errorf("invalid decimal %s: %w", split[1], err) } @@ -115,8 +116,8 @@ func NewExchangeRateTupleFromString(s string) (ExchangeRateTuple, error) { // ExchangeRateTuples - array of ExchangeRateTuple type ExchangeRateTuples []ExchangeRateTuple -func (tuples ExchangeRateTuples) ToMap() (exchangeRateMap map[asset.Pair]sdk.Dec) { - exchangeRateMap = make(map[asset.Pair]sdk.Dec) +func (tuples ExchangeRateTuples) ToMap() (exchangeRateMap map[asset.Pair]sdkmath.LegacyDec) { + exchangeRateMap = make(map[asset.Pair]sdkmath.LegacyDec) for _, tuple := range tuples { exchangeRateMap[tuple.Pair] = tuple.ExchangeRate } diff --git a/x/oracle/types/vote_test.go b/x/oracle/types/vote_test.go index 1480d750b..7665120ea 100644 --- a/x/oracle/types/vote_test.go +++ b/x/oracle/types/vote_test.go @@ -1,10 +1,9 @@ package types_test import ( + sdkmath "cosmossdk.io/math" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" "github.com/NibiruChain/nibiru/x/oracle/types" @@ -15,12 +14,12 @@ func TestExchangeRateTuples_ToString(t *testing.T) { tuples := types.ExchangeRateTuples{ { Pair: "BTC:USD", - ExchangeRate: sdk.MustNewDecFromStr("40000.00"), + ExchangeRate: sdkmath.LegacyMustNewDecFromStr("40000.00"), }, { Pair: "ETH:USD", - ExchangeRate: sdk.MustNewDecFromStr("4000.00"), + ExchangeRate: sdkmath.LegacyMustNewDecFromStr("4000.00"), }, } @@ -37,12 +36,12 @@ func TestExchangeRateTuples_ToString(t *testing.T) { tuples := types.ExchangeRateTuples{ { Pair: "BTC:USD", - ExchangeRate: sdk.MustNewDecFromStr("40000.00"), + ExchangeRate: sdkmath.LegacyMustNewDecFromStr("40000.00"), }, { Pair: "BTC:USD", - ExchangeRate: sdk.MustNewDecFromStr("4000.00"), + ExchangeRate: sdkmath.LegacyMustNewDecFromStr("4000.00"), }, } @@ -58,7 +57,7 @@ func TestExchangeRateTuple(t *testing.T) { t.Run("inverse", func(t *testing.T) { exchangeRate := types.ExchangeRateTuple{ Pair: "BTC:USD", - ExchangeRate: sdk.MustNewDecFromStr("40000.00"), + ExchangeRate: sdkmath.LegacyMustNewDecFromStr("40000.00"), } exchangeRateStr, err := exchangeRate.ToString() require.NoError(t, err) diff --git a/x/perp/v2/client/cli/gen_market.go b/x/perp/v2/client/cli/gen_market.go index 5c8f18bee..6f16180ed 100644 --- a/x/perp/v2/client/cli/gen_market.go +++ b/x/perp/v2/client/cli/gen_market.go @@ -1,6 +1,7 @@ package cli import ( + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" "time" @@ -156,22 +157,22 @@ func newMarketFromFlags(flagSet *flag.FlagSet, return } - sqrtDepth, err := sdk.NewDecFromStr(sqrtDepthStr) + sqrtDepth, err := sdkmath.LegacyNewDecFromStr(sqrtDepthStr) if err != nil { return } - maintenanceMarginRatio, err := sdk.NewDecFromStr(mmrAsString) + maintenanceMarginRatio, err := sdkmath.LegacyNewDecFromStr(mmrAsString) if err != nil { return } - maxLeverage, err := sdk.NewDecFromStr(maxLeverageStr) + maxLeverage, err := sdkmath.LegacyNewDecFromStr(maxLeverageStr) if err != nil { return } - maxFundingRate, err := sdk.NewDecFromStr(maxFundingRateStr) + maxFundingRate, err := sdkmath.LegacyNewDecFromStr(maxFundingRateStr) if err != nil { return } @@ -181,7 +182,7 @@ func newMarketFromFlags(flagSet *flag.FlagSet, return } - priceMultiplier, err := sdk.NewDecFromStr(priceMultiplierStr) + priceMultiplier, err := sdkmath.LegacyNewDecFromStr(priceMultiplierStr) if err != nil { return } @@ -191,11 +192,11 @@ func newMarketFromFlags(flagSet *flag.FlagSet, Enabled: true, MaintenanceMarginRatio: maintenanceMarginRatio, MaxLeverage: maxLeverage, - LatestCumulativePremiumFraction: sdk.ZeroDec(), - ExchangeFeeRatio: sdk.MustNewDecFromStr("0.0010"), - EcosystemFundFeeRatio: sdk.MustNewDecFromStr("0.0010"), - LiquidationFeeRatio: sdk.MustNewDecFromStr("0.0500"), - PartialLiquidationRatio: sdk.MustNewDecFromStr("0.5"), + LatestCumulativePremiumFraction: sdkmath.LegacyZeroDec(), + ExchangeFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0010"), + EcosystemFundFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0010"), + LiquidationFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0500"), + PartialLiquidationRatio: sdkmath.LegacyMustNewDecFromStr("0.5"), FundingRateEpochId: epochstypes.ThirtyMinuteEpochID, MaxFundingRate: maxFundingRate, TwapLookbackWindow: time.Minute * 30, @@ -212,8 +213,8 @@ func newMarketFromFlags(flagSet *flag.FlagSet, QuoteReserve: sqrtDepth, SqrtDepth: sqrtDepth, PriceMultiplier: priceMultiplier, - TotalLong: sdk.ZeroDec(), - TotalShort: sdk.ZeroDec(), + TotalLong: sdkmath.LegacyZeroDec(), + TotalShort: sdkmath.LegacyZeroDec(), } if err := amm.Validate(); err != nil { return types.Market{}, types.AMM{}, err diff --git a/x/perp/v2/client/cli/tx.go b/x/perp/v2/client/cli/tx.go index b45a8b966..6aa64dfc9 100644 --- a/x/perp/v2/client/cli/tx.go +++ b/x/perp/v2/client/cli/tx.go @@ -1,6 +1,7 @@ package cli import ( + sdkmath "cosmossdk.io/math" "fmt" "strconv" "strings" @@ -122,14 +123,14 @@ func MarketOrderCmd() *cobra.Command { return err } - leverage := sdk.MustNewDecFromStr(args[2]) + leverage := sdkmath.LegacyMustNewDecFromStr(args[2]) - amount, ok := sdk.NewIntFromString(args[3]) + amount, ok := sdkmath.NewIntFromString(args[3]) if !ok { return fmt.Errorf("invalid quote amount: %s", args[3]) } - baseAmtLimit := sdk.MustNewDecFromStr(args[4]) + baseAmtLimit := sdkmath.LegacyMustNewDecFromStr(args[4]) msg := &types.MsgMarketOrder{ Sender: clientCtx.GetFromAddress().String(), @@ -202,7 +203,7 @@ func PartialCloseCmd() *cobra.Command { return err } - size, err := sdk.NewDecFromStr(args[1]) + size, err := sdkmath.LegacyNewDecFromStr(args[1]) if err != nil { return err } diff --git a/x/perp/v2/integration/action/dnr.go b/x/perp/v2/integration/action/dnr.go index 7940f4795..98de599ec 100644 --- a/x/perp/v2/integration/action/dnr.go +++ b/x/perp/v2/integration/action/dnr.go @@ -3,8 +3,8 @@ package action import ( "fmt" + "cosmossdk.io/collections" "cosmossdk.io/math" - "github.com/NibiruChain/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/testutil" diff --git a/x/perp/v2/integration/action/market.go b/x/perp/v2/integration/action/market.go index 02b208b84..48f37d903 100644 --- a/x/perp/v2/integration/action/market.go +++ b/x/perp/v2/integration/action/market.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" diff --git a/x/perp/v2/integration/action/snapshot.go b/x/perp/v2/integration/action/snapshot.go index c123907b5..8261a4de9 100644 --- a/x/perp/v2/integration/action/snapshot.go +++ b/x/perp/v2/integration/action/snapshot.go @@ -3,7 +3,7 @@ package action import ( "time" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/app" diff --git a/x/perp/v2/keeper/amm.go b/x/perp/v2/keeper/amm.go index fe94ad4be..f0701773d 100644 --- a/x/perp/v2/keeper/amm.go +++ b/x/perp/v2/keeper/amm.go @@ -3,8 +3,8 @@ package keeper import ( "fmt" + "cosmossdk.io/collections" sdkmath "cosmossdk.io/math" - "github.com/NibiruChain/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" @@ -93,7 +93,7 @@ func (k Keeper) GetMarketByPairAndVersion(ctx sdk.Context, pair asset.Pair, vers // SaveMarket saves the market by pair and version. func (k Keeper) SaveMarket(ctx sdk.Context, market types.Market) { - k.Markets.Insert(ctx, collections.Join(market.Pair, market.Version), market) + k.Markets.Set(ctx, collections.Join(market.Pair, market.Version), market) } // GetAMM returns the amm with last version. @@ -123,5 +123,5 @@ func (k Keeper) GetAMMByPairAndVersion(ctx sdk.Context, pair asset.Pair, version // SaveAMM saves the amm by pair and version. func (k Keeper) SaveAMM(ctx sdk.Context, amm types.AMM) { - k.AMMs.Insert(ctx, collections.Join(amm.Pair, amm.Version), amm) + k.AMMs.Set(ctx, collections.Join(amm.Pair, amm.Version), amm) } diff --git a/x/perp/v2/keeper/amm_test.go b/x/perp/v2/keeper/amm_test.go index 0136778f9..f54171bf2 100644 --- a/x/perp/v2/keeper/amm_test.go +++ b/x/perp/v2/keeper/amm_test.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" diff --git a/x/perp/v2/keeper/calc.go b/x/perp/v2/keeper/calc.go index d09e19f97..5b026e89c 100644 --- a/x/perp/v2/keeper/calc.go +++ b/x/perp/v2/keeper/calc.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "fmt" "time" @@ -10,11 +11,11 @@ import ( ) // PositionNotionalSpot returns the position's notional value based on the spot price. -func PositionNotionalSpot(amm types.AMM, position types.Position) (positionNotional sdk.Dec, err error) { +func PositionNotionalSpot(amm types.AMM, position types.Position) (positionNotional sdkmath.LegacyDec, err error) { // we want to know the price if the user closes their position // e.g. if the user has positive size, we want to short if position.Size_.IsNil() { - return sdk.Dec{}, fmt.Errorf("input base amt is nil") + return sdkmath.LegacyDec{}, fmt.Errorf("input base amt is nil") } var dir types.Direction @@ -26,7 +27,7 @@ func PositionNotionalSpot(amm types.AMM, position types.Position) (positionNotio quoteReserve, err := amm.GetQuoteReserveAmt(position.Size_.Abs(), dir) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } return amm.QuoteReserveToAsset(quoteReserve), nil } @@ -35,7 +36,7 @@ func PositionNotionalSpot(amm types.AMM, position types.Position) (positionNotio func (k Keeper) PositionNotionalTWAP(ctx sdk.Context, position types.Position, twapLookbackWindow time.Duration, -) (positionNotional sdk.Dec, err error) { +) (positionNotional sdkmath.LegacyDec, err error) { // we want to know the price if the user closes their position // e.g. if the user has positive size, we want to short var dir types.Direction @@ -56,7 +57,7 @@ func (k Keeper) PositionNotionalTWAP(ctx sdk.Context, } // UnrealizedPnl calculates the unrealized profits and losses (PnL) of a position. -func UnrealizedPnl(position types.Position, positionNotional sdk.Dec) (unrealizedPnlSigned sdk.Dec) { +func UnrealizedPnl(position types.Position, positionNotional sdkmath.LegacyDec) (unrealizedPnlSigned sdkmath.LegacyDec) { if position.Size_.IsPositive() { // LONG return positionNotional.Sub(position.OpenNotional) @@ -69,11 +70,11 @@ func UnrealizedPnl(position types.Position, positionNotional sdk.Dec) (unrealize // MarginRatio Given a position and it's notional value, returns the margin ratio. func MarginRatio( position types.Position, - positionNotional sdk.Dec, - marketLatestCumulativePremiumFraction sdk.Dec, -) sdk.Dec { + positionNotional sdkmath.LegacyDec, + marketLatestCumulativePremiumFraction sdkmath.LegacyDec, +) sdkmath.LegacyDec { if position.Size_.IsZero() || positionNotional.IsZero() { - return sdk.ZeroDec() + return sdkmath.LegacyZeroDec() } unrealizedPnl := UnrealizedPnl(position, positionNotional) @@ -91,7 +92,7 @@ func MarginRatio( // // returns: // - fundingPayment: the funding payment of the position, signed -func FundingPayment(position types.Position, marketLatestCumulativePremiumFraction sdk.Dec) sdk.Dec { +func FundingPayment(position types.Position, marketLatestCumulativePremiumFraction sdkmath.LegacyDec) sdkmath.LegacyDec { return marketLatestCumulativePremiumFraction. Sub(position.LatestCumulativePremiumFraction). Mul(position.Size_) diff --git a/x/perp/v2/keeper/clearing_house.go b/x/perp/v2/keeper/clearing_house.go index 1dedae8b0..5ceb2db83 100644 --- a/x/perp/v2/keeper/clearing_house.go +++ b/x/perp/v2/keeper/clearing_house.go @@ -6,7 +6,7 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" @@ -33,8 +33,8 @@ func (k Keeper) MarketOrder( dir types.Direction, traderAddr sdk.AccAddress, quoteAssetAmt sdkmath.Int, - leverage sdk.Dec, - baseAmtLimit sdk.Dec, + leverage sdkmath.LegacyDec, + baseAmtLimit sdkmath.LegacyDec, ) (positionResp *types.PositionResp, err error) { market, err := k.GetMarket(ctx, pair) if err != nil { @@ -89,7 +89,7 @@ func (k Keeper) MarketOrder( return nil, err } } else { - quoteAssetAmtToDec := sdk.NewDecFromInt(quoteAssetAmtMinusFees) + quoteAssetAmtToDec := sdkmath.LegacyNewDecFromInt(quoteAssetAmtMinusFees) updatedAMM, positionResp, err = k.openReversePosition( ctx, market, @@ -159,9 +159,9 @@ func (k Keeper) increasePosition( amm types.AMM, currentPosition types.Position, dir types.Direction, - increasedNotional sdk.Dec, // unsigned - baseAmtLimit sdk.Dec, // unsigned - leverage sdk.Dec, // unsigned + increasedNotional sdkmath.LegacyDec, // unsigned + baseAmtLimit sdkmath.LegacyDec, // unsigned + leverage sdkmath.LegacyDec, // unsigned ) (updatedAMM *types.AMM, positionResp *types.PositionResp, err error) { positionNotional, err := PositionNotionalSpot(amm, currentPosition) if err != nil { @@ -169,7 +169,7 @@ func (k Keeper) increasePosition( } positionResp = &types.PositionResp{ - RealizedPnl: sdk.ZeroDec(), + RealizedPnl: sdkmath.LegacyZeroDec(), MarginToVault: increasedNotional.Quo(leverage), // unsigned FundingPayment: FundingPayment(currentPosition, market.LatestCumulativePremiumFraction), // signed ExchangedNotionalValue: increasedNotional, // unsigned @@ -195,12 +195,12 @@ func (k Keeper) increasePosition( positionResp.ExchangedPositionSize = baseAssetDeltaAbs.Neg() } - positionResp.BadDebt = sdk.MinDec(sdk.ZeroDec(), remainingMargin).Abs() + positionResp.BadDebt = sdkmath.LegacyMinDec(sdkmath.LegacyZeroDec(), remainingMargin).Abs() positionResp.Position = types.Position{ TraderAddress: currentPosition.TraderAddress, Pair: currentPosition.Pair, Size_: currentPosition.Size_.Add(positionResp.ExchangedPositionSize), - Margin: sdk.MaxDec(sdk.ZeroDec(), remainingMargin).Abs(), + Margin: sdkmath.LegacyMaxDec(sdkmath.LegacyZeroDec(), remainingMargin).Abs(), OpenNotional: currentPosition.OpenNotional.Add(increasedNotional), LatestCumulativePremiumFraction: market.LatestCumulativePremiumFraction, LastUpdatedBlockNumber: ctx.BlockHeight(), @@ -231,9 +231,9 @@ func (k Keeper) openReversePosition( market types.Market, amm types.AMM, currentPosition types.Position, - quoteAssetAmount sdk.Dec, - leverage sdk.Dec, - baseAmtLimit sdk.Dec, + quoteAssetAmount sdkmath.LegacyDec, + leverage sdkmath.LegacyDec, + baseAmtLimit sdkmath.LegacyDec, ) (updatedAMM *types.AMM, positionResp *types.PositionResp, err error) { notionalToDecreaseBy := leverage.Mul(quoteAssetAmount) currentPositionNotional, err := PositionNotionalSpot(amm, currentPosition) @@ -291,8 +291,8 @@ func (k Keeper) decreasePosition( market types.Market, amm types.AMM, currentPosition types.Position, - decreasedNotional sdk.Dec, - baseAmtLimit sdk.Dec, + decreasedNotional sdkmath.LegacyDec, + baseAmtLimit sdkmath.LegacyDec, ) (updatedAMM *types.AMM, positionResp *types.PositionResp, err error) { if currentPosition.Size_.IsZero() { return nil, nil, fmt.Errorf("current position size is zero, nothing to decrease") @@ -311,7 +311,7 @@ func (k Keeper) decreasePosition( } positionResp = &types.PositionResp{ - MarginToVault: sdk.ZeroDec(), + MarginToVault: sdkmath.LegacyZeroDec(), } currentPositionNotional, err := PositionNotionalSpot(amm, currentPosition) @@ -345,7 +345,7 @@ func (k Keeper) decreasePosition( fundingPayment := FundingPayment(currentPosition, market.LatestCumulativePremiumFraction) remainingMargin := currentPosition.Margin.Add(positionResp.RealizedPnl).Sub(fundingPayment) - positionResp.BadDebt = sdk.MinDec(sdk.ZeroDec(), remainingMargin).Abs() + positionResp.BadDebt = sdkmath.LegacyMinDec(sdkmath.LegacyZeroDec(), remainingMargin).Abs() positionResp.FundingPayment = fundingPayment positionResp.UnrealizedPnlAfter = currentUnrealizedPnl.Sub(positionResp.RealizedPnl) positionResp.ExchangedNotionalValue = decreasedNotional @@ -355,7 +355,7 @@ func (k Keeper) decreasePosition( // long: unrealizedPnl = positionNotional - openNotional => openNotional = positionNotional - unrealizedPnl // short: unrealizedPnl = openNotional - positionNotional => openNotional = positionNotional + unrealizedPnl // positionNotional = oldPositionNotional - notionalValueToDecrease - var remainOpenNotional sdk.Dec + var remainOpenNotional sdkmath.LegacyDec if currentPosition.Size_.IsPositive() { remainOpenNotional = positionResp.PositionNotional.Sub(positionResp.UnrealizedPnlAfter) } else { @@ -370,14 +370,14 @@ func (k Keeper) decreasePosition( TraderAddress: currentPosition.TraderAddress, Pair: currentPosition.Pair, Size_: currentPosition.Size_.Add(positionResp.ExchangedPositionSize), - Margin: sdk.MaxDec(sdk.ZeroDec(), remainingMargin).Abs(), + Margin: sdkmath.LegacyMaxDec(sdkmath.LegacyZeroDec(), remainingMargin).Abs(), OpenNotional: remainOpenNotional, LatestCumulativePremiumFraction: market.LatestCumulativePremiumFraction, LastUpdatedBlockNumber: ctx.BlockHeight(), } if positionResp.Position.Size_.IsZero() { - err := k.Positions.Delete(ctx, collections.Join(collections.Join(currentPosition.Pair, amm.Version), trader)) + err := k.Positions.Remove(ctx, collections.Join(collections.Join(currentPosition.Pair, amm.Version), trader)) if err != nil { return nil, nil, err } @@ -409,9 +409,9 @@ func (k Keeper) closeAndOpenReversePosition( market types.Market, amm types.AMM, existingPosition types.Position, - quoteAssetAmount sdk.Dec, - leverage sdk.Dec, - baseAmtLimit sdk.Dec, + quoteAssetAmount sdkmath.LegacyDec, + leverage sdkmath.LegacyDec, + baseAmtLimit sdkmath.LegacyDec, ) (updatedAMM *types.AMM, positionResp *types.PositionResp, err error) { trader, err := sdk.AccAddressFromBech32(existingPosition.TraderAddress) if err != nil { @@ -423,7 +423,7 @@ func (k Keeper) closeAndOpenReversePosition( market, amm, existingPosition, - /* quoteAssetAmountLimit */ sdk.ZeroDec(), + /* quoteAssetAmountLimit */ sdkmath.LegacyZeroDec(), ) if err != nil { return nil, nil, err @@ -501,7 +501,7 @@ func (k Keeper) closeAndOpenReversePosition( FundingPayment: closePositionResp.FundingPayment.Add(increasePositionResp.FundingPayment), RealizedPnl: closePositionResp.RealizedPnl.Add(increasePositionResp.RealizedPnl), MarginToVault: closePositionResp.MarginToVault.Add(increasePositionResp.MarginToVault), - UnrealizedPnlAfter: sdk.ZeroDec(), + UnrealizedPnlAfter: sdkmath.LegacyZeroDec(), } return updatedAMM, positionResp, nil @@ -516,11 +516,11 @@ func (k Keeper) closeAndOpenReversePosition( // args: // - market: the market where the position will be opened // - quoteAssetAmt: the amount of quote asset -// - leverage: the amount of leverage to take, as sdk.Dec +// - leverage: the amount of leverage to take, as math.LegacyDec // // returns: // - error: if any of the requirements is not met -func checkMarketOrderRequirements(market types.Market, quoteAssetAmt sdkmath.Int, userLeverage sdk.Dec) error { +func checkMarketOrderRequirements(market types.Market, quoteAssetAmt sdkmath.Int, userLeverage sdkmath.LegacyDec) error { if !quoteAssetAmt.IsPositive() { return types.ErrInputQuoteAmtNegative } @@ -574,7 +574,7 @@ func (k Keeper) afterPositionUpdate( // calculate positionNotional (it's different depends on long or short side) // long: unrealizedPnl = positionNotional - openNotional => positionNotional = openNotional + unrealizedPnl // short: unrealizedPnl = openNotional - positionNotional => positionNotional = openNotional - unrealizedPnl - positionNotional := sdk.ZeroDec() + positionNotional := sdkmath.LegacyZeroDec() if positionResp.Position.Size_.IsPositive() { positionNotional = positionResp.Position.OpenNotional.Add(positionResp.UnrealizedPnlAfter) } else if positionResp.Position.Size_.IsNegative() { @@ -621,11 +621,11 @@ func (k Keeper) checkMarginRatio(ctx sdk.Context, market types.Market, amm types if err != nil { return } - var preferredPositionNotional sdk.Dec + var preferredPositionNotional sdkmath.LegacyDec if position.Size_.IsPositive() { - preferredPositionNotional = sdk.MaxDec(spotNotional, twapNotional) + preferredPositionNotional = sdkmath.LegacyMaxDec(spotNotional, twapNotional) } else { - preferredPositionNotional = sdk.MinDec(spotNotional, twapNotional) + preferredPositionNotional = sdkmath.LegacyMinDec(spotNotional, twapNotional) } marginRatio := MarginRatio(position, preferredPositionNotional, market.LatestCumulativePremiumFraction) @@ -650,9 +650,9 @@ func (k Keeper) transferFee( ctx sdk.Context, pair asset.Pair, trader sdk.AccAddress, - positionNotional sdk.Dec, - exchangeFeeRatio sdk.Dec, - ecosystemFundFeeRatio sdk.Dec, + positionNotional sdkmath.LegacyDec, + exchangeFeeRatio sdkmath.LegacyDec, + ecosystemFundFeeRatio sdkmath.LegacyDec, ) (fees sdkmath.Int, err error) { collateral, err := k.Collateral.Get(ctx) if err != nil { @@ -736,7 +736,7 @@ func (k Keeper) ClosePosition(ctx sdk.Context, pair asset.Pair, traderAddr sdk.A market, amm, position, - /* quoteAssetAmountLimit */ sdk.ZeroDec(), + /* quoteAssetAmountLimit */ sdkmath.LegacyZeroDec(), ) if err != nil { return nil, err @@ -758,7 +758,7 @@ func (k Keeper) ClosePosition(ctx sdk.Context, pair asset.Pair, traderAddr sdk.A traderAddr, *positionResp, types.ChangeReason_ClosePosition, - sdk.ZeroInt(), + sdkmath.ZeroInt(), position, ); err != nil { return nil, err @@ -786,7 +786,7 @@ func (k Keeper) closePositionEntirely( market types.Market, amm types.AMM, currentPosition types.Position, - quoteAssetAmountLimit sdk.Dec, + quoteAssetAmountLimit sdkmath.LegacyDec, ) (updatedAMM *types.AMM, resp *types.PositionResp, err error) { if currentPosition.Size_.IsZero() { return nil, nil, fmt.Errorf("zero position size") @@ -803,20 +803,20 @@ func (k Keeper) closePositionEntirely( resp = &types.PositionResp{ ExchangedPositionSize: currentPosition.Size_.Neg(), - PositionNotional: sdk.ZeroDec(), + PositionNotional: sdkmath.LegacyZeroDec(), FundingPayment: FundingPayment(currentPosition, market.LatestCumulativePremiumFraction), RealizedPnl: UnrealizedPnl(currentPosition, positionNotional), - UnrealizedPnlAfter: sdk.ZeroDec(), + UnrealizedPnlAfter: sdkmath.LegacyZeroDec(), } remainingMargin := currentPosition.Margin.Add(resp.RealizedPnl).Sub(resp.FundingPayment) if remainingMargin.IsPositive() { - resp.BadDebt = sdk.ZeroDec() + resp.BadDebt = sdkmath.LegacyZeroDec() resp.MarginToVault = remainingMargin.Neg() } else { resp.BadDebt = remainingMargin.Abs() - resp.MarginToVault = sdk.ZeroDec() + resp.MarginToVault = sdkmath.LegacyZeroDec() } var dir types.Direction @@ -841,9 +841,9 @@ func (k Keeper) closePositionEntirely( resp.Position = types.Position{ TraderAddress: currentPosition.TraderAddress, Pair: currentPosition.Pair, - Size_: sdk.ZeroDec(), - Margin: sdk.ZeroDec(), - OpenNotional: sdk.ZeroDec(), + Size_: sdkmath.LegacyZeroDec(), + Margin: sdkmath.LegacyZeroDec(), + OpenNotional: sdkmath.LegacyZeroDec(), LatestCumulativePremiumFraction: market.LatestCumulativePremiumFraction, LastUpdatedBlockNumber: ctx.BlockHeight(), } @@ -860,7 +860,7 @@ func (k Keeper) PartialClose( ctx sdk.Context, pair asset.Pair, traderAddr sdk.AccAddress, - sizeAmt sdk.Dec, // unsigned + sizeAmt sdkmath.LegacyDec, // unsigned ) (*types.PositionResp, error) { market, err := k.GetMarket(ctx, pair) if err != nil { @@ -909,7 +909,7 @@ func (k Keeper) PartialClose( reverseNotionalAmtWithoutFees := reverseNotionalAmt.Sub(feesTransferred.ToLegacyDec()) - _, positionResp, err := k.decreasePosition(ctx, market, amm, position, reverseNotionalAmtWithoutFees, sdk.ZeroDec()) + _, positionResp, err := k.decreasePosition(ctx, market, amm, position, reverseNotionalAmtWithoutFees, sdkmath.LegacyZeroDec()) if err != nil { return nil, err } diff --git a/x/perp/v2/keeper/clearing_house_test.go b/x/perp/v2/keeper/clearing_house_test.go index 467cf54af..28adfa0c3 100644 --- a/x/perp/v2/keeper/clearing_house_test.go +++ b/x/perp/v2/keeper/clearing_house_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" + "cosmossdk.io/collections" sdkmath "cosmossdk.io/math" - "github.com/NibiruChain/collections" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" diff --git a/x/perp/v2/keeper/dnr.go b/x/perp/v2/keeper/dnr.go index e9d687191..a7d1dd10b 100644 --- a/x/perp/v2/keeper/dnr.go +++ b/x/perp/v2/keeper/dnr.go @@ -1,8 +1,8 @@ package keeper import ( - "cosmossdk.io/math" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/perp/v2/types" @@ -16,13 +16,16 @@ import ( // This method is invoked by the AfterEpochEnd hook. func (k Keeper) maybeUpdateDnREpoch(ctx sdk.Context, epochIdentifier string, number uint64) { // if epoch name is empty, we just assume DnR is not enabled. - referenceEpochName := k.DnREpochName.GetOr(ctx, "") + referenceEpochName, err := k.DnREpochName.Get(ctx) + if err != nil { + referenceEpochName = "" + } if referenceEpochName != epochIdentifier { return } // kickstart new epoch k.Logger(ctx).Info("updating dnr epoch", "epochIdentifier", epochIdentifier, "number", number) - err := k.StartNewEpoch(ctx, number) + err = k.StartNewEpoch(ctx, number) if err != nil { // in case of error we panic in this case, because state may have been updated // in a corrupted way. @@ -44,7 +47,7 @@ func (k Keeper) StartNewEpoch(ctx sdk.Context, identifier uint64) error { if err != nil { return err } - k.EpochRebateAllocations.Insert(ctx, previousEpoch, types.DNRAllocation{ + k.EpochRebateAllocations.Set(ctx, previousEpoch, types.DNRAllocation{ Epoch: previousEpoch, Amount: allocationBalance, }) @@ -53,53 +56,66 @@ func (k Keeper) StartNewEpoch(ctx sdk.Context, identifier uint64) error { // IncreaseTraderVolume adds the volume to the user's volume for the current epoch. // It also increases the global volume for the current epoch. -func (k Keeper) IncreaseTraderVolume(ctx sdk.Context, currentEpoch uint64, user sdk.AccAddress, volume math.Int) { - currentVolume := k.TraderVolumes.GetOr(ctx, collections.Join(user, currentEpoch), math.ZeroInt()) +func (k Keeper) IncreaseTraderVolume(ctx sdk.Context, currentEpoch uint64, user sdk.AccAddress, volume sdkmath.Int) { + currentVolume, err := k.TraderVolumes.Get(ctx, collections.Join(user, currentEpoch)) + if err != nil { + currentVolume = sdkmath.ZeroInt() + } newVolume := currentVolume.Add(volume) - k.TraderVolumes.Insert(ctx, collections.Join(user, currentEpoch), newVolume) - k.GlobalVolumes.Insert(ctx, currentEpoch, k.GlobalVolumes.GetOr(ctx, currentEpoch, math.ZeroInt()).Add(volume)) + k.TraderVolumes.Set(ctx, collections.Join(user, currentEpoch), newVolume) + globalVolume, err := k.GlobalVolumes.Get(ctx, currentEpoch) + if err != nil { + globalVolume = sdkmath.ZeroInt() + } + k.GlobalVolumes.Set(ctx, currentEpoch, globalVolume.Add(volume)) } // GetTraderVolumeLastEpoch returns the user's volume for the last epoch. // Returns zero if the user has no volume for the last epoch. -func (k Keeper) GetTraderVolumeLastEpoch(ctx sdk.Context, currentEpoch uint64, user sdk.AccAddress) math.Int { +func (k Keeper) GetTraderVolumeLastEpoch(ctx sdk.Context, currentEpoch uint64, user sdk.AccAddress) sdkmath.Int { // if it's the first epoch, we do not have any user volume. if currentEpoch == 0 { - return math.ZeroInt() + return sdkmath.ZeroInt() } // return the user's volume for the last epoch, or zero. - return k.TraderVolumes.GetOr(ctx, collections.Join(user, currentEpoch-1), math.ZeroInt()) + traderVolumes, err := k.TraderVolumes.Get(ctx, collections.Join(user, currentEpoch-1)) + if err != nil { + traderVolumes = sdkmath.ZeroInt() + } + return traderVolumes } // GetTraderDiscount will check if the trader has a custom discount for the given volume. // If it does not have a custom discount, it will return the global discount for the given volume. // The discount is the nearest left entry of the trader volume. -func (k Keeper) GetTraderDiscount(ctx sdk.Context, trader sdk.AccAddress, volume math.Int) (math.LegacyDec, bool) { +func (k Keeper) GetTraderDiscount(ctx sdk.Context, trader sdk.AccAddress, volume sdkmath.Int) (sdkmath.LegacyDec, bool) { // we try to see if the trader has a custom discount. - customDiscountRng := collections.PairRange[sdk.AccAddress, math.Int]{}. - Prefix(trader). + customDiscountRng := collections.NewPrefixedPairRange[sdk.AccAddress, sdkmath.Int](trader). EndInclusive(volume). Descending() - customDiscount := k.TraderDiscounts.Iterate(ctx, customDiscountRng) + customDiscount, _ := k.TraderDiscounts.Iterate(ctx, customDiscountRng) defer customDiscount.Close() if customDiscount.Valid() { - return customDiscount.Value(), true + value, _ := customDiscount.Value() + return value, true } // if it does not have a custom discount we try with global ones - globalDiscountRng := collections.Range[math.Int]{}. + globalDiscount := collections.Range[sdkmath.Int]{} + globalDiscountRng := globalDiscount. EndInclusive(volume). Descending() - globalDiscounts := k.GlobalDiscounts.Iterate(ctx, globalDiscountRng) + globalDiscounts, _ := k.GlobalDiscounts.Iterate(ctx, globalDiscountRng) defer globalDiscounts.Close() if globalDiscounts.Valid() { - return globalDiscounts.Value(), true + value, _ := globalDiscounts.Value() + return value, true } - return math.LegacyZeroDec(), false + return sdkmath.LegacyZeroDec(), false } // calculateDiscount applies the discount to the given exchange fee ratio. @@ -109,9 +125,9 @@ func (k Keeper) calculateDiscount( ctx sdk.Context, _ asset.Pair, trader sdk.AccAddress, - positionNotional math.LegacyDec, - feeRatio sdk.Dec, -) (sdk.Dec, error) { + positionNotional sdkmath.LegacyDec, + feeRatio sdkmath.LegacyDec, +) (sdkmath.LegacyDec, error) { // update user volume dnrEpoch, err := k.DnREpoch.Get(ctx) if err != nil { @@ -172,21 +188,24 @@ func (k Keeper) WithdrawEpochRebates(ctx sdk.Context, epoch uint64, addr sdk.Acc // garbage collect user volume. This ensures state is not bloated, // and that the user cannot claim from the same allocation twice. - return distrCoins, k.TraderVolumes.Delete(ctx, collections.Join(addr, epoch)) + return distrCoins, k.TraderVolumes.Remove(ctx, collections.Join(addr, epoch)) } // computeUserWeight computes the user's weight for the given epoch. -func (k Keeper) computeUserWeight(ctx sdk.Context, addr sdk.AccAddress, epoch uint64) (math.LegacyDec, error) { +func (k Keeper) computeUserWeight(ctx sdk.Context, addr sdk.AccAddress, epoch uint64) (sdkmath.LegacyDec, error) { // get user volume for the epoch - userVolume := k.TraderVolumes.GetOr(ctx, collections.Join(addr, epoch), math.ZeroInt()) + userVolume, err := k.TraderVolumes.Get(ctx, collections.Join(addr, epoch)) + if err != nil { + userVolume = sdkmath.ZeroInt() + } if userVolume.IsZero() { - return math.LegacyZeroDec(), nil + return sdkmath.LegacyZeroDec(), nil } // calculate the user's share globalVolume, err := k.GlobalVolumes.Get(ctx, epoch) if err != nil { - return math.LegacyDec{}, err + return sdkmath.LegacyDec{}, err } weight := userVolume.ToLegacyDec().Quo(globalVolume.ToLegacyDec()) return weight, nil diff --git a/x/perp/v2/keeper/grpc_query.go b/x/perp/v2/keeper/grpc_query.go index 6ec57c4fb..03a18f37c 100644 --- a/x/perp/v2/keeper/grpc_query.go +++ b/x/perp/v2/keeper/grpc_query.go @@ -2,10 +2,9 @@ package keeper import ( "context" + "cosmossdk.io/collections" - "github.com/NibiruChain/collections" - - storeprefix "github.com/cosmos/cosmos-sdk/store/prefix" + storeprefix "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" sdkquery "github.com/cosmos/cosmos-sdk/types/query" @@ -41,7 +40,14 @@ func (q queryServer) QueryPositions( ctx := sdk.UnwrapSDKContext(goCtx) - markets := q.k.Markets.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() + iter, err := q.k.Markets.Iterate(ctx, &collections.Range[collections.Pair[asset.Pair, uint64]]{}) + if err != nil { + return nil, err + } + markets, err := iter.Values() + if err != nil { + return nil, err + } var positions []types.QueryPositionResponse for _, market := range markets { @@ -95,7 +101,7 @@ func (q queryServer) QueryPositionStore( } ctx := sdk.UnwrapSDKContext(goCtx) - store := storeprefix.NewStore(ctx.KVStore(q.k.storeKey), NamespacePositions.Prefix()) + store := storeprefix.NewStore(ctx.KVStore(q.k.storeKey), collections.NewPrefix(int(NamespacePositions))) pagination, _, err := common.ParsePagination(req.Pagination) if err != nil { @@ -169,7 +175,15 @@ func (q queryServer) QueryMarkets( ctx := sdk.UnwrapSDKContext(goCtx) var ammMarkets []types.AmmMarket - markets := q.k.Markets.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() + iter, err := q.k.Markets.Iterate(ctx, &collections.Range[collections.Pair[asset.Pair, uint64]]{}) + if err != nil { + return nil, err + } + values, err := iter.Values() + if err != nil { + return nil, err + } + markets := values for _, market := range markets { // disabled markets are not returned if !req.Versioned && !market.Enabled { @@ -195,7 +209,11 @@ func (q queryServer) QueryCollateral( goCtx context.Context, req *types.QueryCollateralRequest, ) (*types.QueryCollateralResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - denom := q.k.Collateral.GetOr(ctx, "") + denom, err := q.k.Collateral.Get(ctx) + if err != nil { + denom = "" + } + return &types.QueryCollateralResponse{ CollateralDenom: denom, }, nil diff --git a/x/perp/v2/keeper/hooks.go b/x/perp/v2/keeper/hooks.go index 25d953fd0..bcabe6fdb 100644 --- a/x/perp/v2/keeper/hooks.go +++ b/x/perp/v2/keeper/hooks.go @@ -1,9 +1,10 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "time" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,7 +19,18 @@ func (k Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ uint64) { func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, number uint64) { k.maybeUpdateDnREpoch(ctx, epochIdentifier, number) - for _, market := range k.Markets.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() { + iter, err := k.Markets.Iterate(ctx, &collections.Range[collections.Pair[asset.Pair, uint64]]{}) + if err != nil { + k.Logger(ctx).Error("failed iterating markets", "error", err) + return + } + value, err := iter.Values() + if err != nil { + k.Logger(ctx).Error("failed getting markets values", "error", err) + return + } + + for _, market := range value { if !market.Enabled || epochIdentifier != market.FundingRateEpochId { return } @@ -33,7 +45,7 @@ func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, number ui continue } - markTwap, err := k.CalcTwap(ctx, market.Pair, types.TwapCalcOption_SPOT, types.Direction_DIRECTION_UNSPECIFIED, sdk.ZeroDec(), market.TwapLookbackWindow) + markTwap, err := k.CalcTwap(ctx, market.Pair, types.TwapCalcOption_SPOT, types.Direction_DIRECTION_UNSPECIFIED, sdkmath.LegacyZeroDec(), market.TwapLookbackWindow) if err != nil { ctx.Logger().Error("failed to fetch twap mark price", "market.Pair", market.Pair, "error", err) continue diff --git a/x/perp/v2/keeper/keeper.go b/x/perp/v2/keeper/keeper.go index 309e6e124..9dacf883a 100644 --- a/x/perp/v2/keeper/keeper.go +++ b/x/perp/v2/keeper/keeper.go @@ -2,18 +2,21 @@ package keeper import ( "fmt" + "github.com/NibiruChain/nibiru/x/common" + "github.com/cosmos/cosmos-sdk/runtime" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "time" + "cosmossdk.io/log" "cosmossdk.io/math" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" - "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" types "github.com/NibiruChain/nibiru/x/perp/v2/types" ) @@ -22,8 +25,8 @@ type Keeper struct { cdc codec.BinaryCodec storeKey storetypes.StoreKey - BankKeeper types.BankKeeper - AccountKeeper types.AccountKeeper + BankKeeper bankkeeper.Keeper + AccountKeeper authkeeper.AccountKeeper OracleKeeper types.OracleKeeper EpochKeeper types.EpochKeeper SudoKeeper types.SudoKeeper @@ -47,10 +50,10 @@ type Keeper struct { // NewKeeper Creates a new x/perp Keeper instance. func NewKeeper( cdc codec.BinaryCodec, - storeKey storetypes.StoreKey, + storeKey *storetypes.KVStoreKey, - accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, + accountKeeper authkeeper.AccountKeeper, + bankKeeper bankkeeper.Keeper, oracleKeeper types.OracleKeeper, epochKeeper types.EpochKeeper, sudoKeeper types.SudoKeeper, @@ -60,6 +63,9 @@ func NewKeeper( panic("The x/perp module account has not been set") } + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) + return Keeper{ cdc: cdc, storeKey: storeKey, @@ -69,72 +75,98 @@ func NewKeeper( EpochKeeper: epochKeeper, SudoKeeper: sudoKeeper, MarketLastVersion: collections.NewMap( - storeKey, NamespaceMarketLastVersion, + sb, + collections.NewPrefix(int(NamespaceMarketLastVersion)), + storeKey.String(), asset.PairKeyEncoder, - collections.ProtoValueEncoder[types.MarketLastVersion](cdc), + codec.CollValue[types.MarketLastVersion](cdc), ), Markets: collections.NewMap( - storeKey, NamespaceMarkets, - collections.PairKeyEncoder(asset.PairKeyEncoder, collections.Uint64KeyEncoder), - collections.ProtoValueEncoder[types.Market](cdc), + sb, + collections.NewPrefix(int(NamespaceMarkets)), + storeKey.String(), + collections.PairKeyCodec(asset.PairKeyEncoder, collections.Uint64Key), + codec.CollValue[types.Market](cdc), ), AMMs: collections.NewMap( - storeKey, NamespaceAmms, - collections.PairKeyEncoder(asset.PairKeyEncoder, collections.Uint64KeyEncoder), - collections.ProtoValueEncoder[types.AMM](cdc), + sb, + collections.NewPrefix(int(NamespaceAmms)), + storeKey.String(), + collections.PairKeyCodec(asset.PairKeyEncoder, collections.Uint64Key), + codec.CollValue[types.AMM](cdc), ), Positions: collections.NewMap( - storeKey, NamespacePositions, - collections.PairKeyEncoder(collections.PairKeyEncoder(asset.PairKeyEncoder, collections.Uint64KeyEncoder), collections.AccAddressKeyEncoder), - collections.ProtoValueEncoder[types.Position](cdc), + sb, + collections.NewPrefix(int(NamespacePositions)), + storeKey.String(), + collections.PairKeyCodec(collections.PairKeyCodec(asset.PairKeyEncoder, collections.Uint64Key), sdk.AccAddressKey), + codec.CollValue[types.Position](cdc), ), ReserveSnapshots: collections.NewMap( - storeKey, NamespaceReserveSnapshots, - collections.PairKeyEncoder(asset.PairKeyEncoder, collections.TimeKeyEncoder), - collections.ProtoValueEncoder[types.ReserveSnapshot](cdc), + sb, + collections.NewPrefix(int(NamespaceReserveSnapshots)), + storeKey.String(), + collections.PairKeyCodec(asset.PairKeyEncoder, sdk.TimeKey), + codec.CollValue[types.ReserveSnapshot](cdc), ), DnREpoch: collections.NewItem( - storeKey, NamespaceDnrEpoch, - collections.Uint64ValueEncoder, + sb, + collections.NewPrefix(int(NamespaceDnrEpoch)), + storeKey.String(), + collections.Uint64Value, ), GlobalVolumes: collections.NewMap( - storeKey, NamespaceGlobalVolumes, - collections.Uint64KeyEncoder, - collections.IntValueEncoder, + sb, + collections.NewPrefix(int(NamespaceGlobalVolumes)), + storeKey.String(), + collections.Uint64Key, + sdk.IntValue, ), TraderVolumes: collections.NewMap( - storeKey, NamespaceUserVolumes, - collections.PairKeyEncoder(collections.AccAddressKeyEncoder, collections.Uint64KeyEncoder), - collections.IntValueEncoder, + sb, + collections.NewPrefix(int(NamespaceUserVolumes)), + storeKey.String(), + collections.PairKeyCodec(sdk.AccAddressKey, collections.Uint64Key), + sdk.IntValue, ), GlobalDiscounts: collections.NewMap( - storeKey, NamespaceGlobalDiscounts, - collections.IntKeyEncoder, - collections.DecValueEncoder, + sb, + collections.NewPrefix(int(NamespaceGlobalDiscounts)), + storeKey.String(), + common.SdkIntKey, + common.LegacyDecValue, ), TraderDiscounts: collections.NewMap( - storeKey, NamespaceUserDiscounts, - collections.PairKeyEncoder(collections.AccAddressKeyEncoder, collections.IntKeyEncoder), - collections.DecValueEncoder, + sb, + collections.NewPrefix(int(NamespaceUserDiscounts)), + storeKey.String(), + collections.PairKeyCodec(sdk.AccAddressKey, common.SdkIntKey), + common.LegacyDecValue, ), EpochRebateAllocations: collections.NewMap( - storeKey, NamespaceRebatesAllocations, - collections.Uint64KeyEncoder, - collections.ProtoValueEncoder[types.DNRAllocation](cdc), + sb, + collections.NewPrefix(int(NamespaceRebatesAllocations)), + storeKey.String(), + collections.Uint64Key, + codec.CollValue[types.DNRAllocation](cdc), ), Collateral: collections.NewItem( - storeKey, NamespaceCollateral, - common.StringValueEncoder, + sb, + collections.NewPrefix(int(NamespaceCollateral)), + storeKey.String(), + collections.StringValue, ), DnREpochName: collections.NewItem( - storeKey, NamespaceDnrEpochName, - common.StringValueEncoder, + sb, + collections.NewPrefix(int(NamespaceDnrEpochName)), + storeKey.String(), + collections.StringValue, ), } } const ( - NamespaceMarkets collections.Namespace = iota + 11 // == 11 because iota starts from 0 + NamespaceMarkets uint8 = iota + 11 // == 11 because iota starts from 0 NamespaceAmms NamespacePositions NamespaceReserveSnapshots diff --git a/x/perp/v2/keeper/liquidate.go b/x/perp/v2/keeper/liquidate.go index 3be649238..f670c6664 100644 --- a/x/perp/v2/keeper/liquidate.go +++ b/x/perp/v2/keeper/liquidate.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "encoding/json" "fmt" "strings" @@ -199,11 +200,11 @@ func (k Keeper) liquidate( } // give the user the preferred position notional - var preferredPositionNotional sdk.Dec + var preferredPositionNotional sdkmath.LegacyDec if position.Size_.IsPositive() { - preferredPositionNotional = sdk.MaxDec(spotNotional, twapNotional) + preferredPositionNotional = sdkmath.LegacyMaxDec(spotNotional, twapNotional) } else { - preferredPositionNotional = sdk.MinDec(spotNotional, twapNotional) + preferredPositionNotional = sdkmath.LegacyMinDec(spotNotional, twapNotional) } marginRatio := MarginRatio(position, preferredPositionNotional, market.LatestCumulativePremiumFraction) @@ -253,7 +254,7 @@ func (k Keeper) executeFullLiquidation( market, amm, /* currentPosition */ *position, - /* quoteAssetAmountLimit */ sdk.ZeroDec(), + /* quoteAssetAmountLimit */ sdkmath.LegacyZeroDec(), ) if err != nil { return sdk.Coin{}, sdk.Coin{}, err @@ -269,7 +270,7 @@ func (k Keeper) executeFullLiquidation( if liquidatorFeeAmount.GT(remainMargin) { // if the remainMargin is not enough for liquidationFee, count it as bad debt totalBadDebt = totalBadDebt.Add(liquidatorFeeAmount.Sub(remainMargin)) - remainMargin = sdk.ZeroDec() + remainMargin = sdkmath.LegacyZeroDec() } else { // Otherwise, the remaining margin will be transferred to ecosystemFund remainMargin = remainMargin.Sub(liquidatorFeeAmount) @@ -286,7 +287,7 @@ func (k Keeper) executeFullLiquidation( } } - ecosystemFundFeeAmount := sdk.ZeroDec() + ecosystemFundFeeAmount := sdkmath.LegacyZeroDec() if remainMargin.IsPositive() { ecosystemFundFeeAmount = remainMargin } @@ -314,12 +315,12 @@ func (k Keeper) executeFullLiquidation( PositionChangedEvent: types.PositionChangedEvent{ FinalPosition: positionResp.Position, PositionNotional: positionResp.PositionNotional, - TransactionFee: sdk.NewCoin(collateral, sdk.ZeroInt()), // no transaction fee for liquidation + TransactionFee: sdk.NewCoin(collateral, sdkmath.ZeroInt()), // no transaction fee for liquidation RealizedPnl: positionResp.RealizedPnl, BadDebt: sdk.NewCoin(collateral, totalBadDebt.RoundInt()), FundingPayment: positionResp.FundingPayment, BlockHeight: ctx.BlockHeight(), - MarginToUser: sdk.ZeroInt(), // no margin to user for full liquidation + MarginToUser: sdkmath.ZeroInt(), // no margin to user for full liquidation ChangeReason: types.ChangeReason_FullLiquidation, }, LiquidatorAddress: liquidator.String(), @@ -358,7 +359,7 @@ func (k Keeper) executePartialLiquidation( amm, /* currentPosition */ *position, /* quoteAssetAmount */ quoteAssetDelta, - /* baseAmtLimit */ sdk.ZeroDec(), + /* baseAmtLimit */ sdkmath.LegacyZeroDec(), ) if err != nil { return sdk.Coin{}, sdk.Coin{}, err @@ -390,12 +391,12 @@ func (k Keeper) executePartialLiquidation( PositionChangedEvent: types.PositionChangedEvent{ FinalPosition: positionResp.Position, PositionNotional: positionResp.PositionNotional, - TransactionFee: sdk.NewCoin(collateral, sdk.ZeroInt()), // no transaction fee for liquidation + TransactionFee: sdk.NewCoin(collateral, sdkmath.ZeroInt()), // no transaction fee for liquidation RealizedPnl: positionResp.RealizedPnl, - BadDebt: sdk.NewCoin(collateral, sdk.ZeroInt()), // no bad debt for partial liquidation + BadDebt: sdk.NewCoin(collateral, sdkmath.ZeroInt()), // no bad debt for partial liquidation FundingPayment: positionResp.FundingPayment, BlockHeight: ctx.BlockHeight(), - MarginToUser: sdk.ZeroInt(), // no margin to user for partial liquidation + MarginToUser: sdkmath.ZeroInt(), // no margin to user for partial liquidation ChangeReason: types.ChangeReason_PartialLiquidation, }, LiquidatorAddress: liquidator.String(), diff --git a/x/perp/v2/keeper/margin.go b/x/perp/v2/keeper/margin.go index 8f188d130..df1cbdd18 100644 --- a/x/perp/v2/keeper/margin.go +++ b/x/perp/v2/keeper/margin.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -48,7 +49,7 @@ func (k Keeper) AddMargin( } fundingPayment := FundingPayment(position, market.LatestCumulativePremiumFraction) - remainingMargin := position.Margin.Add(sdk.NewDecFromInt(marginToAdd.Amount)).Sub(fundingPayment) + remainingMargin := position.Margin.Add(sdkmath.LegacyNewDecFromInt(marginToAdd.Amount)).Sub(fundingPayment) if remainingMargin.IsNegative() { return nil, types.ErrBadDebt.Wrapf("applying funding payment would result in negative remaining margin: %s", remainingMargin) @@ -81,9 +82,9 @@ func (k Keeper) AddMargin( &types.PositionChangedEvent{ FinalPosition: position, PositionNotional: positionNotional, - TransactionFee: sdk.NewCoin(collateral, sdk.ZeroInt()), // always zero when adding margin - RealizedPnl: sdk.ZeroDec(), // always zero when adding margin - BadDebt: sdk.NewCoin(collateral, sdk.ZeroInt()), // always zero when adding margin + TransactionFee: sdk.NewCoin(collateral, sdkmath.ZeroInt()), // always zero when adding margin + RealizedPnl: sdkmath.LegacyZeroDec(), // always zero when adding margin + BadDebt: sdk.NewCoin(collateral, sdkmath.ZeroInt()), // always zero when adding margin FundingPayment: fundingPayment, BlockHeight: ctx.BlockHeight(), MarginToUser: marginToAdd.Amount.Neg(), @@ -147,7 +148,7 @@ func (k Keeper) RemoveMargin( if err != nil { return nil, err } - minPositionNotional := sdk.MinDec(spotNotional, twapNotional) + minPositionNotional := sdkmath.LegacyMinDec(spotNotional, twapNotional) // account for funding payment fundingPayment := FundingPayment(position, market.LatestCumulativePremiumFraction) @@ -159,14 +160,14 @@ func (k Keeper) RemoveMargin( remainingMargin = remainingMargin.Add(unrealizedPnl) } - if remainingMargin.LT(sdk.NewDecFromInt(marginToRemove.Amount)) { + if remainingMargin.LT(sdkmath.LegacyNewDecFromInt(marginToRemove.Amount)) { return nil, types.ErrBadDebt.Wrapf( "not enough free collateral to remove margin; remainingMargin %s, marginToRemove %s", remainingMargin, marginToRemove, ) } // apply funding payment and remove margin - position.Margin = position.Margin.Sub(fundingPayment).Sub(sdk.NewDecFromInt(marginToRemove.Amount)) + position.Margin = position.Margin.Sub(fundingPayment).Sub(sdkmath.LegacyNewDecFromInt(marginToRemove.Amount)) position.LatestCumulativePremiumFraction = market.LatestCumulativePremiumFraction position.LastUpdatedBlockNumber = ctx.BlockHeight() @@ -187,9 +188,9 @@ func (k Keeper) RemoveMargin( &types.PositionChangedEvent{ FinalPosition: position, PositionNotional: spotNotional, - TransactionFee: sdk.NewCoin(collateral, sdk.ZeroInt()), // always zero when removing margin - RealizedPnl: sdk.ZeroDec(), // always zero when removing margin - BadDebt: sdk.NewCoin(collateral, sdk.ZeroInt()), // always zero when removing margin + TransactionFee: sdk.NewCoin(collateral, sdkmath.ZeroInt()), // always zero when removing margin + RealizedPnl: sdkmath.LegacyZeroDec(), // always zero when removing margin + BadDebt: sdk.NewCoin(collateral, sdkmath.ZeroInt()), // always zero when removing margin FundingPayment: fundingPayment, BlockHeight: ctx.BlockHeight(), MarginToUser: marginToRemove.Amount, diff --git a/x/perp/v2/keeper/msg_server.go b/x/perp/v2/keeper/msg_server.go index 38586f68b..64a4540d7 100644 --- a/x/perp/v2/keeper/msg_server.go +++ b/x/perp/v2/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -46,7 +47,7 @@ func (m msgServer) MarketOrder(goCtx context.Context, req *types.MsgMarketOrder, traderAddr, req.QuoteAssetAmount, req.Leverage, - sdk.NewDecFromInt(req.BaseAssetAmountLimit), + sdkmath.LegacyNewDecFromInt(req.BaseAssetAmountLimit), ) if err != nil { return nil, err diff --git a/x/perp/v2/keeper/position.go b/x/perp/v2/keeper/position.go index 52d5d9fe4..dc72f14ad 100644 --- a/x/perp/v2/keeper/position.go +++ b/x/perp/v2/keeper/position.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/perp/v2/types" @@ -20,7 +20,7 @@ func (k Keeper) GetPosition(ctx sdk.Context, pair asset.Pair, version uint64, ac } func (k Keeper) DeletePosition(ctx sdk.Context, pair asset.Pair, version uint64, account sdk.AccAddress) error { - err := k.Positions.Delete(ctx, collections.Join(collections.Join(pair, version), account)) + err := k.Positions.Remove(ctx, collections.Join(collections.Join(pair, version), account)) if err != nil { return types.ErrPositionNotFound } @@ -29,5 +29,5 @@ func (k Keeper) DeletePosition(ctx sdk.Context, pair asset.Pair, version uint64, } func (k Keeper) SavePosition(ctx sdk.Context, pair asset.Pair, version uint64, account sdk.AccAddress, position types.Position) { - k.Positions.Insert(ctx, collections.Join(collections.Join(position.Pair, version), account), position) + k.Positions.Set(ctx, collections.Join(collections.Join(position.Pair, version), account), position) } diff --git a/x/perp/v2/keeper/settlement.go b/x/perp/v2/keeper/settlement.go index 5396be2b3..dd6516a3c 100644 --- a/x/perp/v2/keeper/settlement.go +++ b/x/perp/v2/keeper/settlement.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" @@ -48,7 +49,7 @@ func (k Keeper) SettlePosition(ctx sdk.Context, pair asset.Pair, version uint64, traderAddr, *positionResp, types.ChangeReason_Settlement, - sdk.ZeroInt(), + sdkmath.ZeroInt(), position, ); err != nil { return nil, err @@ -64,20 +65,20 @@ func (k Keeper) settlePosition(ctx sdk.Context, market types.Market, amm types.A resp = &types.PositionResp{ ExchangedPositionSize: position.Size_.Neg(), - PositionNotional: sdk.ZeroDec(), + PositionNotional: sdkmath.LegacyZeroDec(), FundingPayment: FundingPayment(position, market.LatestCumulativePremiumFraction), RealizedPnl: UnrealizedPnl(position, positionNotional), - UnrealizedPnlAfter: sdk.ZeroDec(), + UnrealizedPnlAfter: sdkmath.LegacyZeroDec(), } remainingMargin := position.Margin.Add(resp.RealizedPnl).Sub(resp.FundingPayment) if remainingMargin.IsPositive() { - resp.BadDebt = sdk.ZeroDec() + resp.BadDebt = sdkmath.LegacyZeroDec() resp.MarginToVault = remainingMargin.Neg() } else { resp.BadDebt = remainingMargin.Abs() - resp.MarginToVault = sdk.ZeroDec() + resp.MarginToVault = sdkmath.LegacyZeroDec() } var dir types.Direction @@ -92,7 +93,7 @@ func (k Keeper) settlePosition(ctx sdk.Context, market types.Market, amm types.A amm, dir, position.Size_.Abs(), - sdk.ZeroDec(), + sdkmath.LegacyZeroDec(), ) if err != nil { return nil, nil, err @@ -102,9 +103,9 @@ func (k Keeper) settlePosition(ctx sdk.Context, market types.Market, amm types.A resp.Position = types.Position{ TraderAddress: position.TraderAddress, Pair: position.Pair, - Size_: sdk.ZeroDec(), - Margin: sdk.ZeroDec(), - OpenNotional: sdk.ZeroDec(), + Size_: sdkmath.LegacyZeroDec(), + Margin: sdkmath.LegacyZeroDec(), + OpenNotional: sdkmath.LegacyZeroDec(), LatestCumulativePremiumFraction: market.LatestCumulativePremiumFraction, LastUpdatedBlockNumber: ctx.BlockHeight(), } diff --git a/x/perp/v2/keeper/sudo.go b/x/perp/v2/keeper/sudo.go index bd3636fcf..cbbdfe3d9 100644 --- a/x/perp/v2/keeper/sudo.go +++ b/x/perp/v2/keeper/sudo.go @@ -67,8 +67,8 @@ func (k sudoExtension) WithdrawFromPerpFund( type ArgsCreateMarket struct { Pair asset.Pair - PriceMultiplier sdk.Dec - SqrtDepth sdk.Dec + PriceMultiplier sdkmath.LegacyDec + SqrtDepth sdkmath.LegacyDec Market *types.Market // pointer makes it optional // EnableMarket: Optionally enable the default market without explicitly passing // in each field as an argument. If 'Market' is present, this field is ignored. @@ -100,7 +100,10 @@ func (k sudoExtension) CreateMarket( return err } - lastVersion := k.MarketLastVersion.GetOr(ctx, pair, types.MarketLastVersion{Version: 0}) + lastVersion, err := k.MarketLastVersion.Get(ctx, pair) + if err != nil { + lastVersion = types.MarketLastVersion{Version: 0} + } lastVersion.Version += 1 market.Version = lastVersion.Version @@ -112,8 +115,8 @@ func (k sudoExtension) CreateMarket( QuoteReserve: quoteReserve, SqrtDepth: sqrtDepth, PriceMultiplier: args.PriceMultiplier, - TotalLong: sdk.ZeroDec(), - TotalShort: sdk.ZeroDec(), + TotalLong: sdkmath.LegacyZeroDec(), + TotalShort: sdkmath.LegacyZeroDec(), } if err := amm.Validate(); err != nil { return err @@ -121,7 +124,7 @@ func (k sudoExtension) CreateMarket( k.SaveMarket(ctx, market) k.SaveAMM(ctx, amm) - k.MarketLastVersion.Insert(ctx, pair, lastVersion) + k.MarketLastVersion.Set(ctx, pair, lastVersion) return nil } @@ -192,7 +195,7 @@ func (k sudoExtension) UnsafeChangeCollateralDenom( func (k sudoExtension) ShiftPegMultiplier( ctx sdk.Context, pair asset.Pair, - newPriceMultiplier sdk.Dec, + newPriceMultiplier sdkmath.LegacyDec, sender sdk.AccAddress, ) error { if err := k.SudoKeeper.CheckPermissions(sender, ctx); err != nil { diff --git a/x/perp/v2/keeper/swap.go b/x/perp/v2/keeper/swap.go index 8751e8389..7d6c22796 100644 --- a/x/perp/v2/keeper/swap.go +++ b/x/perp/v2/keeper/swap.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" types "github.com/NibiruChain/nibiru/x/perp/v2/types" @@ -8,7 +9,7 @@ import ( // checkUserLimits checks if the limit is violated by the amount. // returns error if it does -func checkUserLimits(limit, amount sdk.Dec, dir types.Direction) error { +func checkUserLimits(limit, amount sdkmath.LegacyDec, dir types.Direction) error { if limit.IsZero() { return nil } @@ -53,16 +54,16 @@ func (k Keeper) SwapQuoteAsset( ctx sdk.Context, amm types.AMM, dir types.Direction, - quoteAssetAmt sdk.Dec, // unsigned - baseAssetLimit sdk.Dec, // unsigned -) (updatedAMM *types.AMM, baseAssetDelta sdk.Dec, err error) { + quoteAssetAmt sdkmath.LegacyDec, // unsigned + baseAssetLimit sdkmath.LegacyDec, // unsigned +) (updatedAMM *types.AMM, baseAssetDelta sdkmath.LegacyDec, err error) { baseAssetDelta, err = amm.SwapQuoteAsset(quoteAssetAmt, dir) if err != nil { - return nil, sdk.Dec{}, err + return nil, sdkmath.LegacyDec{}, err } if err := checkUserLimits(baseAssetLimit, baseAssetDelta, dir); err != nil { - return nil, sdk.Dec{}, err + return nil, sdkmath.LegacyDec{}, err } k.SaveAMM(ctx, amm) @@ -91,20 +92,20 @@ func (k Keeper) SwapBaseAsset( ctx sdk.Context, amm types.AMM, dir types.Direction, - baseAssetAmt sdk.Dec, - quoteAssetLimit sdk.Dec, -) (updatedAMM *types.AMM, quoteAssetDelta sdk.Dec, err error) { + baseAssetAmt sdkmath.LegacyDec, + quoteAssetLimit sdkmath.LegacyDec, +) (updatedAMM *types.AMM, quoteAssetDelta sdkmath.LegacyDec, err error) { if baseAssetAmt.IsZero() { - return &amm, sdk.ZeroDec(), nil + return &amm, sdkmath.LegacyZeroDec(), nil } quoteAssetDelta, err = amm.SwapBaseAsset(baseAssetAmt, dir) if err != nil { - return nil, sdk.Dec{}, err + return nil, sdkmath.LegacyDec{}, err } if err := checkUserLimits(quoteAssetLimit, quoteAssetDelta, dir); err != nil { - return nil, sdk.Dec{}, err + return nil, sdkmath.LegacyDec{}, err } k.SaveAMM(ctx, amm) diff --git a/x/perp/v2/keeper/twap.go b/x/perp/v2/keeper/twap.go index 473fdac9b..3d62e5653 100644 --- a/x/perp/v2/keeper/twap.go +++ b/x/perp/v2/keeper/twap.go @@ -1,9 +1,10 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "time" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" @@ -23,7 +24,7 @@ args: - lookbackInterval: how far back to calculate TWAP ret: - - price: TWAP as sdk.Dec + - price: TWAP as sdkmath.LegacyDec - err: error */ func (k Keeper) CalcTwap( @@ -31,24 +32,21 @@ func (k Keeper) CalcTwap( pair asset.Pair, twapCalcOption types.TwapCalcOption, direction types.Direction, - assetAmt sdk.Dec, + assetAmt sdkmath.LegacyDec, lookbackInterval time.Duration, -) (price sdk.Dec, err error) { +) (price sdkmath.LegacyDec, err error) { // earliest timestamp we'll look back until lowerLimitTimestampMs := ctx.BlockTime().Add(-1 * lookbackInterval).UnixMilli() // fetch snapshots from state var snapshots []types.ReserveSnapshot - iter := k.ReserveSnapshots.Iterate( + iter, _ := k.ReserveSnapshots.Iterate( ctx, - collections.PairRange[asset.Pair, time.Time]{}. - Prefix(pair). - EndInclusive(ctx.BlockTime()). - Descending(), + collections.NewPrefixedPairRange[asset.Pair, time.Time](pair).EndInclusive(ctx.BlockTime()).Descending(), ) defer iter.Close() for ; iter.Valid(); iter.Next() { - s := iter.Value() + s, _ := iter.Value() snapshots = append(snapshots, s) if s.TimestampMs <= lowerLimitTimestampMs { break @@ -56,7 +54,7 @@ func (k Keeper) CalcTwap( } if len(snapshots) == 0 { - return sdk.OneDec().Neg(), types.ErrNoValidTWAP + return sdkmath.LegacyOneDec().Neg(), types.ErrNoValidTWAP } // circuit-breaker when there's only one snapshot to process @@ -73,7 +71,7 @@ func (k Keeper) CalcTwap( // else, iterate over all snapshots and calculate TWAP prevTimestampMs := ctx.BlockTime().UnixMilli() - cumulativePrice := sdk.ZeroDec() + cumulativePrice := sdkmath.LegacyZeroDec() cumulativePeriodMs := int64(0) for _, snapshot := range snapshots { @@ -92,7 +90,7 @@ func (k Keeper) CalcTwap( }, ) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } var timeElapsedMs int64 @@ -138,7 +136,7 @@ BASE_ASSET_SWAP: price when swapping x amount of base assets type snapshotPriceOps struct { twapCalcOption types.TwapCalcOption direction types.Direction - assetAmt sdk.Dec + assetAmt sdkmath.LegacyDec } /* @@ -156,13 +154,13 @@ args: - assetAmount: the amount of base or quote asset; only required for QUOTE_ASSET_SWAP or BASE_ASSET_SWAP ret: - - price: the price as sdk.Dec + - price: the price as sdkmath.LegacyDec - err: error */ func getPriceWithSnapshot( snapshot types.ReserveSnapshot, opts snapshotPriceOps, -) (price sdk.Dec, err error) { +) (price sdkmath.LegacyDec, err error) { priceMult := snapshot.Amm.PriceMultiplier switch opts.twapCalcOption { case types.TwapCalcOption_SPOT: @@ -175,10 +173,10 @@ func getPriceWithSnapshot( case types.TwapCalcOption_BASE_ASSET_SWAP: quoteReserve, err := snapshot.Amm.GetQuoteReserveAmt(opts.assetAmt, opts.direction) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } return types.QuoteReserveToAsset(quoteReserve, priceMult), nil } - return sdk.ZeroDec(), nil + return sdkmath.LegacyZeroDec(), nil } diff --git a/x/perp/v2/keeper/twap_test.go b/x/perp/v2/keeper/twap_test.go index c0b0f3a5c..f51429e48 100644 --- a/x/perp/v2/keeper/twap_test.go +++ b/x/perp/v2/keeper/twap_test.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" diff --git a/x/perp/v2/keeper/withdraw.go b/x/perp/v2/keeper/withdraw.go index 29c89ff23..c00844c7a 100644 --- a/x/perp/v2/keeper/withdraw.go +++ b/x/perp/v2/keeper/withdraw.go @@ -91,7 +91,7 @@ func (k Keeper) IncrementPrepaidBadDebt(ctx sdk.Context, market types.Market, am // ZeroPrepaidBadDebt out the prepaid bad debt func (k Keeper) ZeroPrepaidBadDebt(ctx sdk.Context, market types.Market) { - market.PrepaidBadDebt.Amount = sdk.ZeroInt() + market.PrepaidBadDebt.Amount = sdkmath.ZeroInt() k.SaveMarket(ctx, market) } diff --git a/x/perp/v2/module/abci.go b/x/perp/v2/module/abci.go index 873ed7e83..fa480ff86 100644 --- a/x/perp/v2/module/abci.go +++ b/x/perp/v2/module/abci.go @@ -1,10 +1,11 @@ package perp import ( + sdkmath "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/perp/v2/keeper" @@ -13,7 +14,18 @@ import ( // EndBlocker Called every block to store a snapshot of the perpamm. func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate { - for _, amm := range k.AMMs.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() { + iter, err := k.AMMs.Iterate(ctx, &collections.Range[collections.Pair[asset.Pair, uint64]]{}) + if err != nil { + k.Logger(ctx).Error("failed iterating amms", "error", err) + return []abci.ValidatorUpdate{} + } + values, err := iter.Values() + if err != nil { + k.Logger(ctx).Error("failed getting amm values", "error", err) + return []abci.ValidatorUpdate{} + } + + for _, amm := range values { market, err := k.GetMarket(ctx, amm.Pair) if err != nil { k.Logger(ctx).Error("failed to fetch market", "pair", amm.Pair, "error", err) @@ -29,9 +41,9 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate { Amm: amm, TimestampMs: ctx.BlockTime().UnixMilli(), } - k.ReserveSnapshots.Insert(ctx, collections.Join(amm.Pair, ctx.BlockTime()), snapshot) + k.ReserveSnapshots.Set(ctx, collections.Join(amm.Pair, ctx.BlockTime()), snapshot) - markTwap, err := k.CalcTwap(ctx, amm.Pair, types.TwapCalcOption_SPOT, types.Direction_DIRECTION_UNSPECIFIED, sdk.ZeroDec(), market.TwapLookbackWindow) + markTwap, err := k.CalcTwap(ctx, amm.Pair, types.TwapCalcOption_SPOT, types.Direction_DIRECTION_UNSPECIFIED, sdkmath.LegacyZeroDec(), market.TwapLookbackWindow) if err != nil { k.Logger(ctx).Error("failed to fetch twap mark price", "market.Pair", market.Pair, "error", err) continue @@ -42,11 +54,11 @@ func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate { continue } - var indexTwap sdk.Dec + var indexTwap sdkmath.LegacyDec indexTwap, err = k.OracleKeeper.GetExchangeRateTwap(ctx, market.OraclePair) if err != nil { k.Logger(ctx).Error("failed to fetch twap index price", "market.Pair", market.Pair, "market.OraclePair", market.OraclePair, "error", err) - indexTwap = sdk.OneDec().Neg() + indexTwap = sdkmath.LegacyOneDec().Neg() } if indexTwap.IsNil() { diff --git a/x/perp/v2/module/abci_test.go b/x/perp/v2/module/abci_test.go index 164262f80..b44361e5d 100644 --- a/x/perp/v2/module/abci_test.go +++ b/x/perp/v2/module/abci_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/x/perp/v2/module/genesis.go b/x/perp/v2/module/genesis.go index 080bc5443..a0f208ce4 100644 --- a/x/perp/v2/module/genesis.go +++ b/x/perp/v2/module/genesis.go @@ -3,8 +3,8 @@ package perp import ( "time" - "cosmossdk.io/math" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -29,14 +29,14 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) } for _, g := range genState.MarketLastVersions { - k.MarketLastVersion.Insert(ctx, g.Pair, types.MarketLastVersion{Version: g.Version}) + k.MarketLastVersion.Set(ctx, g.Pair, types.MarketLastVersion{Version: g.Version}) } for _, amm := range genState.Amms { pair := amm.Pair k.SaveAMM(ctx, amm) timestampMs := ctx.BlockTime().UnixMilli() - k.ReserveSnapshots.Insert( + k.ReserveSnapshots.Set( ctx, collections.Join(pair, time.UnixMilli(timestampMs)), types.ReserveSnapshot{ @@ -51,14 +51,14 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) } for _, vol := range genState.TraderVolumes { - k.TraderVolumes.Insert( + k.TraderVolumes.Set( ctx, collections.Join(sdk.MustAccAddressFromBech32(vol.Trader), vol.Epoch), vol.Volume, ) } for _, globalDiscount := range genState.GlobalDiscount { - k.GlobalDiscounts.Insert( + k.GlobalDiscounts.Set( ctx, globalDiscount.Volume, globalDiscount.Fee, @@ -66,7 +66,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) } for _, customDiscount := range genState.CustomDiscounts { - k.TraderDiscounts.Insert( + k.TraderDiscounts.Set( ctx, collections.Join(sdk.MustAccAddressFromBech32(customDiscount.Trader), customDiscount.Discount.Volume), customDiscount.Discount.Fee, @@ -81,7 +81,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) } for _, globalVolume := range genState.GlobalVolumes { - k.GlobalVolumes.Insert( + k.GlobalVolumes.Set( ctx, globalVolume.Epoch, globalVolume.Volume, @@ -89,7 +89,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) } for _, rebateAlloc := range genState.RebatesAllocations { - k.EpochRebateAllocations.Insert( + k.EpochRebateAllocations.Set( ctx, rebateAlloc.Epoch, types.DNRAllocation{ @@ -104,9 +104,30 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := new(types.GenesisState) - genesis.Markets = k.Markets.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() + iterMarkets, err := k.Markets.Iterate(ctx, &collections.Range[collections.Pair[asset.Pair, uint64]]{}) + valuesMarkets, err := iterMarkets.Values() + if err != nil { + k.Logger(ctx).Error("failed getting max markets", "error", err) + return nil + } + genesis.Markets = valuesMarkets + if err != nil { + k.Logger(ctx).Error("failed to get market values", "error", err) + return nil + } + + iterMarketLastVersion, err := k.MarketLastVersion.Iterate(ctx, &collections.Range[asset.Pair]{}) + if err != nil { + k.Logger(ctx).Error("failed to get market last version", "error", err) + return nil + } + kviterMarketLastVersion, err := iterMarketLastVersion.KeyValues() + if err != nil { + k.Logger(ctx).Error("failed to get market last version key values", "error", err) + return nil + } - kv := k.MarketLastVersion.Iterate(ctx, collections.Range[asset.Pair]{}).KeyValues() + kv := kviterMarketLastVersion for _, kv := range kv { genesis.MarketLastVersions = append(genesis.MarketLastVersions, types.GenesisMarketLastVersion{ Pair: kv.Key, @@ -114,8 +135,30 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { }) } - genesis.Amms = k.AMMs.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() - pkv := k.Positions.Iterate(ctx, collections.PairRange[collections.Pair[asset.Pair, uint64], sdk.AccAddress]{}).KeyValues() + iterAmms, err := k.AMMs.Iterate(ctx, &collections.Range[collections.Pair[asset.Pair, uint64]]{}) + if err != nil { + k.Logger(ctx).Error("failed to get amms", "error", err) + return nil + } + valuesAmms, err := iterAmms.Values() + if err != nil { + k.Logger(ctx).Error("failed to get amm values", "error", err) + return nil + } + genesis.Amms = valuesAmms + + iterPairRange, err := k.Positions.Iterate(ctx, &collections.PairRange[collections.Pair[asset.Pair, uint64], sdk.AccAddress]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate pair ranges", "error", err) + return nil + } + kvPairRange, err := iterPairRange.KeyValues() + if err != nil { + k.Logger(ctx).Error("failed to get pair range key values", "error", err) + return nil + } + + pkv := kvPairRange for _, kv := range pkv { genesis.Positions = append(genesis.Positions, types.GenesisPosition{ Pair: kv.Key.K1().K1(), @@ -123,42 +166,75 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { Position: kv.Value, }) } - genesis.ReserveSnapshots = k.ReserveSnapshots.Iterate(ctx, collections.PairRange[asset.Pair, time.Time]{}).Values() - genesis.DnrEpoch = k.DnREpoch.GetOr(ctx, 0) - genesis.DnrEpochName = k.DnREpochName.GetOr(ctx, "") + + iterReserveSnapshots, err := k.ReserveSnapshots.Iterate(ctx, &collections.PairRange[asset.Pair, time.Time]{}) + if err != nil { + k.Logger(ctx).Error("failed to get iterate reserve snapshots", "error", err) + return nil + } + valuesReserveSnapshots, err := iterReserveSnapshots.Values() + if err != nil { + k.Logger(ctx).Error("failed to get reserve snapshots values", "error", err) + return nil + } + + genesis.ReserveSnapshots = valuesReserveSnapshots + genesis.DnrEpoch, err = k.DnREpoch.Get(ctx) + if err != nil { + genesis.DnrEpoch = 0 + } + genesis.DnrEpochName, err = k.DnREpochName.Get(ctx) + if err != nil { + genesis.DnrEpochName = "" + } // export volumes - volumes := k.TraderVolumes.Iterate(ctx, collections.PairRange[sdk.AccAddress, uint64]{}) + volumes, err := k.TraderVolumes.Iterate(ctx, &collections.PairRange[sdk.AccAddress, uint64]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate trader volumes", "error", err) + return nil + } defer volumes.Close() for ; volumes.Valid(); volumes.Next() { - key := volumes.Key() + key, _ := volumes.Key() + value, _ := volumes.Value() genesis.TraderVolumes = append(genesis.TraderVolumes, types.GenesisState_TraderVolume{ Trader: key.K1().String(), Epoch: key.K2(), - Volume: volumes.Value(), + Volume: value, }) } // export global discounts - discounts := k.GlobalDiscounts.Iterate(ctx, collections.Range[math.Int]{}) + discounts, err := k.GlobalDiscounts.Iterate(ctx, &collections.Range[sdkmath.Int]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate discounts", "error", err) + return nil + } defer discounts.Close() for ; discounts.Valid(); discounts.Next() { + key, _ := discounts.Key() + value, _ := discounts.Value() genesis.GlobalDiscount = append(genesis.GlobalDiscount, types.GenesisState_Discount{ - Fee: discounts.Value(), - Volume: discounts.Key(), + Fee: value, + Volume: key, }) } // export custom discounts - customDiscounts := k.TraderDiscounts.Iterate(ctx, collections.PairRange[sdk.AccAddress, math.Int]{}) + customDiscounts, err := k.TraderDiscounts.Iterate(ctx, &collections.PairRange[sdk.AccAddress, sdkmath.Int]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate custom discounts", "error", err) + return nil + } defer customDiscounts.Close() for ; customDiscounts.Valid(); customDiscounts.Next() { - key := customDiscounts.Key() + key, _ := customDiscounts.Key() genesis.CustomDiscounts = append(genesis.CustomDiscounts, types.GenesisState_CustomDiscount{ Trader: key.K1().String(), Discount: &types.GenesisState_Discount{ - Fee: sdk.Dec{}, + Fee: sdkmath.LegacyDec{}, Volume: key.K2(), }, }) @@ -171,17 +247,28 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.CollateralDenom = collateral // export global volumes - globalVolumes := k.GlobalVolumes.Iterate(ctx, collections.Range[uint64]{}) + globalVolumes, err := k.GlobalVolumes.Iterate(ctx, &collections.Range[uint64]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate global volumes", "error", err) + return nil + } defer globalVolumes.Close() for ; globalVolumes.Valid(); globalVolumes.Next() { + key, _ := globalVolumes.Key() + value, _ := globalVolumes.Value() genesis.GlobalVolumes = append(genesis.GlobalVolumes, types.GenesisState_GlobalVolume{ - Epoch: globalVolumes.Key(), - Volume: globalVolumes.Value(), + Epoch: key, + Volume: value, }) } // export rebates allocations - genesis.RebatesAllocations = k.EpochRebateAllocations.Iterate(ctx, collections.Range[uint64]{}).Values() + iter, err := k.EpochRebateAllocations.Iterate(ctx, &collections.Range[uint64]{}) + if err != nil { + k.Logger(ctx).Error("failed to iterate rebates allocations", "error", err) + return nil + } + genesis.RebatesAllocations, err = iter.Values() return genesis } diff --git a/x/perp/v2/module/genesis_test.go b/x/perp/v2/module/genesis_test.go index f92dcbf45..cacb6e680 100644 --- a/x/perp/v2/module/genesis_test.go +++ b/x/perp/v2/module/genesis_test.go @@ -4,8 +4,8 @@ import ( "encoding/json" "testing" + "cosmossdk.io/collections" "cosmossdk.io/math" - "github.com/NibiruChain/collections" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/perp/v2/module/module.go b/x/perp/v2/module/module.go index 8770bb84a..585023fe4 100644 --- a/x/perp/v2/module/module.go +++ b/x/perp/v2/module/module.go @@ -162,11 +162,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ sdk.Context) {} // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context) []abci.ValidatorUpdate { EndBlocker(ctx, am.keeper) return []abci.ValidatorUpdate{} } @@ -177,10 +177,20 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // RegisterStoreDecoder implements module.AppModuleSimulation. -func (AppModule) RegisterStoreDecoder(sdk.StoreDecoderRegistry) { +func (AppModule) RegisterStoreDecoder(simtypes.StoreDecoderRegistry) { } // WeightedOperations implements module.AppModuleSimulation. func (AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return []simtypes.WeightedOperation{} } + +func (am AppModule) IsOnePerModuleType() { + //TODO implement me + panic("implement me") +} + +func (am AppModule) IsAppModule() { + //TODO implement me + panic("implement me") +} diff --git a/x/perp/v2/types/amm.go b/x/perp/v2/types/amm.go index 27f052edd..1295859cb 100644 --- a/x/perp/v2/types/amm.go +++ b/x/perp/v2/types/amm.go @@ -6,26 +6,24 @@ import ( sdkerrors "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/nibiru/x/common" "github.com/NibiruChain/nibiru/x/common/asset" ) func (amm AMM) Validate() error { - if amm.BaseReserve.LTE(sdk.ZeroDec()) { + if amm.BaseReserve.LTE(sdkmath.LegacyZeroDec()) { return ErrAmmBaseSupplyNonpositive } - if amm.QuoteReserve.LTE(sdk.ZeroDec()) { + if amm.QuoteReserve.LTE(sdkmath.LegacyZeroDec()) { return ErrAmmQuoteSupplyNonpositive } - if amm.PriceMultiplier.LTE(sdk.ZeroDec()) { + if amm.PriceMultiplier.LTE(sdkmath.LegacyZeroDec()) { return ErrAmmNonPositivePegMult } - if amm.SqrtDepth.LTE(sdk.ZeroDec()) { + if amm.SqrtDepth.LTE(sdkmath.LegacyZeroDec()) { return ErrAmmNonPositiveSwapInvariant } @@ -34,7 +32,7 @@ func (amm AMM) Validate() error { return err } - if !amm.SqrtDepth.Sub(computedSqrtDepth).Abs().LTE(sdk.OneDec()) { + if !amm.SqrtDepth.Sub(computedSqrtDepth).Abs().LTE(sdkmath.LegacyOneDec()) { return ErrLiquidityDepth.Wrap( "computed sqrt and current sqrt are mismatched. pool: " + amm.String()) } @@ -58,7 +56,7 @@ func (amm AMM) Validate() error { // - newAmm: The AMM that results from closing all positions together. Note that // this should have a bias, or skew, of 0. // - err: Errors if it's impossible to swap away the open interest bias. -func (amm AMM) ComputeSettlementPrice() (sdk.Dec, AMM, error) { +func (amm AMM) ComputeSettlementPrice() (sdkmath.LegacyDec, AMM, error) { // bias: open interest (base) skew in the AMM. bias := amm.Bias() if bias.IsZero() { @@ -74,7 +72,7 @@ func (amm AMM) ComputeSettlementPrice() (sdk.Dec, AMM, error) { quoteAssetDelta, err := amm.SwapBaseAsset(bias.Abs(), dir) if err != nil { - return sdk.Dec{}, AMM{}, err + return sdkmath.LegacyDec{}, AMM{}, err } price := quoteAssetDelta.Abs().Quo(bias.Abs()) @@ -82,12 +80,12 @@ func (amm AMM) ComputeSettlementPrice() (sdk.Dec, AMM, error) { } // QuoteReserveToAsset converts quote reserves to assets\ -func (amm AMM) QuoteReserveToAsset(quoteReserve sdk.Dec) sdk.Dec { +func (amm AMM) QuoteReserveToAsset(quoteReserve sdkmath.LegacyDec) sdkmath.LegacyDec { return QuoteReserveToAsset(quoteReserve, amm.PriceMultiplier) } // QuoteAssetToReserve converts quote assets to reserves -func (amm AMM) QuoteAssetToReserve(quoteAssets sdk.Dec) sdk.Dec { +func (amm AMM) QuoteAssetToReserve(quoteAssets sdkmath.LegacyDec) sdkmath.LegacyDec { return QuoteAssetToReserve(quoteAssets, amm.PriceMultiplier) } @@ -95,7 +93,7 @@ func (amm AMM) QuoteAssetToReserve(quoteAssets sdk.Dec) sdk.Dec { // convention, "assets" are liquid funds that change hands, whereas reserves // are simply a number field on the DAMM. The reason for this distinction is to // account for the AMM.PriceMultiplier. -func QuoteAssetToReserve(quoteAsset, priceMult sdk.Dec) sdk.Dec { +func QuoteAssetToReserve(quoteAsset, priceMult sdkmath.LegacyDec) sdkmath.LegacyDec { return quoteAsset.Quo(priceMult) } @@ -103,7 +101,7 @@ func QuoteAssetToReserve(quoteAsset, priceMult sdk.Dec) sdk.Dec { // convention, "assets" are liquid funds that change hands, whereas reserves // are simply a number field on the DAMM. The reason for this distinction is to // account for the AMM.PriceMultiplier. -func QuoteReserveToAsset(quoteReserve, priceMult sdk.Dec) sdk.Dec { +func QuoteReserveToAsset(quoteReserve, priceMult sdkmath.LegacyDec) sdkmath.LegacyDec { return quoteReserve.Mul(priceMult) } @@ -120,16 +118,16 @@ func QuoteReserveToAsset(quoteReserve, priceMult sdk.Dec) sdk.Dec { // NOTE: baseReserveDelta is always positive // Throws an error if input quoteReserveAmt is negative, or if the final quote reserve is not positive func (amm AMM) GetBaseReserveAmt( - quoteReserveAmt sdk.Dec, // unsigned + quoteReserveAmt sdkmath.LegacyDec, // unsigned dir Direction, -) (baseReserveDelta sdk.Dec, err error) { +) (baseReserveDelta sdkmath.LegacyDec, err error) { if quoteReserveAmt.IsNegative() { - return sdk.Dec{}, ErrInputQuoteAmtNegative + return sdkmath.LegacyDec{}, ErrInputQuoteAmtNegative } invariant := amm.QuoteReserve.Mul(amm.BaseReserve) // x * y = k - var quoteReservesAfter sdk.Dec + var quoteReservesAfter sdkmath.LegacyDec if dir == Direction_LONG { quoteReservesAfter = amm.QuoteReserve.Add(quoteReserveAmt) } else { @@ -137,7 +135,7 @@ func (amm AMM) GetBaseReserveAmt( } if !quoteReservesAfter.IsPositive() { - return sdk.Dec{}, ErrAmmNonpositiveReserves + return sdkmath.LegacyDec{}, ErrAmmNonpositiveReserves } baseReservesAfter := invariant.Quo(quoteReservesAfter) @@ -158,19 +156,19 @@ func (amm AMM) GetBaseReserveAmt( // // NOTE: quoteReserveDelta is always positive func (amm AMM) GetQuoteReserveAmt( - baseReserveAmt sdk.Dec, + baseReserveAmt sdkmath.LegacyDec, dir Direction, -) (quoteReserveDelta sdk.Dec, err error) { +) (quoteReserveDelta sdkmath.LegacyDec, err error) { if baseReserveAmt.IsNegative() { - return sdk.Dec{}, ErrInputBaseAmtNegative + return sdkmath.LegacyDec{}, ErrInputBaseAmtNegative } if baseReserveAmt.IsZero() { - return sdk.ZeroDec(), nil + return sdkmath.LegacyZeroDec(), nil } invariant := amm.QuoteReserve.Mul(amm.BaseReserve) // x * y = k - var baseReservesAfter sdk.Dec + var baseReservesAfter sdkmath.LegacyDec if dir == Direction_LONG { baseReservesAfter = amm.BaseReserve.Sub(baseReserveAmt) } else { @@ -178,7 +176,7 @@ func (amm AMM) GetQuoteReserveAmt( } if !baseReservesAfter.IsPositive() { - return sdk.Dec{}, ErrAmmNonpositiveReserves.Wrapf( + return sdkmath.LegacyDec{}, ErrAmmNonpositiveReserves.Wrapf( "base assets below zero (%s) after trying to swap %s base assets", baseReservesAfter.String(), baseReserveAmt.String(), @@ -194,23 +192,23 @@ func (amm AMM) GetQuoteReserveAmt( // InstMarkPrice returns the instantaneous mark price of the trading pair. // This is the price if the AMM has zero slippage, or equivalently, if there's // infinite liquidity depth with the same ratio of reserves. -func (amm AMM) InstMarkPrice() sdk.Dec { +func (amm AMM) InstMarkPrice() sdkmath.LegacyDec { if amm.BaseReserve.IsNil() || amm.BaseReserve.IsZero() || amm.QuoteReserve.IsNil() || amm.QuoteReserve.IsZero() { - return sdk.ZeroDec() + return sdkmath.LegacyZeroDec() } return amm.QuoteReserve.Quo(amm.BaseReserve).Mul(amm.PriceMultiplier) } // ComputeSqrtDepth returns the sqrt of the product of the reserves -func (amm AMM) ComputeSqrtDepth() (sqrtDepth sdk.Dec, err error) { +func (amm AMM) ComputeSqrtDepth() (sqrtDepth sdkmath.LegacyDec, err error) { liqDepthBigInt := new(big.Int).Mul( amm.QuoteReserve.BigInt(), amm.BaseReserve.BigInt(), ) chopped := common.ChopPrecisionAndRound(liqDepthBigInt) if chopped.BitLen() > common.MaxDecBitLen { - return sdk.Dec{}, ErrAmmLiquidityDepthOverflow + return sdkmath.LegacyDec{}, ErrAmmLiquidityDepthOverflow } liqDepth := amm.QuoteReserve.Mul(amm.BaseReserve) return common.SqrtDec(liqDepth) @@ -221,32 +219,32 @@ func (amm *AMM) WithPair(pair asset.Pair) *AMM { return amm } -func (amm *AMM) WithBaseReserve(baseReserve sdk.Dec) *AMM { +func (amm *AMM) WithBaseReserve(baseReserve sdkmath.LegacyDec) *AMM { amm.BaseReserve = baseReserve return amm } -func (amm *AMM) WithQuoteReserve(quoteReserve sdk.Dec) *AMM { +func (amm *AMM) WithQuoteReserve(quoteReserve sdkmath.LegacyDec) *AMM { amm.QuoteReserve = quoteReserve return amm } -func (amm *AMM) WithPriceMultiplier(priceMultiplier sdk.Dec) *AMM { +func (amm *AMM) WithPriceMultiplier(priceMultiplier sdkmath.LegacyDec) *AMM { amm.PriceMultiplier = priceMultiplier return amm } -func (amm *AMM) WithTotalLong(totalLong sdk.Dec) *AMM { +func (amm *AMM) WithTotalLong(totalLong sdkmath.LegacyDec) *AMM { amm.TotalLong = totalLong return amm } -func (amm *AMM) WithTotalShort(totalShort sdk.Dec) *AMM { +func (amm *AMM) WithTotalShort(totalShort sdkmath.LegacyDec) *AMM { amm.TotalShort = totalShort return amm } -func (amm *AMM) WithSqrtDepth(sqrtDepth sdk.Dec) *AMM { +func (amm *AMM) WithSqrtDepth(sqrtDepth sdkmath.LegacyDec) *AMM { amm.SqrtDepth = sqrtDepth return amm } @@ -263,13 +261,13 @@ func (amm *AMM) WithSqrtDepth(sqrtDepth sdk.Dec) *AMM { // // NOTE: baseAssetDelta is always positive func (amm *AMM) SwapQuoteAsset( - quoteAssetAmt sdk.Dec, // unsigned + quoteAssetAmt sdkmath.LegacyDec, // unsigned dir Direction, -) (baseAssetDelta sdk.Dec, err error) { +) (baseAssetDelta sdkmath.LegacyDec, err error) { quoteReserveAmt := QuoteAssetToReserve(quoteAssetAmt, amm.PriceMultiplier) baseReserveDelta, err := amm.GetBaseReserveAmt(quoteReserveAmt, dir) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } if dir == Direction_LONG { @@ -294,10 +292,10 @@ func (amm *AMM) SwapQuoteAsset( // returns: // - quoteAssetDelta: amount of quote asset received. Always positive // - err: error if any -func (amm *AMM) SwapBaseAsset(baseAssetAmt sdk.Dec, dir Direction) (quoteAssetDelta sdk.Dec, err error) { +func (amm *AMM) SwapBaseAsset(baseAssetAmt sdkmath.LegacyDec, dir Direction) (quoteAssetDelta sdkmath.LegacyDec, err error) { quoteReserveDelta, err := amm.GetQuoteReserveAmt(baseAssetAmt, dir) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } if dir == Direction_LONG { @@ -316,14 +314,14 @@ func (amm *AMM) SwapBaseAsset(baseAssetAmt sdk.Dec, dir Direction) (quoteAssetDe // Bias returns the bias, or open interest skew, of the market in the base // units. Bias is the net amount of long perpetual contracts minus the net // amount of shorts. -func (amm *AMM) Bias() (bias sdk.Dec) { +func (amm *AMM) Bias() (bias sdkmath.LegacyDec) { return amm.TotalLong.Sub(amm.TotalShort) } /* CalcRepegCost provides the cost of re-pegging the pool to a new candidate peg multiplier. */ -func (amm AMM) CalcRepegCost(newPriceMultiplier sdk.Dec) (cost sdkmath.Int, err error) { +func (amm AMM) CalcRepegCost(newPriceMultiplier sdkmath.LegacyDec) (cost sdkmath.Int, err error) { if !newPriceMultiplier.IsPositive() { return sdkmath.Int{}, ErrAmmNonPositivePegMult } @@ -331,7 +329,7 @@ func (amm AMM) CalcRepegCost(newPriceMultiplier sdk.Dec) (cost sdkmath.Int, err bias := amm.Bias() if bias.IsZero() { - return sdk.ZeroInt(), nil + return sdkmath.ZeroInt(), nil } var dir Direction @@ -358,11 +356,11 @@ func (amm AMM) CalcRepegCost(newPriceMultiplier sdk.Dec) (cost sdkmath.Int, err // GetMarketValue returns the amount of quote assets the amm has to pay out if all longs and shorts close out their positions // positive value means the amm has to pay out quote assets // negative value means the amm has to receive quote assets -func (amm AMM) GetMarketValue() (sdk.Dec, error) { +func (amm AMM) GetMarketValue() (sdkmath.LegacyDec, error) { bias := amm.Bias() if bias.IsZero() { - return sdk.ZeroDec(), nil + return sdkmath.LegacyZeroDec(), nil } var dir Direction @@ -374,7 +372,7 @@ func (amm AMM) GetMarketValue() (sdk.Dec, error) { marketValueInReserves, err := amm.GetQuoteReserveAmt(bias.Abs(), dir) if err != nil { - return sdk.Dec{}, err + return sdkmath.LegacyDec{}, err } if bias.IsNegative() { @@ -387,7 +385,7 @@ func (amm AMM) GetMarketValue() (sdk.Dec, error) { /* CalcUpdateSwapInvariantCost returns the cost of updating the invariant of the pool */ -func (amm AMM) CalcUpdateSwapInvariantCost(newSwapInvariant sdk.Dec) (sdkmath.Int, error) { +func (amm AMM) CalcUpdateSwapInvariantCost(newSwapInvariant sdkmath.LegacyDec) (sdkmath.Int, error) { if newSwapInvariant.IsNil() { return sdkmath.Int{}, ErrNilSwapInvariant } @@ -417,7 +415,7 @@ func (amm AMM) CalcUpdateSwapInvariantCost(newSwapInvariant sdk.Dec) (sdkmath.In } // UpdateSwapInvariant updates the swap invariant of the amm -func (amm *AMM) UpdateSwapInvariant(newSwapInvariant sdk.Dec) (err error) { +func (amm *AMM) UpdateSwapInvariant(newSwapInvariant sdkmath.LegacyDec) (err error) { // k = x * y // newK = (cx) * (cy) = c^2 xy = c^2 k // newPrice = (c y) / (c x) = y / x = price | unchanged price diff --git a/x/perp/v2/types/event.pb.go b/x/perp/v2/types/event.pb.go index 4db1fe795..575185cdb 100644 --- a/x/perp/v2/types/event.pb.go +++ b/x/perp/v2/types/event.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -67,11 +68,11 @@ type PositionChangedEvent struct { FinalPosition Position `protobuf:"bytes,1,opt,name=final_position,json=finalPosition,proto3" json:"final_position"` // Position notional (in quote units) after the change. In general, // 'notional = baseAmount * priceQuotePerBase', where size is the baseAmount. - PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=position_notional,json=positionNotional,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"position_notional"` + PositionNotional cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=position_notional,json=positionNotional,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"position_notional"` // Transaction fee paid. A "taker" fee. TransactionFee types.Coin `protobuf:"bytes,3,opt,name=transaction_fee,json=transactionFee,proto3" json:"transaction_fee" yaml:"transaction_fee"` // realize profits and losses after the change - RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"realized_pnl"` + RealizedPnl cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"realized_pnl"` // Amount of bad debt cleared by the PerpEF during the change. // Bad debt is negative net margin past the liquidation point of a position. BadDebt types.Coin `protobuf:"bytes,5,opt,name=bad_debt,json=badDebt,proto3" json:"bad_debt"` @@ -80,13 +81,13 @@ type PositionChangedEvent struct { //is the receiver of the payment. Its magnitude is abs(size * fundingRate). //Funding payments act to converge the mark price and index price //(average price on major exchanges). - FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=funding_payment,json=fundingPayment,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"funding_payment"` + FundingPayment cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=funding_payment,json=fundingPayment,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funding_payment"` // The block number at which this position was changed. BlockHeight int64 `protobuf:"varint,7,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // margin_to_user is the amount of collateral received by the trader during // the position change. A positve value indicates that the trader received // funds, while a negative value indicates that the trader spent funds. - MarginToUser github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,8,opt,name=margin_to_user,json=marginToUser,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"margin_to_user"` + MarginToUser cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=margin_to_user,json=marginToUser,proto3,customtype=cosmossdk.io/math.Int" json:"margin_to_user"` // change_reason describes the reason for why the position resulted in a // change. Change type can take the following values: // @@ -100,12 +101,12 @@ type PositionChangedEvent struct { // after the change. A positive value indicates that the position size // increased, while a negative value indicates that the position size // decreased. - ExchangedSize github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=exchanged_size,json=exchangedSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_size"` + ExchangedSize cosmossdk_io_math.LegacyDec `protobuf:"bytes,10,opt,name=exchanged_size,json=exchangedSize,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_size"` // exchanged_notional represent the change in notional for an existing // position after the change. A positive value indicates that the position // notional increased, while a negative value indicates that the position // notional decreased. - ExchangedNotional github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=exchanged_notional,json=exchangedNotional,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_notional"` + ExchangedNotional cosmossdk_io_math.LegacyDec `protobuf:"bytes,11,opt,name=exchanged_notional,json=exchangedNotional,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_notional"` } func (m *PositionChangedEvent) Reset() { *m = PositionChangedEvent{} } @@ -304,16 +305,16 @@ type FundingRateChangedEvent struct { // The pair for which the funding rate was calculated. Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` // The mark price of the pair. - MarkPriceTwap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=mark_price_twap,json=markPriceTwap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"mark_price_twap"` + MarkPriceTwap cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=mark_price_twap,json=markPriceTwap,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"mark_price_twap"` // The oracle index price of the pair. - IndexPriceTwap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=index_price_twap,json=indexPriceTwap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"index_price_twap"` + IndexPriceTwap cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=index_price_twap,json=indexPriceTwap,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"index_price_twap"` // The latest premium fraction just calculated. - PremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=premium_fraction,json=premiumFraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"premium_fraction"` + PremiumFraction cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=premium_fraction,json=premiumFraction,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"premium_fraction"` // The market's latest cumulative premium fraction. // The funding payment a position will pay is the difference between this // value and the latest cumulative premium fraction on the position, // multiplied by the position size. - CumulativePremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=cumulative_premium_fraction,json=cumulativePremiumFraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"cumulative_premium_fraction"` + CumulativePremiumFraction cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=cumulative_premium_fraction,json=cumulativePremiumFraction,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"cumulative_premium_fraction"` } func (m *FundingRateChangedEvent) Reset() { *m = FundingRateChangedEvent{} } @@ -425,9 +426,9 @@ type AmmUpdatedEvent struct { // the final state of the AMM FinalAmm AMM `protobuf:"bytes,1,opt,name=final_amm,json=finalAmm,proto3" json:"final_amm"` // The mark price of the pair. - MarkPriceTwap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=mark_price_twap,json=markPriceTwap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"mark_price_twap"` + MarkPriceTwap cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=mark_price_twap,json=markPriceTwap,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"mark_price_twap"` // The oracle index price of the pair. - IndexPriceTwap github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=index_price_twap,json=indexPriceTwap,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"index_price_twap"` + IndexPriceTwap cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=index_price_twap,json=indexPriceTwap,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"index_price_twap"` } func (m *AmmUpdatedEvent) Reset() { *m = AmmUpdatedEvent{} } @@ -525,9 +526,9 @@ func (m *MarketUpdatedEvent) GetFinalMarket() Market { // EventShiftPegMultiplier: ABCI event emitted from MsgShiftPegMultiplier type EventShiftPegMultiplier struct { - OldPegMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=old_peg_multiplier,json=oldPegMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"old_peg_multiplier"` - NewPegMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=new_peg_multiplier,json=newPegMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"new_peg_multiplier"` - CostPaid types.Coin `protobuf:"bytes,3,opt,name=cost_paid,json=costPaid,proto3" json:"cost_paid"` + OldPegMultiplier cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=old_peg_multiplier,json=oldPegMultiplier,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"old_peg_multiplier"` + NewPegMultiplier cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=new_peg_multiplier,json=newPegMultiplier,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"new_peg_multiplier"` + CostPaid types.Coin `protobuf:"bytes,3,opt,name=cost_paid,json=costPaid,proto3" json:"cost_paid"` } func (m *EventShiftPegMultiplier) Reset() { *m = EventShiftPegMultiplier{} } @@ -572,9 +573,9 @@ func (m *EventShiftPegMultiplier) GetCostPaid() types.Coin { // EventShiftSwapInvariant: ABCI event emitted from MsgShiftSwapInvariant type EventShiftSwapInvariant struct { - OldSwapInvariant github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=old_swap_invariant,json=oldSwapInvariant,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"old_swap_invariant"` - NewSwapInvariant github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=new_swap_invariant,json=newSwapInvariant,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"new_swap_invariant"` - CostPaid types.Coin `protobuf:"bytes,3,opt,name=cost_paid,json=costPaid,proto3" json:"cost_paid"` + OldSwapInvariant cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=old_swap_invariant,json=oldSwapInvariant,proto3,customtype=cosmossdk.io/math.Int" json:"old_swap_invariant"` + NewSwapInvariant cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=new_swap_invariant,json=newSwapInvariant,proto3,customtype=cosmossdk.io/math.Int" json:"new_swap_invariant"` + CostPaid types.Coin `protobuf:"bytes,3,opt,name=cost_paid,json=costPaid,proto3" json:"cost_paid"` } func (m *EventShiftSwapInvariant) Reset() { *m = EventShiftSwapInvariant{} } @@ -633,84 +634,86 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/event.proto", fileDescriptor_a5313bbc89fa31dd) } var fileDescriptor_a5313bbc89fa31dd = []byte{ - // 1230 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xe3, 0xb8, 0xa4, 0xcd, 0xc4, 0xb1, 0x9d, 0xc1, 0x24, 0xdb, 0x52, 0x39, 0x61, 0x55, - 0x50, 0x2e, 0xdd, 0x55, 0x83, 0x84, 0xd4, 0x0a, 0x81, 0x92, 0xd4, 0x21, 0x96, 0x1a, 0xd7, 0xac, - 0x9d, 0xd2, 0xf2, 0x43, 0xcb, 0x78, 0xf7, 0xd9, 0x19, 0x65, 0x77, 0x66, 0xd9, 0x19, 0xc7, 0x4d, - 0xff, 0x01, 0x38, 0x22, 0x71, 0xe0, 0x7f, 0xe0, 0x2f, 0xe9, 0xb1, 0x47, 0xc4, 0xa1, 0xa0, 0x56, - 0x1c, 0xb8, 0x21, 0xae, 0x5c, 0xd0, 0xce, 0xce, 0xc6, 0x3f, 0xd2, 0x36, 0xc4, 0xc0, 0x81, 0x53, - 0xb2, 0xef, 0xcd, 0x7c, 0xde, 0x9b, 0xef, 0xbe, 0xf7, 0x66, 0x8d, 0xae, 0x30, 0xda, 0xa1, 0x71, - 0xdf, 0x8e, 0x20, 0x8e, 0xec, 0xa3, 0x0d, 0x1b, 0x8e, 0x80, 0x49, 0x2b, 0x8a, 0xb9, 0xe4, 0xb8, - 0x98, 0xfa, 0xac, 0xc4, 0x67, 0x1d, 0x6d, 0x5c, 0xa9, 0xf4, 0x78, 0x8f, 0x2b, 0x97, 0x9d, 0xfc, - 0x97, 0xae, 0xba, 0x72, 0xb5, 0xc7, 0x79, 0x2f, 0x00, 0x9b, 0x44, 0xd4, 0x26, 0x8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, 0xb5, 0x0e, 0x68, 0x57, 0x36, 0xa1, - 0xb7, 0xd7, 0x0f, 0x24, 0x8d, 0x02, 0x0a, 0x31, 0xfe, 0x1c, 0x61, 0x1e, 0xf8, 0x6e, 0x04, 0x3d, - 0x37, 0x3c, 0xb1, 0xea, 0x7a, 0x3e, 0xf7, 0xc7, 0x27, 0x0f, 0xfc, 0x53, 0x74, 0x06, 0x83, 0x49, - 0xfa, 0x94, 0x9f, 0xb6, 0x0c, 0x06, 0xe3, 0xf4, 0xf7, 0xd1, 0xbc, 0xc7, 0x85, 0x74, 0x23, 0x42, - 0xfd, 0xb3, 0xef, 0x5b, 0x5d, 0x1e, 0xc9, 0x8e, 0x26, 0xa1, 0xfe, 0x84, 0x2a, 0xad, 0x01, 0x89, - 0xea, 0xec, 0x88, 0xc4, 0x94, 0x30, 0x99, 0xa9, 0x22, 0x06, 0x24, 0x72, 0x69, 0x66, 0x9d, 0x42, - 0x95, 0xe4, 0x4b, 0x2e, 0x51, 0xe5, 0x14, 0x3d, 0x51, 0x65, 0x82, 0x3e, 0x3b, 0x1d, 0x9d, 0xc1, - 0x60, 0x9c, 0xfe, 0x8f, 0x54, 0xd9, 0xfa, 0xe8, 0xf1, 0xb3, 0x6a, 0xee, 0xc9, 0xb3, 0x6a, 0xee, - 0x97, 0x67, 0xd5, 0xdc, 0xb7, 0xcf, 0xab, 0x33, 0x4f, 0x9e, 0x57, 0x67, 0x7e, 0x7c, 0x5e, 0x9d, - 0xf9, 0xf4, 0xfa, 0x59, 0x53, 0x2d, 0xfb, 0x6d, 0xa5, 0x92, 0xeb, 0xcc, 0xa9, 0xdf, 0x4e, 0xef, - 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x50, 0x37, 0x90, 0x96, 0xfa, 0x0d, 0x00, 0x00, + // 1249 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4f, 0x6f, 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 0xe3, 0x81, 0x77, 0x86, 0x92, 0xc1, 0x70, 0x92, 0xf2, + 0x22, 0x6f, 0x91, 0x0c, 0x86, 0xe3, 0x94, 0xef, 0xa1, 0x79, 0x97, 0x0b, 0xe9, 0x44, 0x84, 0x7a, + 0xe7, 0x3f, 0x17, 0xf5, 0x2d, 0x4f, 0x10, 0x2d, 0x42, 0x3d, 0xf3, 0xf7, 0x31, 0xfd, 0xed, 0x21, + 0x89, 0x1a, 0xec, 0x88, 0xc4, 0x94, 0x30, 0x89, 0x1f, 0xa4, 0xfa, 0xc5, 0x90, 0x44, 0x0e, 0xcd, + 0xa2, 0x5a, 0xff, 0x39, 0xaf, 0x52, 0x89, 0xf2, 0x33, 0x64, 0x89, 0xf2, 0x09, 0xb2, 0xd9, 0xa9, + 0xc8, 0x18, 0x0c, 0xc7, 0xc9, 0xfe, 0x96, 0xe6, 0xad, 0x0f, 0x9f, 0x3c, 0xaf, 0xe6, 0x9e, 0x3e, + 0xaf, 0xe6, 0x7e, 0x79, 0x5e, 0xcd, 0x7d, 0xf3, 0xa2, 0x3a, 0xf3, 0xf4, 0x45, 0x75, 0xe6, 0xc7, + 0x17, 0xd5, 0x99, 0xcf, 0x6f, 0x9f, 0xe7, 0x43, 0xd9, 0x97, 0x89, 0x7a, 0x6e, 0x75, 0xe7, 0xd4, + 0x97, 0xc7, 0x3b, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xe6, 0xfc, 0xc5, 0x38, 0x0d, 0x00, + 0x00, } func (m *PositionChangedEvent) Marshal() (dAtA []byte, err error) { diff --git a/x/perp/v2/types/expected_keepers.go b/x/perp/v2/types/expected_keepers.go index 38df68b35..8a2294cda 100644 --- a/x/perp/v2/types/expected_keepers.go +++ b/x/perp/v2/types/expected_keepers.go @@ -1,12 +1,12 @@ package types import ( + "context" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/epochs/types" - - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) // ---------------------------------------------------------- @@ -15,33 +15,33 @@ import ( // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error SendCoinsFromAccountToModule( - ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, + ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, ) error SendCoinsFromModuleToModule( - ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error + ctx context.Context, senderModule string, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount( - ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, + ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, ) error - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins } type OracleKeeper interface { - GetExchangeRate(ctx sdk.Context, pair asset.Pair) (sdk.Dec, error) - GetExchangeRateTwap(ctx sdk.Context, pair asset.Pair) (sdk.Dec, error) - SetPrice(ctx sdk.Context, pair asset.Pair, price sdk.Dec) + GetExchangeRate(ctx sdk.Context, pair asset.Pair) (math.LegacyDec, error) + GetExchangeRateTwap(ctx sdk.Context, pair asset.Pair) (math.LegacyDec, error) + SetPrice(ctx sdk.Context, pair asset.Pair, price math.LegacyDec) } type EpochKeeper interface { diff --git a/x/perp/v2/types/genesis.go b/x/perp/v2/types/genesis.go index 28a8f6e43..c9a745967 100644 --- a/x/perp/v2/types/genesis.go +++ b/x/perp/v2/types/genesis.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" "encoding/json" "time" @@ -54,17 +55,17 @@ func DefaultMarket(pair asset.Pair) Market { Pair: pair, Enabled: false, Version: 1, - LatestCumulativePremiumFraction: sdk.ZeroDec(), - ExchangeFeeRatio: sdk.MustNewDecFromStr("0.0010"), - EcosystemFundFeeRatio: sdk.MustNewDecFromStr("0.0010"), - LiquidationFeeRatio: sdk.MustNewDecFromStr("0.0500"), - PartialLiquidationRatio: sdk.MustNewDecFromStr("0.5000"), + LatestCumulativePremiumFraction: sdkmath.LegacyZeroDec(), + ExchangeFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0010"), + EcosystemFundFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0010"), + LiquidationFeeRatio: sdkmath.LegacyMustNewDecFromStr("0.0500"), + PartialLiquidationRatio: sdkmath.LegacyMustNewDecFromStr("0.5000"), FundingRateEpochId: epochstypes.ThirtyMinuteEpochID, - MaxFundingRate: sdk.NewDec(1), + MaxFundingRate: sdkmath.LegacyNewDec(1), TwapLookbackWindow: time.Minute * 30, - PrepaidBadDebt: sdk.NewCoin(TestingCollateralDenomNUSD, sdk.ZeroInt()), - MaintenanceMarginRatio: sdk.MustNewDecFromStr("0.0625"), - MaxLeverage: sdk.NewDec(10), + PrepaidBadDebt: sdk.NewCoin(TestingCollateralDenomNUSD, sdkmath.ZeroInt()), + MaintenanceMarginRatio: sdkmath.LegacyMustNewDecFromStr("0.0625"), + MaxLeverage: sdkmath.LegacyNewDec(10), OraclePair: asset.NewPair(pair.BaseDenom(), denoms.USD), } } diff --git a/x/perp/v2/types/genesis.pb.go b/x/perp/v2/types/genesis.pb.go index d56739798..ff5e65237 100644 --- a/x/perp/v2/types/genesis.pb.go +++ b/x/perp/v2/types/genesis.pb.go @@ -4,10 +4,10 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -172,9 +172,9 @@ func (m *GenesisState) GetDnrEpochName() string { } type GenesisState_TraderVolume struct { - Trader string `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty"` - Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` - Volume github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=volume,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"volume"` + Trader string `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty"` + Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` + Volume cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=volume,proto3,customtype=cosmossdk.io/math.Int" json:"volume"` } func (m *GenesisState_TraderVolume) Reset() { *m = GenesisState_TraderVolume{} } @@ -225,8 +225,8 @@ func (m *GenesisState_TraderVolume) GetEpoch() uint64 { } type GenesisState_Discount struct { - Fee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fee"` - Volume github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=volume,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"volume"` + Fee cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=fee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"fee"` + Volume cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=volume,proto3,customtype=cosmossdk.io/math.Int" json:"volume"` } func (m *GenesisState_Discount) Reset() { *m = GenesisState_Discount{} } @@ -315,8 +315,8 @@ func (m *GenesisState_CustomDiscount) GetDiscount() *GenesisState_Discount { } type GenesisState_GlobalVolume struct { - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - Volume github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=volume,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"volume"` + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + Volume cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=volume,proto3,customtype=cosmossdk.io/math.Int" json:"volume"` } func (m *GenesisState_GlobalVolume) Reset() { *m = GenesisState_GlobalVolume{} } @@ -472,57 +472,57 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/genesis.proto", fileDescriptor_c2c7acfef3993fde) } var fileDescriptor_c2c7acfef3993fde = []byte{ - // 788 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdf, 0x6a, 0x13, 0x4f, - 0x14, 0xce, 0x36, 0x69, 0x9a, 0x4c, 0xd2, 0xa4, 0xbf, 0x69, 0x29, 0x43, 0x7e, 0x35, 0x2d, 0x45, - 0x25, 0x45, 0xba, 0x4b, 0x23, 0x08, 0x7a, 0x65, 0xd3, 0x68, 0x11, 0x4c, 0x29, 0xdb, 0xd2, 0x0b, - 0x11, 0xd6, 0xc9, 0x66, 0xdc, 0x2c, 0xdd, 0xdd, 0x59, 0x76, 0x26, 0x41, 0xaf, 0xf5, 0x01, 0x14, - 0x7c, 0x16, 0x9f, 0xa1, 0x97, 0xbd, 0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x87, 0xaa, - 0x4e, 0xe1, 0xc7, 0x38, 0x68, 0x82, 0xff, 0x22, 0xc2, 0x48, 0x34, 0x24, 0x16, 0x0b, 0x70, 0xc8, - 0xfa, 0x94, 0x33, 0x34, 0x7f, 0x3d, 0x99, 0x29, 0x0b, 0x8f, 0x54, 0x9d, 0x22, 0x5b, 0x8a, 0xa6, - 0xc3, 0x0c, 0xfe, 0x0f, 0x8a, 0xbd, 0x20, 0xb2, 0x48, 0x48, 0xed, 0x3e, 0xca, 0x6f, 0x68, 0x8d, - 0x9c, 0x59, 0xe8, 0x05, 0xd1, 0x8b, 0x78, 0x0d, 0xb7, 0xc0, 0x92, 0x4d, 0x3d, 0x0f, 0x73, 0x12, - 0x61, 0xcf, 0xea, 0x91, 0x80, 0xfa, 0xa8, 0xb4, 0xa1, 0x35, 0x8a, 0x66, 0x75, 0x1c, 0x6f, 0xc7, - 0x61, 0x78, 0x02, 0x2a, 0x3c, 0xc2, 0x3d, 0x12, 0x59, 0x43, 0xea, 0x0d, 0x7c, 0xc2, 0xd0, 0x82, - 0x10, 0xb6, 0x35, 0x63, 0x97, 0x62, 0xfa, 0xfa, 0xb1, 0x80, 0x9c, 0x08, 0x84, 0x92, 0xb8, 0xc8, - 0x27, 0x62, 0x0c, 0x1e, 0x83, 0xaa, 0xe3, 0xd1, 0x6e, 0xdc, 0xde, 0x65, 0x36, 0x1d, 0x04, 0x1c, - 0x15, 0x04, 0xf1, 0x83, 0x1b, 0x89, 0xdb, 0xaa, 0x58, 0x91, 0x56, 0x24, 0x47, 0x12, 0x85, 0x6f, - 0xc1, 0x92, 0x3d, 0x60, 0x9c, 0xfa, 0x23, 0x56, 0x86, 0x8a, 0x82, 0xf6, 0xd1, 0x8d, 0xb4, 0x7b, - 0x02, 0x94, 0x22, 0xaf, 0xda, 0x53, 0x51, 0x06, 0xdf, 0x81, 0x15, 0x69, 0x13, 0xcb, 0xc3, 0x8c, - 0x5b, 0x43, 0x12, 0x31, 0xf1, 0xdd, 0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, 0x95, 0x69, 0xf3, 0xcd, - 0x1c, 0xcf, 0x2e, 0x28, 0x8c, 0x8e, 0x4a, 0xdc, 0xf3, 0xb6, 0x47, 0xc5, 0x1c, 0xc1, 0x6a, 0x1e, - 0x28, 0x4f, 0x7a, 0x65, 0x3c, 0x71, 0xed, 0xfa, 0x89, 0xdf, 0x69, 0x6b, 0x9b, 0x9f, 0x34, 0x80, - 0x66, 0x9d, 0x01, 0xd8, 0x01, 0xb9, 0x10, 0xbb, 0x6a, 0x8f, 0xad, 0xa7, 0xaa, 0xc5, 0xce, 0x44, - 0x8b, 0x03, 0xb1, 0xb7, 0xbd, 0x3e, 0x76, 0x03, 0x43, 0xdd, 0xfc, 0x1f, 0x0c, 0x9b, 0xfa, 0x3e, - 0x0d, 0x0c, 0xcc, 0x18, 0xe1, 0xfa, 0x21, 0x76, 0x23, 0x53, 0xd0, 0x40, 0x04, 0x16, 0xd4, 0x71, - 0x54, 0xee, 0x49, 0x96, 0x9b, 0xdf, 0x35, 0x50, 0x4d, 0xdd, 0xc0, 0xff, 0xac, 0x39, 0x7c, 0x06, - 0x0a, 0xc9, 0x35, 0x2f, 0xec, 0x5b, 0x6a, 0xa2, 0xf4, 0x37, 0x4b, 0x3d, 0x0b, 0xa3, 0xfa, 0xd6, - 0xfe, 0xd9, 0x65, 0x5d, 0x3b, 0xbf, 0xac, 0x6b, 0xbf, 0x2e, 0xeb, 0xda, 0x97, 0xab, 0x7a, 0xe6, - 0xfc, 0xaa, 0x9e, 0xf9, 0x71, 0x55, 0xcf, 0xbc, 0xd9, 0xfe, 0x93, 0xd0, 0xe4, 0x85, 0x14, 0xdf, - 0xa4, 0x9b, 0x17, 0x4f, 0xe4, 0xe3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x5d, 0xaf, 0x6c, - 0xc2, 0x07, 0x00, 0x00, + // 791 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x4e, 0xdb, 0x4a, + 0x14, 0x8e, 0x49, 0x08, 0xc9, 0x10, 0x12, 0xee, 0xc0, 0x45, 0xa3, 0x00, 0x01, 0x71, 0xef, 0x95, + 0x82, 0xae, 0xb0, 0x45, 0xae, 0xb8, 0x52, 0xbb, 0x23, 0xa4, 0x42, 0x95, 0x08, 0x42, 0x06, 0xb1, + 0x68, 0x2b, 0xb9, 0x13, 0x67, 0xea, 0x58, 0xd8, 0x1e, 0xcb, 0x33, 0x89, 0x60, 0xdd, 0x17, 0xe8, + 0xd3, 0xf4, 0x19, 0x58, 0xd2, 0x5d, 0xd5, 0x05, 0xaa, 0xe0, 0x45, 0x2a, 0xcf, 0x8c, 0xf3, 0xe3, + 0x12, 0x0a, 0x9b, 0xee, 0x3c, 0xe7, 0x7c, 0xdf, 0x77, 0xce, 0x9c, 0xf9, 0x3c, 0x03, 0xd6, 0x02, + 0xb7, 0xe3, 0x46, 0x7d, 0x23, 0x24, 0x51, 0x68, 0x0c, 0x1a, 0x86, 0x43, 0x02, 0xc2, 0x5c, 0xa6, + 0x87, 0x11, 0xe5, 0x14, 0x96, 0x65, 0x56, 0x8f, 0xb3, 0xfa, 0xa0, 0x51, 0xad, 0xd9, 0x94, 0xf9, + 0x94, 0x19, 0x1d, 0xcc, 0x88, 0x31, 0xd8, 0xed, 0x10, 0x8e, 0x77, 0x0d, 0x9b, 0xba, 0x81, 0xc4, + 0x57, 0xd7, 0x1c, 0x4a, 0x1d, 0x8f, 0x18, 0x38, 0x74, 0x0d, 0x1c, 0x04, 0x94, 0x63, 0xee, 0xd2, + 0x40, 0xa9, 0x55, 0x97, 0x1d, 0xea, 0x50, 0xf1, 0x69, 0xc4, 0x5f, 0x2a, 0x5a, 0x4d, 0x75, 0xc0, + 0x38, 0xe6, 0x44, 0xe6, 0xb6, 0xbe, 0x00, 0x50, 0x3a, 0x94, 0x1d, 0x9d, 0xc6, 0x61, 0xf8, 0x3f, + 0x98, 0xf3, 0x71, 0x74, 0x41, 0x38, 0x43, 0x33, 0x9b, 0xd9, 0xfa, 0x7c, 0x63, 0x45, 0x9f, 0x6c, + 0x51, 0x6f, 0x8b, 0x74, 0x33, 0x77, 0x7d, 0xbb, 0x91, 0x31, 0x13, 0x30, 0xdc, 0x01, 0x39, 0xec, + 0xfb, 0x0c, 0x65, 0x05, 0x69, 0x29, 0x4d, 0xda, 0x6f, 0xb7, 0x15, 0x43, 0xc0, 0xe0, 0x01, 0x28, + 0x86, 0x94, 0xb9, 0xa2, 0x79, 0x94, 0x13, 0x9c, 0x8d, 0x34, 0x47, 0xf5, 0x75, 0xa2, 0x70, 0x8a, + 0x3f, 0xe2, 0x41, 0x13, 0xfc, 0x11, 0x11, 0x46, 0xa2, 0x01, 0xb1, 0x58, 0x80, 0x43, 0xd6, 0xa3, + 0x9c, 0xa1, 0xd9, 0x87, 0xc5, 0x4c, 0x09, 0x3c, 0x55, 0x38, 0x25, 0xb6, 0x18, 0x4d, 0x86, 0x19, + 0x5c, 0x05, 0xc5, 0x6e, 0x10, 0x59, 0x24, 0xa4, 0x76, 0x0f, 0xe5, 0x37, 0xb5, 0x7a, 0xce, 0x2c, + 0x74, 0x83, 0xe8, 0x55, 0xbc, 0x86, 0xdb, 0x60, 0xd1, 0xa6, 0x9e, 0x87, 0x39, 0x89, 0xb0, 0x67, + 0x75, 0x49, 0x40, 0x7d, 0x34, 0xbf, 0xa9, 0xd5, 0x8b, 0x66, 0x65, 0x14, 0x6f, 0xc5, 0x61, 0x78, + 0x0e, 0xca, 0x3c, 0xc2, 0x5d, 0x12, 0x59, 0x03, 0xea, 0xf5, 0x7d, 0xc2, 0xd0, 0x9c, 0x68, 0x6c, + 0x7b, 0xca, 0x2e, 0xc5, 0xf4, 0xf5, 0x33, 0x41, 0x39, 0x17, 0x0c, 0xd5, 0xe2, 0x02, 0x1f, 0x8b, + 0x31, 0x78, 0x06, 0x2a, 0x8e, 0x47, 0x3b, 0x71, 0x79, 0x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, 0x35, 0xed, 0xe6, 0xae, 0xa6, 0x7d, 0xbf, 0xab, 0x69, 0x9f, 0xee, 0x6b, + 0x99, 0x9b, 0xfb, 0x5a, 0xe6, 0xeb, 0x7d, 0x2d, 0xf3, 0x66, 0xe7, 0x57, 0x8d, 0x26, 0x2f, 0x1c, + 0xbf, 0x0a, 0x09, 0xeb, 0xe4, 0xc5, 0x13, 0xf7, 0xdf, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, + 0xe2, 0x71, 0x34, 0x82, 0x07, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/perp/v2/types/market.go b/x/perp/v2/types/market.go index 1b36cdfb2..1d006f33e 100644 --- a/x/perp/v2/types/market.go +++ b/x/perp/v2/types/market.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" fmt "fmt" "time" @@ -9,8 +10,8 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" ) -func isPercent(v sdk.Dec) bool { - return v.GTE(sdk.ZeroDec()) && v.LTE(sdk.OneDec()) +func isPercent(v sdkmath.LegacyDec) bool { + return v.GTE(sdkmath.LegacyZeroDec()) && v.LTE(sdkmath.LegacyOneDec()) } func (market Market) Validate() error { @@ -34,15 +35,15 @@ func (market Market) Validate() error { return fmt.Errorf("partial liquidation ratio must be 0 <= ratio <= 1") } - if market.MaxLeverage.LTE(sdk.ZeroDec()) { + if market.MaxLeverage.LTE(sdkmath.LegacyZeroDec()) { return fmt.Errorf("max leverage must be > 0") } - if market.MaxFundingRate.LT(sdk.ZeroDec()) { + if market.MaxFundingRate.LT(sdkmath.LegacyZeroDec()) { return fmt.Errorf("max funding rate must be >= 0") } - if sdk.OneDec().Quo(market.MaxLeverage).LT(market.MaintenanceMarginRatio) { + if sdkmath.LegacyOneDec().Quo(market.MaxLeverage).LT(market.MaintenanceMarginRatio) { return fmt.Errorf("margin ratio opened with max leverage position will be lower than Maintenance margin ratio") } @@ -53,32 +54,32 @@ func (market Market) Validate() error { return nil } -func (market Market) WithMaintenanceMarginRatio(value sdk.Dec) Market { +func (market Market) WithMaintenanceMarginRatio(value sdkmath.LegacyDec) Market { market.MaintenanceMarginRatio = value return market } -func (market Market) WithMaxLeverage(value sdk.Dec) Market { +func (market Market) WithMaxLeverage(value sdkmath.LegacyDec) Market { market.MaxLeverage = value return market } -func (market Market) WithEcosystemFee(value sdk.Dec) Market { +func (market Market) WithEcosystemFee(value sdkmath.LegacyDec) Market { market.EcosystemFundFeeRatio = value return market } -func (market Market) WithExchangeFee(value sdk.Dec) Market { +func (market Market) WithExchangeFee(value sdkmath.LegacyDec) Market { market.ExchangeFeeRatio = value return market } -func (market Market) WithLiquidationFee(value sdk.Dec) Market { +func (market Market) WithLiquidationFee(value sdkmath.LegacyDec) Market { market.LiquidationFeeRatio = value return market } -func (market Market) WithPartialLiquidationRatio(value sdk.Dec) Market { +func (market Market) WithPartialLiquidationRatio(value sdkmath.LegacyDec) Market { market.PartialLiquidationRatio = value return market } @@ -88,7 +89,7 @@ func (market Market) WithFundingRateEpochId(value string) Market { return market } -func (market Market) WithMaxFundingRate(value sdk.Dec) Market { +func (market Market) WithMaxFundingRate(value sdkmath.LegacyDec) Market { market.MaxFundingRate = value return market } @@ -103,22 +104,22 @@ func (market Market) WithOraclePair(value asset.Pair) Market { return market } -func (market Market) WithLatestCumulativePremiumFraction(value sdk.Dec) Market { +func (market Market) WithLatestCumulativePremiumFraction(value sdkmath.LegacyDec) Market { market.LatestCumulativePremiumFraction = value return market } -func (market Market) WithEcosystemFundFeeRatio(value sdk.Dec) Market { +func (market Market) WithEcosystemFundFeeRatio(value sdkmath.LegacyDec) Market { market.EcosystemFundFeeRatio = value return market } -func (market Market) WithExchangeFeeRatio(value sdk.Dec) Market { +func (market Market) WithExchangeFeeRatio(value sdkmath.LegacyDec) Market { market.ExchangeFeeRatio = value return market } -func (market Market) WithLiquidationFeeRatio(value sdk.Dec) Market { +func (market Market) WithLiquidationFeeRatio(value sdkmath.LegacyDec) Market { market.LiquidationFeeRatio = value return market } diff --git a/x/perp/v2/types/position.go b/x/perp/v2/types/position.go index 141fe3f76..5326f0e15 100644 --- a/x/perp/v2/types/position.go +++ b/x/perp/v2/types/position.go @@ -1,6 +1,7 @@ package types import ( + sdkmath "cosmossdk.io/math" fmt "fmt" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,10 +13,10 @@ func ZeroPosition(ctx sdk.Context, tokenPair asset.Pair, traderAddr sdk.AccAddre return Position{ TraderAddress: traderAddr.String(), Pair: tokenPair, - Size_: sdk.ZeroDec(), - Margin: sdk.ZeroDec(), - OpenNotional: sdk.ZeroDec(), - LatestCumulativePremiumFraction: sdk.ZeroDec(), + Size_: sdkmath.LegacyZeroDec(), + Margin: sdkmath.LegacyZeroDec(), + OpenNotional: sdkmath.LegacyZeroDec(), + LatestCumulativePremiumFraction: sdkmath.LegacyZeroDec(), LastUpdatedBlockNumber: ctx.BlockHeight(), } } @@ -58,26 +59,26 @@ func PositionsAreEqual(expected, actual *Position) error { type PositionResp struct { Position Position // The amount of quote assets exchanged. - ExchangedNotionalValue sdk.Dec + ExchangedNotionalValue sdkmath.LegacyDec // The amount of base assets exchanged. Signed, positive represents long and negative represents short from the user's perspective. - ExchangedPositionSize sdk.Dec + ExchangedPositionSize sdkmath.LegacyDec // The amount of bad debt accrued during this position change. // Measured in absolute value of quote units. // If greater than zero, then the position change event will likely fail. - BadDebt sdk.Dec + BadDebt sdkmath.LegacyDec // The funding payment applied on this position change. - FundingPayment sdk.Dec + FundingPayment sdkmath.LegacyDec // The amount of PnL realized on this position changed, measured in quote // units. - RealizedPnl sdk.Dec + RealizedPnl sdkmath.LegacyDec // The unrealized PnL in the position after the position change. - UnrealizedPnlAfter sdk.Dec + UnrealizedPnlAfter sdkmath.LegacyDec // The amount of margin the trader has to give to the vault. // A negative value means the vault pays the trader. - MarginToVault sdk.Dec + MarginToVault sdkmath.LegacyDec // The position's notional value after the position change, measured in quote // units. - PositionNotional sdk.Dec + PositionNotional sdkmath.LegacyDec } func (m *Position) Validate() error { @@ -118,22 +119,22 @@ func (position *Position) WithPair(value asset.Pair) *Position { return position } -func (position *Position) WithSize_(value sdk.Dec) *Position { +func (position *Position) WithSize_(value sdkmath.LegacyDec) *Position { position.Size_ = value return position } -func (position *Position) WithMargin(value sdk.Dec) *Position { +func (position *Position) WithMargin(value sdkmath.LegacyDec) *Position { position.Margin = value return position } -func (position *Position) WithOpenNotional(value sdk.Dec) *Position { +func (position *Position) WithOpenNotional(value sdkmath.LegacyDec) *Position { position.OpenNotional = value return position } -func (position *Position) WithLatestCumulativePremiumFraction(value sdk.Dec) *Position { +func (position *Position) WithLatestCumulativePremiumFraction(value sdkmath.LegacyDec) *Position { position.LatestCumulativePremiumFraction = value return position } diff --git a/x/perp/v2/types/query.pb.go b/x/perp/v2/types/query.pb.go index a6b75f9b4..86741e744 100644 --- a/x/perp/v2/types/query.pb.go +++ b/x/perp/v2/types/query.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -282,11 +283,11 @@ type QueryPositionResponse struct { Position Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position"` // The position's current notional value, if it were to be entirely closed (in // margin units). - PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=position_notional,json=positionNotional,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"position_notional"` + PositionNotional cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=position_notional,json=positionNotional,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"position_notional"` // The position's unrealized PnL. - UnrealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=unrealized_pnl,json=unrealizedPnl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"unrealized_pnl"` + UnrealizedPnl cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=unrealized_pnl,json=unrealizedPnl,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"unrealized_pnl"` // margin ratio of the position based on the spot price - MarginRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=margin_ratio,json=marginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin_ratio"` + MarginRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=margin_ratio,json=marginRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"margin_ratio"` } func (m *QueryPositionResponse) Reset() { *m = QueryPositionResponse{} } @@ -717,68 +718,69 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/query.proto", fileDescriptor_fc8f0be94fac333f) } var fileDescriptor_fc8f0be94fac333f = []byte{ - // 968 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x6f, 0xdc, 0x44, - 0x14, 0x8f, 0x93, 0x90, 0x26, 0x2f, 0x6d, 0x5a, 0xa6, 0x25, 0xf5, 0xba, 0xd1, 0x6e, 0x6a, 0x4a, - 0x92, 0xb6, 0xaa, 0x4d, 0xb6, 0x5c, 0x40, 0x1c, 0xe8, 0x26, 0xa2, 0xe2, 0xb0, 0x55, 0x6a, 0x84, - 0x40, 0x70, 0x58, 0xcd, 0x7a, 0x47, 0x1b, 0xab, 0xf6, 0x8c, 0xeb, 0xf1, 0x46, 0xb4, 0x12, 0x1c, - 0x7a, 0xe0, 0x8c, 0xe8, 0x47, 0xe0, 0x04, 0x9f, 0x81, 0x0f, 0xd0, 0x63, 0x25, 0x2e, 0xa8, 0x87, - 0x82, 0x12, 0x3e, 0x48, 0xe5, 0xf1, 0x1b, 0xef, 0xda, 0xde, 0x66, 0xa3, 0x9e, 0x76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6, 0xdb, 0x08, 0xf5, 0xa4, 0x72, 0xff, 0x9b, - 0x01, 0x6b, 0xe5, 0x85, 0x40, 0xa6, 0xbb, 0x99, 0xba, 0x53, 0xac, 0xdb, 0x67, 0xc2, 0x22, 0xa7, - 0x6d, 0xc5, 0xe9, 0x3a, 0x69, 0x55, 0x39, 0x45, 0x0a, 0xdf, 0xd3, 0x4b, 0x84, 0x3c, 0x85, 0xf3, - 0x93, 0x3d, 0x4f, 0x3e, 0x9c, 0xee, 0xa5, 0x34, 0x46, 0xd6, 0x8d, 0xd3, 0x41, 0xc8, 0xa1, 0xa5, - 0x38, 0x34, 0xc8, 0xd5, 0x1a, 0x07, 0xf4, 0xf5, 0x8b, 0x01, 0x17, 0x2b, 0xcd, 0x4f, 0xa6, 0x77, - 0x41, 0x6d, 0x6e, 0xac, 0xed, 0x99, 0x38, 0x64, 0x61, 0x2b, 0x16, 0x1b, 0xc4, 0xaa, 0xb2, 0x18, - 0xcf, 0x50, 0xe7, 0xfe, 0x8b, 0xe3, 0xa6, 0xf1, 0xf2, 0xb8, 0x69, 0xfc, 0x77, 0xdc, 0x34, 0x7e, - 0x3d, 0x69, 0xce, 0xbd, 0x3c, 0x69, 0xce, 0xfd, 0x73, 0xd2, 0x9c, 0xfb, 0xfe, 0xce, 0xac, 0x47, - 0x59, 0x5b, 0x53, 0x5b, 0xaf, 0xbf, 0xa4, 0xfe, 0x99, 0xdd, 0x7d, 0x13, 0x00, 0x00, 0xff, 0xff, - 0x87, 0x56, 0xd6, 0x1b, 0x63, 0x0a, 0x00, 0x00, + // 980 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x4f, 0x6f, 0xdc, 0x44, + 0x14, 0x8f, 0x93, 0x90, 0x26, 0x2f, 0x6d, 0x5a, 0xa6, 0x25, 0xdd, 0x38, 0xd1, 0x6e, 0xea, 0x96, + 0x24, 0x6d, 0x55, 0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+ 0x79, 0x7d, 0xee, 0xaf, 0xf3, 0xfa, 0xdc, 0xb7, 0x0f, 0xa6, 0x7d, 0x73, 0xf5, 0x6d, 0x6a, 0xeb, + 0xf5, 0x97, 0xd4, 0x1f, 0xaf, 0x87, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x22, 0x99, 0x28, + 0x42, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/perp/v2/types/state.pb.go b/x/perp/v2/types/state.pb.go index de39cd3ea..2c17e780a 100644 --- a/x/perp/v2/types/state.pb.go +++ b/x/perp/v2/types/state.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" _ "github.com/cosmos/cosmos-proto" @@ -103,30 +104,31 @@ type Market struct { Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` // whether or not the market is enabled Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` - // the version of the Market, only one market can exist per pair, when one is closed it cannot be reactivated, - // so a new market must be created, this is the version of the market + // the version of the Market, only one market can exist per pair, when one is + // closed it cannot be reactivated, so a new market must be created, this is + // the version of the market Version uint64 `protobuf:"varint,14,opt,name=version,proto3" json:"version,omitempty"` // the minimum margin ratio which a user must maintain on this market - MaintenanceMarginRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=maintenance_margin_ratio,json=maintenanceMarginRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"maintenance_margin_ratio"` + MaintenanceMarginRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=maintenance_margin_ratio,json=maintenanceMarginRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"maintenance_margin_ratio"` // the maximum leverage a user is able to be taken on this market - MaxLeverage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=max_leverage,json=maxLeverage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_leverage"` + MaxLeverage cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=max_leverage,json=maxLeverage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_leverage"` // Latest cumulative premium fraction for a given pair. // Calculated once per funding rate interval. // A premium fraction is the difference between mark and index, divided by the // number of payments per day. (mark - index) / # payments in a day - LatestCumulativePremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=latest_cumulative_premium_fraction,json=latestCumulativePremiumFraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"latest_cumulative_premium_fraction"` + LatestCumulativePremiumFraction cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=latest_cumulative_premium_fraction,json=latestCumulativePremiumFraction,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"latest_cumulative_premium_fraction"` // the percentage of the notional given to the exchange when trading - ExchangeFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=exchange_fee_ratio,json=exchangeFeeRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchange_fee_ratio"` + ExchangeFeeRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=exchange_fee_ratio,json=exchangeFeeRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchange_fee_ratio"` // the percentage of the notional transferred to the ecosystem fund when // trading - EcosystemFundFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=ecosystem_fund_fee_ratio,json=ecosystemFundFeeRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"ecosystem_fund_fee_ratio"` + EcosystemFundFeeRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=ecosystem_fund_fee_ratio,json=ecosystemFundFeeRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"ecosystem_fund_fee_ratio"` // the percentage of liquidated position that will be // given to out as a reward. Half of the liquidation fee is given to the // liquidator, and the other half is given to the ecosystem fund. - LiquidationFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=liquidation_fee_ratio,json=liquidationFeeRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_fee_ratio"` + LiquidationFeeRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=liquidation_fee_ratio,json=liquidationFeeRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"liquidation_fee_ratio"` // the portion of the position size we try to liquidate if the available // margin is higher than liquidation fee - PartialLiquidationRatio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=partial_liquidation_ratio,json=partialLiquidationRatio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"partial_liquidation_ratio"` + PartialLiquidationRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=partial_liquidation_ratio,json=partialLiquidationRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"partial_liquidation_ratio"` // specifies the interval on which the funding rate is updated FundingRateEpochId string `protobuf:"bytes,10,opt,name=funding_rate_epoch_id,json=fundingRateEpochId,proto3" json:"funding_rate_epoch_id,omitempty"` // amount of time to look back for TWAP calculations @@ -136,7 +138,7 @@ type Market struct { // the maximum funding rate payment per epoch, this represents the maximum // amount of funding that can be paid out per epoch as a percentage of the // position size - MaxFundingRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=max_funding_rate,json=maxFundingRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec,stdduration" json:"max_funding_rate"` + MaxFundingRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,13,opt,name=max_funding_rate,json=maxFundingRate,proto3,customtype=cosmossdk.io/math.LegacyDec,stdduration" json:"max_funding_rate"` // the pair of the oracle that is used to determine the index price // for the market OraclePair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,15,opt,name=oracle_pair,json=oraclePair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"oracle_pair"` @@ -259,23 +261,24 @@ func (m *MarketLastVersion) GetVersion() uint64 { type AMM struct { // identifies the market this AMM belongs to Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,1,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` - // the version of the AMM, only one AMM can exist per pair, when one is closed it cannot be reactivated, - // so a new AMM must be created, this is the version of the AMM + // the version of the AMM, only one AMM can exist per pair, when one is closed + // it cannot be reactivated, so a new AMM must be created, this is the version + // of the AMM Version uint64 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` // the amount of base reserves this AMM has - BaseReserve github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=base_reserve,json=baseReserve,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_reserve"` + BaseReserve cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=base_reserve,json=baseReserve,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_reserve"` // the amount of quote reserves this AMM has - QuoteReserve github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=quote_reserve,json=quoteReserve,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quote_reserve"` + QuoteReserve cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=quote_reserve,json=quoteReserve,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"quote_reserve"` // sqrt(k) - SqrtDepth github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=sqrt_depth,json=sqrtDepth,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"sqrt_depth"` + SqrtDepth cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=sqrt_depth,json=sqrtDepth,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"sqrt_depth"` // the price multiplier of the dynamic AMM - PriceMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=price_multiplier,json=priceMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price_multiplier"` + PriceMultiplier cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=price_multiplier,json=priceMultiplier,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price_multiplier"` // Total long refers to the sum of long open notional in base. - TotalLong github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=total_long,json=totalLong,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total_long"` + TotalLong cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=total_long,json=totalLong,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_long"` // Total short refers to the sum of short open notional in base. - TotalShort github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=total_short,json=totalShort,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total_short"` + TotalShort cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=total_short,json=totalShort,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"total_short"` // The settlement price if the AMM is settled. - SettlementPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=settlement_price,json=settlementPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec,stdduration" json:"settlement_price"` + SettlementPrice cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=settlement_price,json=settlementPrice,proto3,customtype=cosmossdk.io/math.LegacyDec,stdduration" json:"settlement_price"` } func (m *AMM) Reset() { *m = AMM{} } @@ -324,14 +327,14 @@ type Position struct { // pair identifies the pair associated with this position Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,2,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` // the position size - Size_ github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=size,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"size"` + Size_ cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=size,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"size"` // amount of margin remaining in the position - Margin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=margin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin"` + Margin cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=margin,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"margin"` // value of position in quote assets when opened - OpenNotional github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=open_notional,json=openNotional,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"open_notional"` + OpenNotional cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=open_notional,json=openNotional,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"open_notional"` // The most recent cumulative premium fraction this position has. // Used to calculate the next funding payment. - LatestCumulativePremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=latest_cumulative_premium_fraction,json=latestCumulativePremiumFraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"latest_cumulative_premium_fraction"` + LatestCumulativePremiumFraction cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=latest_cumulative_premium_fraction,json=latestCumulativePremiumFraction,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"latest_cumulative_premium_fraction"` // last block number this position was updated LastUpdatedBlockNumber int64 `protobuf:"varint,7,opt,name=last_updated_block_number,json=lastUpdatedBlockNumber,proto3" json:"last_updated_block_number,omitempty"` } @@ -506,82 +509,83 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/state.proto", fileDescriptor_8f4829f34f7b8040) } var fileDescriptor_8f4829f34f7b8040 = []byte{ - // 1197 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0xc7, 0x4d, 0x4b, 0x76, 0xac, 0x95, 0x5f, 0xf4, 0x6c, 0xec, 0x3c, 0x74, 0xf0, 0x40, 0xf6, - 0x23, 0xa0, 0x85, 0x91, 0x22, 0x64, 0xed, 0x9e, 0x82, 0x9e, 0xf4, 0x62, 0xa7, 0x06, 0xf4, 0x16, - 0x4a, 0x6e, 0xd0, 0x20, 0xc5, 0x62, 0x49, 0xae, 0xa9, 0xad, 0x49, 0x2e, 0xb3, 0xbb, 0x94, 0x9d, - 0xf6, 0x1b, 0xf4, 0xd4, 0x63, 0xfb, 0x15, 0xfa, 0x25, 0x7a, 0xcd, 0x31, 0xc7, 0xa2, 0x87, 0xa4, - 0x48, 0x8e, 0xfd, 0x12, 0xc5, 0x2e, 0x29, 0x59, 0x06, 0x8a, 0x36, 0x65, 0x9b, 0x93, 0xb9, 0x1c, - 0xce, 0x6f, 0x86, 0xe3, 0x99, 0xff, 0x50, 0xe0, 0x6e, 0x4c, 0x5d, 0xca, 0x53, 0x3b, 0x21, 0x3c, - 0xb1, 0xa7, 0x47, 0xb6, 0x90, 0x58, 0x12, 0x2b, 0xe1, 0x4c, 0x32, 0xb8, 0x99, 0xd9, 0x2c, 0x65, - 0xb3, 0xa6, 0x47, 0x77, 0xb7, 0x03, 0x16, 0x30, 0x6d, 0xb2, 0xd5, 0x55, 0xf6, 0xd4, 0xdd, 0xba, - 0xc7, 0x44, 0xc4, 0x84, 0xed, 0x62, 0x41, 0xec, 0xe9, 0xa1, 0x4b, 0x24, 0x3e, 0xb4, 0x3d, 0x46, - 0xe3, 0xdc, 0xbe, 0x9b, 0xd9, 0x51, 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0x84, 0xaf, 0xba, 0x39, - 0x02, 0x7e, 0x03, 0x1a, 0x21, 0x96, 0x44, 0x48, 0xe4, 0xa5, 0x51, 0x1a, 0x62, 0x49, 0xa7, 0x04, - 0x25, 0x9c, 0x44, 0x34, 0x8d, 0xd0, 0x39, 0xc7, 0x9e, 0x2a, 0xbb, 0xb9, 0x52, 0x28, 0xd0, 0x5e, - 0x46, 0x6e, 0xcf, 0xc1, 0xc3, 0x8c, 0x7b, 0x92, 0x63, 0xe1, 0x53, 0x00, 0xc9, 0x95, 0x37, 0xc1, - 0x71, 0x40, 0xd0, 0x39, 0x21, 0x79, 0xcd, 0x56, 0x0b, 0x05, 0xab, 0xcd, 0x48, 0x27, 0x84, 0x64, - 0xd5, 0x0a, 0x80, 0x49, 0x3c, 0x26, 0x9e, 0x0b, 0x49, 0x22, 0x74, 0x9e, 0xc6, 0xfe, 0x42, 0x8c, - 0x5b, 0x85, 0x62, 0xec, 0xcc, 0x79, 0x27, 0x69, 0xec, 0xcf, 0x03, 0xb9, 0x60, 0x27, 0xa4, 0xcf, - 0x52, 0xea, 0xeb, 0x1e, 0x5d, 0x88, 0xb2, 0x56, 0x28, 0xca, 0xed, 0x05, 0xd8, 0x3c, 0xc6, 0x57, - 0x60, 0x37, 0xc1, 0x5c, 0x52, 0x1c, 0xa2, 0xc5, 0x58, 0x59, 0x9c, 0x4a, 0xa1, 0x38, 0xff, 0xcd, - 0x81, 0xdd, 0x6b, 0x5e, 0x16, 0xeb, 0x10, 0xec, 0xa8, 0x72, 0xd1, 0x38, 0x50, 0x7c, 0x82, 0x48, - 0xc2, 0xbc, 0x09, 0xa2, 0xbe, 0x09, 0x54, 0x1c, 0x07, 0xe6, 0x46, 0x07, 0x4b, 0x72, 0xac, 0x4c, - 0xa7, 0x3e, 0x3c, 0x03, 0xdb, 0xf2, 0x12, 0x27, 0x28, 0x64, 0xec, 0xc2, 0xc5, 0xde, 0x05, 0xba, - 0xa4, 0xb1, 0xcf, 0x2e, 0xcd,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, 0xf8, 0x12, 0x27, 0x6d, 0x1c, 0x7a, - 0x83, 0x44, 0x13, 0xf6, 0xc1, 0xff, 0xc6, 0x8f, 0x9b, 0x43, 0xd4, 0x6e, 0x76, 0xdb, 0x68, 0x30, - 0xfc, 0x63, 0xd0, 0x68, 0x38, 0x18, 0xd7, 0x0c, 0xb8, 0x0d, 0x6a, 0x8f, 0xce, 0x06, 0xe3, 0x63, - 0xd4, 0x1c, 0x8d, 0x8e, 0xc7, 0x68, 0xf4, 0xb8, 0x39, 0xac, 0x2d, 0xc3, 0xdb, 0x60, 0xab, 0xd5, - 0x1c, 0xdd, 0xb8, 0x59, 0x6a, 0x3d, 0x7c, 0xf1, 0xa6, 0x6e, 0xbc, 0x7c, 0x53, 0x37, 0x7e, 0x7d, - 0x53, 0x37, 0xbe, 0x7b, 0x5b, 0x5f, 0x7a, 0xf9, 0xb6, 0xbe, 0xf4, 0xf3, 0xdb, 0xfa, 0xd2, 0x93, - 0xfb, 0x7f, 0x35, 0x81, 0xb3, 0x1f, 0x18, 0xfa, 0xe5, 0xdd, 0x55, 0xfd, 0x85, 0xf0, 0xc9, 0xef, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x43, 0xfe, 0x66, 0xfb, 0x7f, 0x0c, 0x00, 0x00, + // 1206 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4d, 0x6f, 0xdb, 0x36, + 0x18, 0xc7, 0xe3, 0x38, 0x4d, 0x63, 0x3a, 0x2f, 0x1e, 0x9b, 0x74, 0x4a, 0x37, 0x38, 0x99, 0x87, + 0x61, 0x41, 0x87, 0x4a, 0x4b, 0x76, 0x18, 0x8a, 0x9e, 0xfc, 0x12, 0xb7, 0x01, 0xfc, 0x56, 0xd9, + 0x59, 0x80, 0x62, 0x03, 0x41, 0x4b, 0x4f, 0x64, 0x22, 0x92, 0xa8, 0x8a, 0x94, 0x93, 0xee,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xe7, 0x49, 0xe8, 0xce, 0x80, 0x6f, + 0xcf, 0x0f, 0xde, 0x99, 0x42, 0x9a, 0x49, 0xe8, 0x4e, 0xe9, 0x67, 0x68, 0xc7, 0x67, 0xcf, 0x13, + 0xe6, 0xea, 0x66, 0x9b, 0x41, 0xaf, 0xcd, 0x8f, 0xbe, 0x33, 0x43, 0x98, 0x82, 0x09, 0xda, 0x8d, + 0x68, 0x2c, 0x19, 0xf5, 0xc9, 0xec, 0x02, 0x29, 0xbc, 0x30, 0x3f, 0xfc, 0xc3, 0x8c, 0xd2, 0xba, + 0x86, 0xa4, 0x0b, 0x1c, 0xa2, 0x1d, 0x55, 0x0d, 0x16, 0x7a, 0x0a, 0x0a, 0x04, 0x22, 0xee, 0x8c, + 0x08, 0x73, 0x0d, 0xa4, 0xe0, 0x36, 0xce, 0x82, 0x36, 0x95, 0x70, 0xac, 0x42, 0x27, 0x2e, 0x3e, + 0x45, 0xdb, 0xf2, 0x92, 0x46, 0xc4, 0xe7, 0xfc, 0x62, 0x48, 0x9d, 0x0b, 0x72, 0xc9, 0x42, 0x97, + 0x5f, 0x1a, 0xc5, 0xfd, 0xdc, 0x41, 0xf1, 0x68, 0xd7, 0x4c, 0xcf, 0xa0, 0x39, 0x39, 0x83, 0x66, + 0x23, 0x3b, 0x83, 0xb5, 0x35, 0x95, 0xe9, 0xcf, 0x6f, 0xf6, 0x72, 0x36, 0x56, 0x80, 0x56, 0xa6, + 0x3f, 0xd3, 0x72, 0x7c, 0x82, 0x4a, 0x51, 0x0c, 0x11, 0x65, 0x2e, 0x19, 0x52, 0x97, 0xb8, 0x30, + 0x94, 0xc6, 0x7a, 0x86, 0xcc, 0x0e, 0xb9, 0x72, 0x04, 0x33, 0x73, 0x04, 0xb3, 0xce, 0x59, 0x58, + 0x5b, 0x51, 0x48, 0x7b, 0x33, 0x13, 0xd6, 0xa8, 0xdb, 0x80, 0xa1, 0xc4, 0x4f, 0x51, 0x49, 0x75, + 0xfe, 0xec, 0xc6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 0x5b, 0xce, 0xfd, 0xfe, 0xb6, 0x9c, 0xfb, 0xf1, 0x5d, 0x79, 0xe9, + 0xd5, 0xbb, 0xf2, 0xd2, 0xaf, 0xef, 0xca, 0x4b, 0xcf, 0x1e, 0xfc, 0xdb, 0xa9, 0x9a, 0x7c, 0x8f, + 0xeb, 0xcd, 0x0f, 0x57, 0xf5, 0xed, 0xfc, 0xd5, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xb8, + 0xdb, 0x15, 0xae, 0x0b, 0x00, 0x00, } func (m *Market) Marshal() (dAtA []byte, err error) { diff --git a/x/perp/v2/types/tx.pb.go b/x/perp/v2/types/tx.pb.go index 1a57294d4..e754ff37d 100644 --- a/x/perp/v2/types/tx.pb.go +++ b/x/perp/v2/types/tx.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_NibiruChain_nibiru_x_common_asset "github.com/NibiruChain/nibiru/x/common/asset" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" @@ -144,7 +145,7 @@ type MsgRemoveMarginResponse struct { // tokens transferred back to the trader MarginOut types.Coin `protobuf:"bytes,1,opt,name=margin_out,json=marginOut,proto3" json:"margin_out"` // the funding payment applied on this position interaction - FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=funding_payment,json=fundingPayment,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"funding_payment"` + FundingPayment cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=funding_payment,json=fundingPayment,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funding_payment"` // The resulting position Position *Position `protobuf:"bytes,3,opt,name=position,proto3" json:"position,omitempty"` } @@ -251,8 +252,8 @@ func (m *MsgAddMargin) GetMargin() types.Coin { } type MsgAddMarginResponse struct { - FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=funding_payment,json=fundingPayment,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"funding_payment"` - Position *Position `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"` + FundingPayment cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=funding_payment,json=fundingPayment,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funding_payment"` + Position *Position `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"` } func (m *MsgAddMarginResponse) Reset() { *m = MsgAddMarginResponse{} } @@ -521,9 +522,9 @@ type MsgMarketOrder struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,2,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` Side Direction `protobuf:"varint,3,opt,name=side,proto3,enum=nibiru.perp.v2.Direction" json:"side,omitempty"` - QuoteAssetAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=quote_asset_amount,json=quoteAssetAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"quote_asset_amount"` - Leverage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=leverage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"leverage"` - BaseAssetAmountLimit github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=base_asset_amount_limit,json=baseAssetAmountLimit,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"base_asset_amount_limit"` + QuoteAssetAmount cosmossdk_io_math.Int `protobuf:"bytes,4,opt,name=quote_asset_amount,json=quoteAssetAmount,proto3,customtype=cosmossdk.io/math.Int" json:"quote_asset_amount"` + Leverage cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=leverage,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"leverage"` + BaseAssetAmountLimit cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=base_asset_amount_limit,json=baseAssetAmountLimit,proto3,customtype=cosmossdk.io/math.Int" json:"base_asset_amount_limit"` } func (m *MsgMarketOrder) Reset() { *m = MsgMarketOrder{} } @@ -576,24 +577,24 @@ func (m *MsgMarketOrder) GetSide() Direction { type MsgMarketOrderResponse struct { Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"` // The amount of quote assets exchanged. - ExchangedNotionalValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exchanged_notional_value,json=exchangedNotionalValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_notional_value"` + ExchangedNotionalValue cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=exchanged_notional_value,json=exchangedNotionalValue,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_notional_value"` // The amount of base assets exchanged. - ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=exchanged_position_size,json=exchangedPositionSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_position_size"` + ExchangedPositionSize cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=exchanged_position_size,json=exchangedPositionSize,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_position_size"` // The funding payment applied on this position change, measured in quote // units. - FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=funding_payment,json=fundingPayment,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"funding_payment"` + FundingPayment cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=funding_payment,json=fundingPayment,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funding_payment"` // The amount of PnL realized on this position changed, measured in quote // units. - RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"realized_pnl"` + RealizedPnl cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"realized_pnl"` // The unrealized PnL in the position after the position change, measured in // quote units. - UnrealizedPnlAfter github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=unrealized_pnl_after,json=unrealizedPnlAfter,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"unrealized_pnl_after"` + UnrealizedPnlAfter cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=unrealized_pnl_after,json=unrealizedPnlAfter,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"unrealized_pnl_after"` // The amount of margin the trader has to give to the vault. // A negative value means the vault pays the trader. - MarginToVault github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=margin_to_vault,json=marginToVault,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin_to_vault"` + MarginToVault cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=margin_to_vault,json=marginToVault,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"margin_to_vault"` // The position's notional value after the position change, measured in quote // units. - PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=position_notional,json=positionNotional,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"position_notional"` + PositionNotional cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=position_notional,json=positionNotional,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"position_notional"` } func (m *MsgMarketOrderResponse) Reset() { *m = MsgMarketOrderResponse{} } @@ -683,18 +684,18 @@ func (m *MsgClosePosition) GetSender() string { type MsgClosePositionResponse struct { // The amount of quote assets exchanged. - ExchangedNotionalValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=exchanged_notional_value,json=exchangedNotionalValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_notional_value"` + ExchangedNotionalValue cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=exchanged_notional_value,json=exchangedNotionalValue,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_notional_value"` // The amount of base assets exchanged. - ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exchanged_position_size,json=exchangedPositionSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_position_size"` + ExchangedPositionSize cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=exchanged_position_size,json=exchangedPositionSize,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_position_size"` // The funding payment applied on this position change, measured in quote // units. - FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=funding_payment,json=fundingPayment,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"funding_payment"` + FundingPayment cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=funding_payment,json=fundingPayment,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funding_payment"` // The amount of PnL realized on this position changed, measured in quote // units. - RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"realized_pnl"` + RealizedPnl cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"realized_pnl"` // The amount of margin the trader receives after closing the position, from // the vault. Should never be negative. - MarginToTrader github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=margin_to_trader,json=marginToTrader,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin_to_trader"` + MarginToTrader cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=margin_to_trader,json=marginToTrader,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"margin_to_trader"` } func (m *MsgClosePositionResponse) Reset() { *m = MsgClosePositionResponse{} } @@ -733,7 +734,7 @@ var xxx_messageInfo_MsgClosePositionResponse proto.InternalMessageInfo type MsgPartialClose struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,2,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` - Size_ github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=size,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"size"` + Size_ cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=size,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"size"` } func (m *MsgPartialClose) Reset() { *m = MsgPartialClose{} } @@ -778,18 +779,18 @@ func (m *MsgPartialClose) GetSender() string { type MsgPartialCloseResponse struct { // The amount of quote assets exchanged. - ExchangedNotionalValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=exchanged_notional_value,json=exchangedNotionalValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_notional_value"` + ExchangedNotionalValue cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=exchanged_notional_value,json=exchangedNotionalValue,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_notional_value"` // The amount of base assets exchanged. - ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exchanged_position_size,json=exchangedPositionSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchanged_position_size"` + ExchangedPositionSize cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=exchanged_position_size,json=exchangedPositionSize,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exchanged_position_size"` // The funding payment applied on this position change, measured in quote // units. - FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=funding_payment,json=fundingPayment,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"funding_payment"` + FundingPayment cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=funding_payment,json=fundingPayment,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"funding_payment"` // The amount of PnL realized on this position changed, measured in quote // units. - RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"realized_pnl"` + RealizedPnl cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=realized_pnl,json=realizedPnl,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"realized_pnl"` // The amount of margin the trader receives after closing the position, from // the vault. Should never be negative. - MarginToTrader github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=margin_to_trader,json=marginToTrader,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin_to_trader"` + MarginToTrader cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=margin_to_trader,json=marginToTrader,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"margin_to_trader"` } func (m *MsgPartialCloseResponse) Reset() { *m = MsgPartialCloseResponse{} } @@ -1204,7 +1205,7 @@ func (m *MsgWithdrawEpochRebatesResponse) GetWithdrawnRebates() github_com_cosmo type MsgShiftPegMultiplier struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,2,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` - NewPegMult github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=new_peg_mult,json=newPegMult,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"new_peg_mult"` + NewPegMult cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=new_peg_mult,json=newPegMult,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"new_peg_mult"` } func (m *MsgShiftPegMultiplier) Reset() { *m = MsgShiftPegMultiplier{} } @@ -1288,7 +1289,7 @@ var xxx_messageInfo_MsgShiftPegMultiplierResponse proto.InternalMessageInfo type MsgShiftSwapInvariant struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,2,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` - NewSwapInvariant github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=new_swap_invariant,json=newSwapInvariant,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"new_swap_invariant"` + NewSwapInvariant cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=new_swap_invariant,json=newSwapInvariant,proto3,customtype=cosmossdk.io/math.Int" json:"new_swap_invariant"` } func (m *MsgShiftSwapInvariant) Reset() { *m = MsgShiftSwapInvariant{} } @@ -1370,8 +1371,8 @@ var xxx_messageInfo_MsgShiftSwapInvariantResponse proto.InternalMessageInfo // MsgWithdrawFromPerpFund: gRPC tx msg for changing the swap invariant. // [SUDO] Only callable sudoers. type MsgWithdrawFromPerpFund struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` // Optional denom in case withdrawing assets aside from NUSD. Denom string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"` ToAddr string `protobuf:"bytes,4,opt,name=to_addr,json=toAddr,proto3" json:"to_addr,omitempty"` @@ -1587,113 +1588,113 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/tx.proto", fileDescriptor_b95cda40bf0a0f91) } var fileDescriptor_b95cda40bf0a0f91 = []byte{ - // 1686 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4b, 0x6f, 0x1b, 0x47, - 0x12, 0xe6, 0x88, 0x14, 0x25, 0x95, 0x64, 0x3d, 0xc6, 0xb2, 0x44, 0x73, 0xbd, 0x94, 0x3c, 0xd8, - 0xf5, 0x6a, 0x0f, 0x22, 0x6d, 0xed, 0x02, 0x8b, 0x5d, 0x60, 0x77, 0xa1, 0x87, 0x15, 0x38, 0x30, - 0x6d, 0x7a, 0x64, 0xd8, 0x81, 0xe3, 0x60, 0xdc, 0xe2, 0xb4, 0x46, 0x03, 0x0f, 0xbb, 0xe9, 0x99, - 0x26, 0x29, 0x39, 0xb7, 0x1c, 0x73, 0xca, 0x21, 0x87, 0x00, 0x01, 0x72, 0x0b, 0x10, 0xe4, 0x10, - 0x20, 0x87, 0x24, 0x97, 0xfc, 0x00, 0x1f, 0x7d, 0x0c, 0x82, 0xc0, 0x09, 0xac, 0x4b, 0xae, 0x31, - 0xf2, 0x03, 0x82, 0xee, 0x79, 0x70, 0x86, 0x6e, 0x52, 0x14, 0x23, 0x13, 0x48, 0x90, 0x93, 0xd4, - 0xd3, 0xd5, 0x5f, 0xd5, 0x57, 0x55, 0xdd, 0x55, 0xdd, 0x84, 0x45, 0x62, 0xef, 0xda, 0x6e, 0xa3, - 0x54, 0xc7, 0x6e, 0xbd, 0xd4, 0x5c, 0x2b, 0xb1, 0x83, 0x62, 0xdd, 0xa5, 0x8c, 0xaa, 0xd3, 0xfe, - 0x44, 0x91, 0x4f, 0x14, 0x9b, 0x6b, 0xf9, 0x0b, 0x16, 0xa5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x11, 0x47, 0x53, 0xbc, - 0x86, 0x14, 0xba, 0x6d, 0x30, 0x7f, 0x5e, 0x7a, 0x34, 0x49, 0x4a, 0x81, 0x96, 0xda, 0x78, 0xed, - 0xc9, 0xf3, 0x82, 0xf2, 0xf4, 0x79, 0x41, 0xf9, 0xe1, 0x79, 0x41, 0x79, 0xef, 0xa8, 0x90, 0x7a, - 0x7a, 0x54, 0x48, 0x7d, 0x73, 0x54, 0x48, 0xdd, 0x5b, 0x3d, 0xae, 0xf2, 0x44, 0x3f, 0xb9, 0xf2, - 0x32, 0xba, 0x9b, 0x15, 0x3f, 0x7b, 0xfe, 0xe3, 0x97, 0x00, 0x00, 0x00, 0xff, 0xff, 0x86, 0x40, - 0x26, 0x57, 0x91, 0x1d, 0x00, 0x00, + // 1692 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0x4d, 0x6f, 0x1b, 0x4f, + 0x19, 0xf7, 0xc6, 0xae, 0x93, 0x3c, 0x49, 0xf3, 0xb2, 0xcd, 0x8b, 0xeb, 0xb6, 0x4e, 0xba, 0xbc, + 0x85, 0x43, 0xbc, 0x6d, 0x00, 0x21, 0x90, 0xa0, 0xca, 0x2b, 0xaa, 0x1a, 0xb7, 0xee, 0x26, 0xb4, + 0x52, 0x51, 0xb5, 0x4c, 0xbc, 0x93, 0xcd, 0xaa, 0xeb, 0x19, 0x77, 0x67, 0x6c, 0x27, 0xe5, 0xc6, + 0xb1, 0x27, 0x0e, 0x08, 0x10, 0x48, 0x7c, 0x00, 0x0e, 0x48, 0x1c, 0xe0, 0x00, 0x67, 0xa4, 0x4a, + 0x5c, 0x7a, 0x44, 0x48, 0x14, 0xd4, 0x7e, 0x03, 0xc4, 0x07, 0xf8, 0x6b, 0xf6, 0xcd, 0xbb, 0xce, + 0xd8, 0xd9, 0x54, 0x69, 0xa4, 0x4a, 0xff, 0x53, 0x32, 0x3b, 0xc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87, + 0x51, 0x4b, 0x30, 0xda, 0xc1, 0x1e, 0x73, 0x28, 0x29, 0xe5, 0x97, 0x95, 0x95, 0x82, 0x11, 0x0d, + 0xb5, 0x3f, 0x29, 0x30, 0x5d, 0x63, 0xb6, 0x81, 0x9b, 0xb4, 0x83, 0x6b, 0xc8, 0xb3, 0x9d, 0x4b, + 0x23, 0xf5, 0x5d, 0x28, 0x36, 0x7d, 0x83, 0x3e, 0xa7, 0x89, 0xb5, 0xeb, 0xd5, 0x20, 0xe8, 0x55, + 0x11, 0xf4, 0x6a, 0x18, 0xf4, 0xea, 0x26, 0x75, 0xc8, 0x46, 0x41, 0xd8, 0x32, 0x42, 0x71, 0xed, + 0xdf, 0x0a, 0x2c, 0xf6, 0x71, 0x36, 0x30, 0x6b, 0x51, 0xc2, 0xb0, 0xfa, 0x43, 0x80, 0x40, 0xca, + 0xa4, 0x6d, 0xee, 0xf3, 0xcf, 0x00, 0x3c, 0x1e, 0xa8, 0x3c, 0x6a, 0x73, 0x75, 0x17, 0xa6, 0x0f, + 0xdb, 0xc4, 0x72, 0x88, 0x6d, 0xb6, 0xd0, 0x49, 0x13, 0x13, 0x1e, 0xba, 0xfb, 0x95, 0xd0, 0xdd, + 0x1b, 0x01, 0x16, 0xb3, 0x5e, 0x54, 0x1d, 0xaa, 0x37, 0x11, 0x3f, 0xaa, 0xee, 0x62, 0x1b, 0x35, + 0x4e, 0xb6, 0x70, 0xc3, 0x98, 0x0a, 0x75, 0xeb, 0x81, 0xaa, 0xfa, 0x6d, 0x18, 0x6b, 0x85, 0xa9, + 0x0e, 0x9d, 0x2c, 0x55, 0xd3, 0x75, 0x58, 0x8d, 0x4a, 0xc1, 0x88, 0x25, 0xb5, 0x3f, 0x2a, 0x30, + 0x59, 0x63, 0xf6, 0xba, 0x65, 0x7d, 0x26, 0x09, 0xf9, 0xad, 0x02, 0x73, 0x49, 0xc2, 0x71, 0x36, + 0x24, 0xd1, 0x54, 0x2e, 0x26, 0x9a, 0x23, 0x99, 0xa3, 0xf9, 0xff, 0x60, 0xe1, 0xd5, 0xda, 0x2e, + 0x77, 0x76, 0x9d, 0x97, 0x6d, 0xc7, 0x42, 0x1c, 0x0f, 0x0c, 0xe9, 0x63, 0x98, 0x74, 0x43, 0x21, + 0xb1, 0x1d, 0x94, 0x46, 0x96, 0xf3, 0x2b, 0x13, 0x6b, 0xab, 0xfd, 0x76, 0x4e, 0x01, 0x56, 0x77, + 0x7b, 0x5a, 0x46, 0x0a, 0xa2, 0xcc, 0x61, 0x22, 0x31, 0x19, 0x27, 0x4d, 0xb9, 0x98, 0xa4, 0x2d, + 0x40, 0x91, 0x7b, 0x48, 0x38, 0x32, 0x12, 0x38, 0x12, 0x8c, 0xb4, 0xbf, 0xe4, 0xe1, 0xfa, 0x29, + 0x96, 0x71, 0x62, 0x50, 0x9f, 0x9b, 0x8a, 0xef, 0xe6, 0x0f, 0xce, 0x74, 0x33, 0x02, 0x48, 0xb9, + 0x1b, 0x7e, 0xeb, 0x73, 0xfb, 0xcf, 0x23, 0x70, 0x4d, 0x22, 0x25, 0xf6, 0x22, 0xd6, 0x6e, 0x34, + 0x30, 0x63, 0x7e, 0x08, 0xc6, 0x8c, 0x68, 0xa8, 0xce, 0xc1, 0x15, 0xec, 0x79, 0x34, 0xf2, 0x24, + 0x18, 0xa8, 0x3b, 0x30, 0x15, 0xe1, 0x52, 0xcf, 0x3c, 0xc4, 0x38, 0x5b, 0x75, 0x2a, 0xc6, 0xd5, + 0x9e, 0xda, 0x0e, 0xc6, 0xea, 0x3d, 0x98, 0x10, 0x6e, 0x99, 0xf8, 0xd0, 0x07, 0x29, 0x64, 0x03, + 0x19, 0x17, 0x3a, 0xdb, 0x87, 0x02, 0xa0, 0x17, 0xe9, 0x2b, 0xc9, 0x48, 0xc7, 0x09, 0x2d, 0x5e, + 0x48, 0x42, 0xb5, 0xd7, 0x79, 0x98, 0x12, 0x71, 0x47, 0xde, 0x0b, 0xcc, 0x1f, 0x79, 0xc2, 0xc2, +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 0x84, 0x31, 0x4b, + 0x28, 0xf4, 0x5a, 0xfd, 0x21, 0x9d, 0xda, 0xa2, 0xa0, 0xf5, 0xbf, 0x77, 0x4b, 0xd3, 0x27, 0xa8, + 0xe9, 0x7e, 0x5f, 0x8b, 0x14, 0x35, 0x23, 0xc6, 0xd0, 0x34, 0x58, 0x1e, 0xc4, 0x21, 0xaa, 0x24, + 0xed, 0x51, 0xb0, 0xad, 0xf9, 0x79, 0xda, 0xa4, 0xae, 0x8b, 0x38, 0xf6, 0x90, 0xbb, 0x85, 0x09, + 0x6d, 0x0e, 0xe4, 0x79, 0x03, 0xc6, 0x09, 0xee, 0x9a, 0x96, 0x10, 0x0a, 0xdb, 0xd6, 0x31, 0x82, + 0xbb, 0xbe, 0x52, 0x68, 0x54, 0x0a, 0x18, 0x1b, 0xfd, 0x4d, 0x70, 0x97, 0x5d, 0x77, 0x5d, 0xda, + 0x40, 0x1c, 0x6f, 0xb7, 0x68, 0xe3, 0xc8, 0xc0, 0x07, 0x88, 0x63, 0x36, 0xd0, 0x28, 0x86, 0x51, + 0x2f, 0x10, 0x09, 0xaf, 0x27, 0x43, 0x62, 0x73, 0x47, 0xc4, 0xe6, 0x0f, 0xff, 0x59, 0x5a, 0x49, + 0x2c, 0xda, 0xf0, 0x6d, 0x23, 0xf8, 0xb3, 0xca, 0xac, 0x17, 0x3a, 0x3f, 0x69, 0x61, 0xe6, 0x2b, + 0x30, 0x23, 0xc2, 0xd6, 0x7e, 0xaf, 0xc0, 0xd2, 0x00, 0x6a, 0xf1, 0xea, 0xfb, 0x19, 0x5c, 0xe3, + 0x94, 0x23, 0xd7, 0xc4, 0x62, 0xd6, 0x8c, 0x68, 0x29, 0x17, 0x4f, 0x6b, 0xd6, 0xb7, 0x93, 0x24, + 0xa1, 0xdd, 0xf7, 0x43, 0xf7, 0xd4, 0xe1, 0x47, 0x96, 0x87, 0xba, 0x99, 0x42, 0xb7, 0x00, 0x45, + 0x9f, 0x69, 0x10, 0xb9, 0x82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, + 0xda, 0x1c, 0xd6, 0x03, 0x68, 0x39, 0xd5, 0x05, 0x55, 0x72, 0x0e, 0x7f, 0x4d, 0x56, 0x3a, 0xa7, + 0xc4, 0xca, 0xab, 0x99, 0xc4, 0x24, 0xd6, 0xd2, 0x87, 0xe1, 0x40, 0x6b, 0x29, 0xb1, 0xc1, 0xd6, + 0xe4, 0xa7, 0x51, 0x2a, 0x9e, 0xa9, 0xb3, 0x68, 0x58, 0x3c, 0x93, 0x82, 0x43, 0xe3, 0x29, 0x3d, + 0x44, 0xfc, 0xad, 0x29, 0x79, 0x86, 0x54, 0x06, 0x2d, 0xb0, 0x60, 0x5e, 0xba, 0x35, 0x49, 0x8e, + 0x02, 0x2d, 0xb7, 0xf1, 0xa3, 0x37, 0xef, 0x2b, 0xca, 0xdb, 0xf7, 0x15, 0xe5, 0xbf, 0xef, 0x2b, + 0xca, 0x2f, 0x3e, 0x54, 0x72, 0x6f, 0x3f, 0x54, 0x72, 0xff, 0xfc, 0x50, 0xc9, 0x3d, 0x5b, 0x3d, + 0xeb, 0xe4, 0x89, 0x7f, 0x3c, 0x14, 0x5d, 0xd9, 0x41, 0xd1, 0xff, 0x01, 0xef, 0x5b, 0x5f, 0x04, + 0x00, 0x00, 0xff, 0xff, 0xe2, 0x7b, 0xec, 0x17, 0x5b, 0x1c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/spot/client/cli/flags.go b/x/spot/client/cli/flags.go index deb5939c9..8f78e0e3c 100644 --- a/x/spot/client/cli/flags.go +++ b/x/spot/client/cli/flags.go @@ -5,7 +5,6 @@ import ( sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" flag "github.com/spf13/pflag" "github.com/NibiruChain/nibiru/x/spot/types" @@ -77,7 +76,7 @@ func FlagSetSwapAssets() *flag.FlagSet { } func (cpi createPoolInputs) AmplificationInt() (sdkmath.Int, error) { - amplificationInt, ok := sdk.NewIntFromString(cpi.Amplification) + amplificationInt, ok := sdkmath.NewIntFromString(cpi.Amplification) if !ok { return sdkmath.Int{}, fmt.Errorf( "%w: %v", types.ErrAmplificationIntable, cpi.Amplification) diff --git a/x/spot/client/cli/query.go b/x/spot/client/cli/query.go index f5616bc8a..5190e50ff 100644 --- a/x/spot/client/cli/query.go +++ b/x/spot/client/cli/query.go @@ -2,12 +2,12 @@ package cli import ( "context" + sdkmath "cosmossdk.io/math" "fmt" "strconv" "strings" "github.com/cosmos/cosmos-sdk/client" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" "github.com/spf13/cobra" @@ -81,7 +81,7 @@ func CmdGetPool() *cobra.Command { return err } - poolId, _ := sdk.NewIntFromString(args[0]) + poolId, _ := sdkmath.NewIntFromString(args[0]) queryClient := types.NewQueryClient(clientCtx) @@ -174,7 +174,7 @@ $ %s query spot pool-liquidity 1 clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - poolId, _ := sdk.NewIntFromString(args[0]) + poolId, _ := sdkmath.NewIntFromString(args[0]) res, err := queryClient.TotalPoolLiquidity( context.Background(), diff --git a/x/spot/client/cli/tx.go b/x/spot/client/cli/tx.go index 9879e15c3..710da049a 100644 --- a/x/spot/client/cli/tx.go +++ b/x/spot/client/cli/tx.go @@ -314,8 +314,8 @@ Where pool.json contains: /*sender=*/ clientCtx.GetFromAddress().String(), poolAssets, &types.PoolParams{ - SwapFee: sdk.MustNewDecFromStr(pool.SwapFee), - ExitFee: sdk.MustNewDecFromStr(pool.ExitFee), + SwapFee: sdkmath.LegacyMustNewDecFromStr(pool.SwapFee), + ExitFee: sdkmath.LegacyMustNewDecFromStr(pool.ExitFee), PoolType: poolType, A: amplification, }, diff --git a/x/spot/keeper/grpc_query.go b/x/spot/keeper/grpc_query.go index b692f2c49..2728b4254 100644 --- a/x/spot/keeper/grpc_query.go +++ b/x/spot/keeper/grpc_query.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" diff --git a/x/spot/keeper/keeper.go b/x/spot/keeper/keeper.go index d7b6ec978..329f01f0e 100644 --- a/x/spot/keeper/keeper.go +++ b/x/spot/keeper/keeper.go @@ -4,11 +4,11 @@ import ( "errors" "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + storetypes "cosmossdk.io/store/types" sdkmath "cosmossdk.io/math" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -185,7 +185,7 @@ func (k Keeper) FetchPoolFromPair(ctx sdk.Context, denomA string, denomB string) FetchAllPools fetch all pools from the store and returns them. */ func (k Keeper) FetchAllPools(ctx sdk.Context) (pools []types.Pool) { - iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.KeyPrefixPools) + iterator := storetypes.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.KeyPrefixPools) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { var pool types.Pool @@ -565,7 +565,7 @@ func (k Keeper) ExitPool( } if poolSharesOut.Amount.GT(pool.TotalShares.Amount) || - poolSharesOut.Amount.LTE(sdk.ZeroInt()) { + poolSharesOut.Amount.LTE(sdkmath.ZeroInt()) { return sdk.Coins{}, fmt.Errorf( "invalid number of pool shares %s must be between 0 and %s", poolSharesOut.Amount, pool.TotalShares.Amount, diff --git a/x/spot/keeper/liquidity.go b/x/spot/keeper/liquidity.go index 6151af626..61a633365 100644 --- a/x/spot/keeper/liquidity.go +++ b/x/spot/keeper/liquidity.go @@ -5,7 +5,7 @@ package keeper import ( "fmt" - "github.com/cosmos/cosmos-sdk/store/prefix" + "cosmossdk.io/store/prefix" spottypes "github.com/NibiruChain/nibiru/x/spot/types" @@ -32,7 +32,7 @@ func (k Keeper) GetDenomLiquidity(ctx sdk.Context, denom string) (amount sdkmath store := ctx.KVStore(k.storeKey) bz := store.Get(spottypes.GetDenomLiquidityPrefix(denom)) if bz == nil { - return sdk.ZeroInt(), nil + return sdkmath.ZeroInt(), nil } if err := amount.Unmarshal(bz); err != nil { diff --git a/x/spot/keeper/swap.go b/x/spot/keeper/swap.go index 305afef73..84e2a58a4 100644 --- a/x/spot/keeper/swap.go +++ b/x/spot/keeper/swap.go @@ -1,6 +1,7 @@ package keeper import ( + sdkmath "cosmossdk.io/math" "errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -87,7 +88,7 @@ func (k Keeper) SwapExactAmountIn( if err != nil { return sdk.Coin{}, err } - if tokenOut.Amount.LTE(sdk.ZeroInt()) { + if tokenOut.Amount.LTE(sdkmath.ZeroInt()) { return sdk.Coin{}, errors.New("tokenOut amount must be greater than zero") } diff --git a/x/spot/math/constant_function.go b/x/spot/math/constant_function.go index f4393aa7d..e6ff1fbc1 100644 --- a/x/spot/math/constant_function.go +++ b/x/spot/math/constant_function.go @@ -1,7 +1,7 @@ package math import ( - sdk "github.com/cosmos/cosmos-sdk/types" + "cosmossdk.io/math" ) // solveConstantFunctionInvariant solves the constant function of an AMM @@ -22,8 +22,8 @@ func SolveConstantProductInvariant( xAfter, /*unused*/ _xWeight, yPrior, - /*unused*/ _yWeight sdk.Dec, -) (deltaY sdk.Dec) { + /*unused*/ _yWeight math.LegacyDec, +) (deltaY math.LegacyDec) { // // weightRatio = (xWeight/yWeight) // weightRatio := xWeight.Quo(yWeight) @@ -36,5 +36,5 @@ func SolveConstantProductInvariant( // rToWeightRatio := sdk.MustNewDecFromStr( // fmt.Sprintf("%f", math.Pow(r.MustFloat64(), weightRatio.MustFloat64())), // ) - return yPrior.Mul(sdk.OneDec().Sub(r)) + return yPrior.Mul(math.LegacyOneDec().Sub(r)) } diff --git a/x/spot/module.go b/x/spot/module.go index 9bd9cca72..ba77a3b84 100644 --- a/x/spot/module.go +++ b/x/spot/module.go @@ -149,11 +149,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 2 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ sdk.Context) {} // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(_ sdk.Context) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } @@ -168,9 +168,19 @@ func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedP } // RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} // WeightedOperations returns the all the spot module operations with their respective weights. func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { return simulation.WeightedOperations(am.accountKeeper, am.bankKeeper, am.keeper) } + +func (am AppModule) IsOnePerModuleType() { + //TODO implement me + panic("implement me") +} + +func (am AppModule) IsAppModule() { + //TODO implement me + panic("implement me") +} diff --git a/x/spot/simulation/operations.go b/x/spot/simulation/operations.go index bf3d71f9e..17244a17e 100644 --- a/x/spot/simulation/operations.go +++ b/x/spot/simulation/operations.go @@ -87,7 +87,6 @@ func SimulateMsgCreatePool(ak types.AccountKeeper, bk types.BankKeeper, k keeper TxGen: testutil.MakeTestEncodingConfig().TxConfig, Cdc: nil, Msg: msg, - MsgType: msg.Type(), Context: ctx, SimAccount: simAccount, AccountKeeper: ak, @@ -141,7 +140,6 @@ func SimulateMsgSwap(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keepe TxGen: testutil.MakeTestEncodingConfig().TxConfig, Cdc: nil, Msg: msg, - MsgType: msg.Type(), Context: ctx, SimAccount: simAccount, AccountKeeper: ak, @@ -163,7 +161,7 @@ func SimulateJoinPool(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keep ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msg := &types.MsgJoinPool{} // run only 1/3 of the time - if simtypes.RandomDecAmount(r, sdk.OneDec()).GTE(sdk.MustNewDecFromStr("0.33")) { + if simtypes.RandomDecAmount(r, sdkmath.LegacyOneDec()).GTE(sdkmath.LegacyMustNewDecFromStr("0.33")) { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "No join pool done"), nil, nil } @@ -176,16 +174,16 @@ func SimulateJoinPool(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keep return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "No pool existing yet for tokens in account"), nil, nil } - intensityFactorToken0 := simtypes.RandomDecAmount(r, sdk.MustNewDecFromStr("0.499")).Add(sdk.MustNewDecFromStr("0.5")) - intensityFactorToken1 := simtypes.RandomDecAmount(r, sdk.MustNewDecFromStr("0.499")).Add(sdk.MustNewDecFromStr("0.5")) + intensityFactorToken0 := simtypes.RandomDecAmount(r, sdkmath.LegacyMustNewDecFromStr("0.499")).Add(sdkmath.LegacyMustNewDecFromStr("0.5")) + intensityFactorToken1 := simtypes.RandomDecAmount(r, sdkmath.LegacyMustNewDecFromStr("0.499")).Add(sdkmath.LegacyMustNewDecFromStr("0.5")) tokensIn := sdk.NewCoins( sdk.NewCoin( pool.PoolAssets[0].Token.Denom, - intensityFactorToken0.Mul(sdk.NewDecFromInt(spendableCoins[index1].Amount)).TruncateInt()), + intensityFactorToken0.Mul(sdkmath.LegacyNewDecFromInt(spendableCoins[index1].Amount)).TruncateInt()), sdk.NewCoin( pool.PoolAssets[1].Token.Denom, - intensityFactorToken1.Mul(sdk.NewDecFromInt(spendableCoins[index2].Amount)).TruncateInt()), + intensityFactorToken1.Mul(sdkmath.LegacyNewDecFromInt(spendableCoins[index2].Amount)).TruncateInt()), ) msg = &types.MsgJoinPool{ @@ -206,7 +204,6 @@ func SimulateJoinPool(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keep TxGen: testutil.MakeTestEncodingConfig().TxConfig, Cdc: nil, Msg: msg, - MsgType: msg.Type(), Context: ctx, SimAccount: simAccount, AccountKeeper: ak, @@ -246,14 +243,14 @@ func SimulateExitPool(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keep return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "No pool share token found in wallet"), nil, nil } - intensityFactor := simtypes.RandomDecAmount(r, sdk.MustNewDecFromStr("0.499")).Add(sdk.MustNewDecFromStr("0.5")) + intensityFactor := simtypes.RandomDecAmount(r, sdkmath.LegacyMustNewDecFromStr("0.499")).Add(sdkmath.LegacyMustNewDecFromStr("0.5")) shareTokensIn := sdk.NewCoin( shareTokens.Denom, intensityFactor.MulInt(shareTokens.Amount).TruncateInt(), ) // Ugly but does the job - poolId := sdk.MustNewDecFromStr(strings.Replace(shareTokensIn.Denom, "nibiru/pool/", "", 1)).TruncateInt().Uint64() + poolId := sdkmath.LegacyMustNewDecFromStr(strings.Replace(shareTokensIn.Denom, "nibiru/pool/", "", 1)).TruncateInt().Uint64() // check if there are enough tokens to withdraw pool, err := k.FetchPool(ctx, poolId) @@ -283,7 +280,6 @@ func SimulateExitPool(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keep TxGen: testutil.MakeTestEncodingConfig().TxConfig, Cdc: nil, Msg: msg, - MsgType: msg.Type(), Context: ctx, SimAccount: simAccount, AccountKeeper: ak, @@ -311,7 +307,7 @@ func genBalancerPoolParams(r *rand.Rand, blockTime time.Time, assets []types.Poo // swapFee := sdk.NewDecWithPrec(swapFeeInt, 6) exitFeeInt := int64(r.Intn(1e5)) - exitFee := sdk.NewDecWithPrec(exitFeeInt, 6) + exitFee := sdkmath.LegacyNewDecWithPrec(exitFeeInt, 6) isBalancer := r.Intn(2) var poolType types.PoolType @@ -321,11 +317,11 @@ func genBalancerPoolParams(r *rand.Rand, blockTime time.Time, assets []types.Poo poolType = types.PoolType_STABLESWAP } - A := sdk.NewInt(int64(r.Intn(4_000) + 1)) + A := sdkmath.NewInt(int64(r.Intn(4_000) + 1)) // Create swap fee between 0% and 5% swapFeeFloat := r.Float64() * .05 - swapFee := sdk.MustNewDecFromStr(fmt.Sprintf("%.5f", swapFeeFloat)) + swapFee := sdkmath.LegacyMustNewDecFromStr(fmt.Sprintf("%.5f", swapFeeFloat)) return types.PoolParams{ SwapFee: swapFee, @@ -352,7 +348,7 @@ func genPoolAssets( reserveAmt := sdk.NewCoin(denom, amt) // Weight is useless for stableswap pools. - weight := sdk.NewInt(r.Int63n(9) + 1) + weight := sdkmath.NewInt(r.Int63n(9) + 1) assets = append(assets, types.PoolAsset{Token: reserveAmt, Weight: weight}) if len(assets) == 2 { @@ -369,9 +365,9 @@ func genPoolAssets( func fundAccountWithTokens(ctx sdk.Context, address sdk.AccAddress, bk types.BankKeeper) { million := 1 * common.TO_MICRO newTokens := sdk.NewCoins( - sdk.NewCoin(denoms.NIBI, sdk.NewInt(int64(10*million))), - sdk.NewCoin(denoms.USDC, sdk.NewInt(int64(10*million))), - sdk.NewCoin(denoms.NUSD, sdk.NewInt(int64(10*million))), + sdk.NewCoin(denoms.NIBI, sdkmath.NewInt(int64(10*million))), + sdk.NewCoin(denoms.USDC, sdkmath.NewInt(int64(10*million))), + sdk.NewCoin(denoms.NUSD, sdkmath.NewInt(int64(10*million))), ) err := bk.MintCoins(ctx, types.ModuleName, newTokens) @@ -410,7 +406,7 @@ func findRandomPoolWithDenom(ctx sdk.Context, r *rand.Rand, spendableCoins sdk.C } } - return "", "", 0, sdk.ZeroInt() + return "", "", 0, sdkmath.ZeroInt() } // findRandomPoolWithDenomPair search one pool available from a pair of coins of simCoins diff --git a/x/spot/types/expected_keepers.go b/x/spot/types/expected_keepers.go index da254c9b2..c32a22b76 100644 --- a/x/spot/types/expected_keepers.go +++ b/x/spot/types/expected_keepers.go @@ -1,53 +1,53 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) type AccountKeeper interface { - IterateAccounts(ctx sdk.Context, process func(authtypes.AccountI) (stop bool)) - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI - NewAccount(sdk.Context, authtypes.AccountI) authtypes.AccountI - SetAccount(ctx sdk.Context, acc authtypes.AccountI) + IterateAccounts(ctx context.Context, process func(sdk.AccountI) (stop bool)) + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + NewAccount(context.Context, sdk.AccountI) sdk.AccountI + SetAccount(ctx context.Context, acc sdk.AccountI) GetModuleAddress(name string) sdk.AccAddress - GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + GetModuleAccount(ctx context.Context, moduleName string) sdk.ModuleAccountI - SetModuleAccount(sdk.Context, authtypes.ModuleAccountI) + SetModuleAccount(context.Context, sdk.ModuleAccountI) // Methods imported from account should be defined here } // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { // Methods imported from bank should be defined here - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + SendCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, name string, amt sdk.Coins) error - SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata) + SetDenomMetaData(ctx context.Context, denomMetaData banktypes.Metadata) // Only needed for simulation interface matching // TODO: Look into golang syntax to make this "Everything in stakingtypes.bankkeeper + extra funcs" // I think it has to do with listing another interface as the first line here? - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin - // SetBalances(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error - LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetSupply(ctx sdk.Context, denom string) sdk.Coin - UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - IterateAllBalances(ctx sdk.Context, callback func(addr sdk.AccAddress, coin sdk.Coin) (stop bool)) + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin + // SetBalances(ctx context.Context, addr sdk.AccAddress, balances sdk.Coins) error + LockedCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetSupply(ctx context.Context, denom string) sdk.Coin + UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + IterateAllBalances(ctx context.Context, callback func(addr sdk.AccAddress, coin sdk.Coin) (stop bool)) } // DistrKeeper defines the contract needed to be fulfilled for distribution keeper. type DistrKeeper interface { - FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error } diff --git a/x/spot/types/message.go b/x/spot/types/message.go index 8724d6b5b..b848df1f0 100644 --- a/x/spot/types/message.go +++ b/x/spot/types/message.go @@ -2,6 +2,8 @@ package types import ( sdkerrors "cosmossdk.io/errors" + "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -139,7 +141,7 @@ func (msg *MsgSwapAssets) ValidateBasic() error { return ErrInvalidPoolId.Wrapf("pool id cannot be %d", msg.PoolId) } - if msg.TokenIn.Amount.LTE(sdk.ZeroInt()) { + if msg.TokenIn.Amount.LTE(math.ZeroInt()) { return ErrInvalidTokenIn.Wrapf("invalid argument %s", msg.TokenIn.String()) } @@ -195,16 +197,16 @@ func (msg *MsgCreatePool) ValidateBasic() error { } for _, asset := range msg.PoolAssets { - if asset.Weight.LTE(sdk.ZeroInt()) { + if asset.Weight.LTE(sdkmath.ZeroInt()) { return ErrInvalidTokenWeight.Wrapf("invalid token weight %d for denom %s", asset.Weight, asset.Token.Denom) } } - if msg.PoolParams.SwapFee.LT(sdk.ZeroDec()) || msg.PoolParams.SwapFee.GT(sdk.OneDec()) { + if msg.PoolParams.SwapFee.LT(math.LegacyZeroDec()) || msg.PoolParams.SwapFee.GT(math.LegacyOneDec()) { return ErrInvalidSwapFee.Wrapf("invalid swap fee: %s", msg.PoolParams.SwapFee) } - if msg.PoolParams.ExitFee.LT(sdk.ZeroDec()) || msg.PoolParams.ExitFee.GT(sdk.OneDec()) { + if msg.PoolParams.ExitFee.LT(math.LegacyZeroDec()) || msg.PoolParams.ExitFee.GT(math.LegacyOneDec()) { return ErrInvalidExitFee.Wrapf("invalid exit fee: %s", msg.PoolParams.ExitFee) } diff --git a/x/spot/types/pool.go b/x/spot/types/pool.go index 7144ec620..3643558b9 100644 --- a/x/spot/types/pool.go +++ b/x/spot/types/pool.go @@ -72,7 +72,7 @@ func NewPool( Address: poolAccountAddr.String(), PoolParams: poolParams, PoolAssets: nil, - TotalWeight: sdk.ZeroInt(), + TotalWeight: sdkmath.ZeroInt(), TotalShares: sdk.NewCoin(GetPoolShareBaseDenom(poolId), InitPoolSharesSupply), } @@ -130,12 +130,12 @@ func (pool *Pool) AddTokensToPool(tokensIn sdk.Coins) ( numShares, remCoins, err = pool.numSharesOutFromTokensIn(tokensIn) } if err != nil { - return sdk.ZeroInt(), sdk.Coins{}, err + return sdkmath.ZeroInt(), sdk.Coins{}, err } tokensIn.Sort() if err := pool.incrementBalances(numShares, tokensIn.Sub(remCoins...)); err != nil { - return sdk.ZeroInt(), sdk.Coins{}, err + return sdkmath.ZeroInt(), sdk.Coins{}, err } return numShares, remCoins, nil @@ -167,7 +167,7 @@ func (pool *Pool) AddAllTokensToPool(tokensIn sdk.Coins) ( if tokensIn.Len() > 1 { numShares, remCoins, err = pool.AddTokensToPool(tokensIn) } else { - numShares = sdk.ZeroInt() + numShares = sdkmath.ZeroInt() } if remCoins.Empty() { @@ -244,7 +244,7 @@ func (pool *Pool) updatePoolAssetBalances(tokens ...sdk.Coin) (err error) { // Ensures that there are no duplicate denoms, all denom's are valid, // and amount is > 0 for _, coin := range tokens { - if coin.Amount.LT(sdk.ZeroInt()) { + if coin.Amount.LT(sdkmath.ZeroInt()) { return fmt.Errorf("provided coins are invalid, %v", tokens) } assetIndex, existingAsset, err := pool.getPoolAssetAndIndex(coin.Denom) @@ -265,7 +265,7 @@ func (pool *Pool) updatePoolAssetBalances(tokens ...sdk.Coin) (err error) { func (pool *Pool) setInitialPoolAssets(poolAssets []PoolAsset) (err error) { exists := make(map[string]bool) - newTotalWeight := sdk.ZeroInt() + newTotalWeight := sdkmath.ZeroInt() scaledPoolAssets := make([]PoolAsset, 0, len(poolAssets)) for _, asset := range poolAssets { @@ -500,5 +500,5 @@ func (pool Pool) SolveStableswapInvariant(tokenIn sdk.Coin, tokenOutDenom string } } - return sdk.NewIntFromUint64(y.Uint64()), nil + return sdkmath.NewIntFromUint64(y.Uint64()), nil } diff --git a/x/spot/types/pool.pb.go b/x/spot/types/pool.pb.go index d921d1738..972bfb6cf 100644 --- a/x/spot/types/pool.pb.go +++ b/x/spot/types/pool.pb.go @@ -4,9 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -57,15 +57,15 @@ func (PoolType) EnumDescriptor() ([]byte, []int) { // Configuration parameters for the pool. type PoolParams struct { - SwapFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"swap_fee" yaml:"swap_fee"` - ExitFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exit_fee" yaml:"exit_fee"` + SwapFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=swap_fee,json=swapFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"swap_fee" yaml:"swap_fee"` + ExitFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=exit_fee,json=exitFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"exit_fee" yaml:"exit_fee"` // Amplification Parameter (A): Larger value of A make the curve better // resemble a straight line in the center (when pool is near balance). Highly // volatile assets should use a lower value, while assets that are closer // together may be best with a higher value. This is only used if the // pool_type is set to 1 (stableswap) - A github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=A,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"A" yaml:"amplification"` - PoolType PoolType `protobuf:"varint,4,opt,name=pool_type,json=poolType,proto3,enum=nibiru.spot.v1.PoolType" json:"pool_type,omitempty" yaml:"pool_type"` + A cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=A,proto3,customtype=cosmossdk.io/math.Int" json:"A" yaml:"amplification"` + PoolType PoolType `protobuf:"varint,4,opt,name=pool_type,json=poolType,proto3,enum=nibiru.spot.v1.PoolType" json:"pool_type,omitempty" yaml:"pool_type"` } func (m *PoolParams) Reset() { *m = PoolParams{} } @@ -114,7 +114,7 @@ type PoolAsset struct { // the denomination must be unique amongst all PoolAssets for this pool. Token types.Coin `protobuf:"bytes,1,opt,name=token,proto3" json:"token" yaml:"token"` // Weight that is not normalized. This weight must be less than 2^50 - Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight" yaml:"weight"` + Weight cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=cosmossdk.io/math.Int" json:"weight" yaml:"weight"` } func (m *PoolAsset) Reset() { *m = PoolAsset{} } @@ -168,7 +168,7 @@ type Pool struct { // They contain the pool asset and the information about the weight PoolAssets []PoolAsset `protobuf:"bytes,4,rep,name=pool_assets,json=poolAssets,proto3" json:"pool_assets" yaml:"pool_assets"` // sum of all non-normalized pool weights - TotalWeight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=total_weight,json=totalWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_weight" yaml:"total_weight"` + TotalWeight cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=total_weight,json=totalWeight,proto3,customtype=cosmossdk.io/math.Int" json:"total_weight" yaml:"total_weight"` // sum of all LP tokens sent out TotalShares types.Coin `protobuf:"bytes,6,opt,name=total_shares,json=totalShares,proto3" json:"total_shares" yaml:"total_shares"` } @@ -216,46 +216,47 @@ func init() { func init() { proto.RegisterFile("nibiru/spot/v1/pool.proto", fileDescriptor_cf0eee5bfc2c3a2b) } var fileDescriptor_cf0eee5bfc2c3a2b = []byte{ - // 620 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcd, 0x6a, 0xdb, 0x40, - 0x10, 0xc7, 0x25, 0xc7, 0x49, 0x9c, 0x75, 0xea, 0x86, 0xad, 0x0f, 0x8a, 0x0b, 0x52, 0xd8, 0x43, - 0x09, 0xa1, 0x95, 0x70, 0x7a, 0xcb, 0xa5, 0x48, 0x89, 0x03, 0xa5, 0x21, 0x04, 0x25, 0xd4, 0xb4, - 0x14, 0xcc, 0xda, 0xde, 0xd8, 0x4b, 0x6c, 0xad, 0xf0, 0x6e, 0x3e, 0xfc, 0x06, 0x3d, 0xf6, 0x11, - 0x7a, 0xef, 0x4b, 0xf4, 0x98, 0x63, 0x8e, 0xa5, 0x07, 0x51, 0xec, 0x63, 0x6f, 0x7e, 0x82, 0xb2, - 0x1f, 0x6a, 0x12, 0x30, 0x14, 0xd3, 0x93, 0x76, 0xf8, 0xcf, 0xfc, 0xb4, 0xf3, 0x9f, 0x61, 0xc1, - 0x66, 0x42, 0xdb, 0x74, 0x74, 0x19, 0xf0, 0x94, 0x89, 0xe0, 0xaa, 0x1e, 0xa4, 0x8c, 0x0d, 0xfc, - 0x74, 0xc4, 0x04, 0x83, 0x15, 0x2d, 0xf9, 0x52, 0xf2, 0xaf, 0xea, 0xb5, 0x6a, 0x8f, 0xf5, 0x98, - 0x92, 0x02, 0x79, 0xd2, 0x59, 0x35, 0xb7, 0xc3, 0xf8, 0x90, 0xf1, 0xa0, 0x8d, 0x39, 0x09, 0xae, - 0xea, 0x6d, 0x22, 0x70, 0x3d, 0xe8, 0x30, 0x9a, 0x18, 0x7d, 0x53, 0xeb, 0x2d, 0x5d, 0xa8, 0x03, - 0x2d, 0xa1, 0xdf, 0x05, 0x00, 0x4e, 0x18, 0x1b, 0x9c, 0xe0, 0x11, 0x1e, 0x72, 0xf8, 0x09, 0x94, - 0xf8, 0x35, 0x4e, 0x5b, 0xe7, 0x84, 0x38, 0xf6, 0x96, 0xbd, 0xbd, 0x16, 0x85, 0xb7, 0x99, 0x67, - 0xfd, 0xcc, 0xbc, 0x17, 0x3d, 0x2a, 0xfa, 0x97, 0x6d, 0xbf, 0xc3, 0x86, 0x86, 0x60, 0x3e, 0xaf, - 0x78, 0xf7, 0x22, 0x10, 0xe3, 0x94, 0x70, 0xff, 0x80, 0x74, 0x66, 0x99, 0xf7, 0x74, 0x8c, 0x87, - 0x83, 0x3d, 0x94, 0x73, 0x50, 0xbc, 0x2a, 0x8f, 0x87, 0x84, 0x48, 0x3a, 0xb9, 0xa1, 0x42, 0xd1, - 0x0b, 0xff, 0x47, 0xcf, 0x39, 0x28, 0x5e, 0x95, 0x47, 0x49, 0x3f, 0x03, 0x76, 0xe8, 0x2c, 0x29, - 0xec, 0xe1, 0x02, 0xd8, 0xb7, 0x89, 0x98, 0x65, 0x5e, 0x55, 0x63, 0xf1, 0x30, 0x1d, 0xd0, 0x73, - 0xda, 0xc1, 0x82, 0xb2, 0x04, 0xc5, 0x76, 0x08, 0xdf, 0x81, 0x35, 0x39, 0x8f, 0x96, 0x4c, 0x76, - 0x8a, 0x5b, 0xf6, 0x76, 0x65, 0xd7, 0xf1, 0x1f, 0x4f, 0xc5, 0x97, 0x06, 0x9e, 0x8d, 0x53, 0x12, - 0x55, 0x67, 0x99, 0xb7, 0xa1, 0x49, 0x7f, 0x8b, 0x50, 0x5c, 0x4a, 0x8d, 0x8e, 0xbe, 0xd9, 0x60, - 0x4d, 0x26, 0x87, 0x9c, 0x13, 0x01, 0x1b, 0x60, 0x59, 0xb0, 0x0b, 0x92, 0x28, 0xa7, 0xcb, 0xbb, - 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0x3e, 0x55, 0xd1, 0x5e, 0xf1, 0xf3, 0x57, 0xcf, 0xda, - 0xd9, 0x06, 0xa5, 0x7c, 0x39, 0xe1, 0x3a, 0x28, 0x45, 0xe1, 0x51, 0x78, 0xbc, 0xdf, 0x88, 0x37, - 0x2c, 0x58, 0x01, 0xe0, 0xf4, 0x2c, 0x8c, 0x8e, 0x1a, 0xa7, 0xcd, 0xf0, 0x64, 0xc3, 0x8e, 0x0e, - 0x6e, 0x27, 0xae, 0x7d, 0x37, 0x71, 0xed, 0x5f, 0x13, 0xd7, 0xfe, 0x32, 0x75, 0xad, 0xbb, 0xa9, - 0x6b, 0xfd, 0x98, 0xba, 0xd6, 0xc7, 0x9d, 0x07, 0x0d, 0x1f, 0x2b, 0x6f, 0xf7, 0xfb, 0x98, 0x26, - 0x81, 0x79, 0xb5, 0x6e, 0xf4, 0xbb, 0xa5, 0x1a, 0x6f, 0xaf, 0xa8, 0x57, 0xe5, 0xf5, 0x9f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x0e, 0x8e, 0x88, 0xaa, 0xd3, 0x04, 0x00, 0x00, + // 625 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcb, 0x4e, 0x1b, 0x3d, + 0x14, 0xc7, 0x33, 0x21, 0x40, 0x70, 0xf8, 0xf2, 0x21, 0x37, 0x95, 0x42, 0x90, 0x66, 0x90, 0x57, + 0x08, 0x55, 0x1e, 0x85, 0x5e, 0x16, 0xec, 0x66, 0x02, 0x48, 0x55, 0x11, 0xa2, 0x03, 0x2a, 0x6a, + 0x37, 0x91, 0x33, 0x31, 0x89, 0x45, 0x66, 0x3c, 0x8a, 0xcd, 0x25, 0x6f, 0xd0, 0x65, 0xd7, 0x5d, + 0xf5, 0x0d, 0xfa, 0x12, 0x5d, 0xb0, 0x64, 0x59, 0x75, 0x31, 0xaa, 0xe0, 0x0d, 0xf2, 0x04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00, } func (m *PoolParams) Marshal() (dAtA []byte, err error) { diff --git a/x/spot/types/pool_asset.go b/x/spot/types/pool_asset.go index d81673cda..76e8d0c83 100644 --- a/x/spot/types/pool_asset.go +++ b/x/spot/types/pool_asset.go @@ -5,17 +5,15 @@ import ( fmt "fmt" sdkmath "cosmossdk.io/math" - - sdk "github.com/cosmos/cosmos-sdk/types" ) // Validates a PoolAsset amount and weights. func (poolAsset PoolAsset) Validate() error { - if poolAsset.Token.Amount.LTE(sdk.ZeroInt()) { + if poolAsset.Token.Amount.LTE(sdkmath.ZeroInt()) { return fmt.Errorf("can't add the zero or negative balance of token") } - if poolAsset.Weight.LTE(sdk.ZeroInt()) { + if poolAsset.Weight.LTE(sdkmath.ZeroInt()) { return fmt.Errorf("a token's weight in the pool must be greater than 0") } @@ -31,7 +29,7 @@ Subtracts an amount of coins from a pool's assets. Throws an error if the final amount is less than zero. */ func (pool *Pool) SubtractPoolAssetBalance(assetDenom string, subAmt sdkmath.Int) (err error) { - if subAmt.LT(sdk.ZeroInt()) { + if subAmt.LT(sdkmath.ZeroInt()) { return errors.New("can't subtract a negative amount") } @@ -42,7 +40,7 @@ func (pool *Pool) SubtractPoolAssetBalance(assetDenom string, subAmt sdkmath.Int // Update the supply of the asset poolAsset.Token.Amount = poolAsset.Token.Amount.Sub(subAmt) - if poolAsset.Token.Amount.LT(sdk.ZeroInt()) { + if poolAsset.Token.Amount.LT(sdkmath.ZeroInt()) { return errors.New("can't set the pool's balance of a token to be zero or negative") } pool.PoolAssets[index] = poolAsset diff --git a/x/spot/types/price.go b/x/spot/types/price.go index e07cbcab5..96c9073c1 100644 --- a/x/spot/types/price.go +++ b/x/spot/types/price.go @@ -1,22 +1,24 @@ package types -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + "cosmossdk.io/math" +) // CalcSpotPrice calculates the spot price based on weight. // spotPrice = (BalanceIn / WeightIn) / (BalanceOut / WeightOut) -func (pool Pool) CalcSpotPrice(tokenIn, tokenOut string) (sdk.Dec, error) { +func (pool Pool) CalcSpotPrice(tokenIn, tokenOut string) (math.LegacyDec, error) { _, poolAssetIn, err := pool.getPoolAssetAndIndex(tokenIn) if err != nil { - return sdk.Dec{}, err + return math.LegacyDec{}, err } _, poolAssetOut, err := pool.getPoolAssetAndIndex(tokenOut) if err != nil { - return sdk.Dec{}, err + return math.LegacyDec{}, err } - weightedBalanceIn := sdk.NewDecFromInt(poolAssetIn.Token.Amount).Quo(sdk.NewDecFromInt(poolAssetIn.Weight)) - weightedBalanceOut := sdk.NewDecFromInt(poolAssetOut.Token.Amount).Quo(sdk.NewDecFromInt(poolAssetOut.Weight)) + weightedBalanceIn := math.LegacyNewDecFromInt(poolAssetIn.Token.Amount).Quo(math.LegacyNewDecFromInt(poolAssetIn.Weight)) + weightedBalanceOut := math.LegacyNewDecFromInt(poolAssetOut.Token.Amount).Quo(math.LegacyNewDecFromInt(poolAssetOut.Weight)) return weightedBalanceIn.Quo(weightedBalanceOut), nil } diff --git a/x/spot/types/query.pb.go b/x/spot/types/query.pb.go index e7e5041ce..8a572fb66 100644 --- a/x/spot/types/query.pb.go +++ b/x/spot/types/query.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" @@ -1193,7 +1194,7 @@ func (m *QueryJoinExactAmountInRequest) GetTokensIn() github_com_cosmos_cosmos_s type QueryJoinExactAmountInResponse struct { // amount of pool shares returned to user after join - PoolSharesOut github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=pool_shares_out,json=poolSharesOut,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"pool_shares_out" yaml:"pool_shares_out"` + PoolSharesOut cosmossdk_io_math.Int `protobuf:"bytes,1,opt,name=pool_shares_out,json=poolSharesOut,proto3,customtype=cosmossdk.io/math.Int" json:"pool_shares_out" yaml:"pool_shares_out"` // coins remaining after pool join RemCoins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=rem_coins,json=remCoins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rem_coins" yaml:"rem_coins"` } @@ -1321,7 +1322,7 @@ var xxx_messageInfo_QueryJoinExactAmountOutResponse proto.InternalMessageInfo type QueryExitExactAmountInRequest struct { PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` // amount of pool shares to return to pool - PoolSharesIn github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=pool_shares_in,json=poolSharesIn,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"pool_shares_in" yaml:"pool_shares_in"` + PoolSharesIn cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=pool_shares_in,json=poolSharesIn,proto3,customtype=cosmossdk.io/math.Int" json:"pool_shares_in" yaml:"pool_shares_in"` } func (m *QueryExitExactAmountInRequest) Reset() { *m = QueryExitExactAmountInRequest{} } @@ -1535,103 +1536,103 @@ func init() { func init() { proto.RegisterFile("nibiru/spot/v1/query.proto", fileDescriptor_15e32191d06b2665) } var fileDescriptor_15e32191d06b2665 = []byte{ - // 1522 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0x14, 0xc7, - 0x16, 0x75, 0x63, 0x63, 0x3c, 0x65, 0x30, 0x50, 0x36, 0xc6, 0x6e, 0xc3, 0x18, 0x0a, 0xb0, 0xfd, - 0x6c, 0x31, 0xad, 0x01, 0xde, 0x43, 0xbc, 0x04, 0xa1, 0x18, 0x1c, 0xe2, 0x7c, 0x80, 0x33, 0x44, - 0x91, 0x92, 0x2c, 0x46, 0x6d, 0xbb, 0x3c, 0x34, 0xb8, 0xbb, 0x9a, 0xe9, 0x6a, 0xb0, 0x15, 0x48, - 0xa4, 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78, 0x14, 0x9f, 0x43, 0x83, 0x0a, 0x77, 0x42, - 0x3b, 0xa6, 0xcd, 0x0d, 0x9f, 0x19, 0xaf, 0xc5, 0x55, 0xa8, 0xa9, 0xf8, 0xc5, 0x81, 0xc7, 0x3b, - 0xd3, 0x7d, 0x0d, 0x88, 0x25, 0x13, 0x68, 0x5c, 0x15, 0x63, 0x6c, 0xf3, 0x9a, 0x6f, 0xaf, 0xd2, - 0x76, 0x00, 0x73, 0x06, 0x1d, 0x4e, 0xed, 0x00, 0xd4, 0x61, 0xb4, 0x47, 0x74, 0xd1, 0xb4, 0xd6, - 0x25, 0xd6, 0x40, 0x63, 0x50, 0xfc, 0xb9, 0xbc, 0x4e, 0x16, 0xd0, 0x81, 0x30, 0x07, 0xea, 0xe4, - 0x07, 0x5f, 0x44, 0x07, 0x23, 0xc1, 0x50, 0x7a, 0x0e, 0x0d, 0x88, 0x6d, 0xe8, 0x61, 0x2c, 0xd5, - 0x83, 0x88, 0x95, 0x11, 0xe4, 0x83, 0x48, 0x7a, 0xa0, 0x0d, 0x7e, 0x15, 0xa1, 0xce, 0xe9, 0x40, - 0x91, 0x99, 0x9a, 0x92, 0xb9, 0x26, 0x64, 0xae, 0x29, 0x9f, 0x80, 0xd8, 0xb5, 0x15, 0xb3, 0x45, - 0x21, 0xb7, 0x11, 0xc9, 0x24, 0x9f, 0x69, 0x81, 0xf4, 0xaa, 0x3a, 0xb0, 0x9b, 0x47, 0xbb, 0x05, - 0xb6, 0x90, 0xb8, 0x3f, 0x97, 0x9e, 0x0a, 0xc1, 0x57, 0x63, 0x54, 0x76, 0x49, 0x2a, 0xb3, 0x85, - 0x54, 0x14, 0x50, 0x8c, 0x4b, 0x3d, 0x72, 0x44, 0x31, 0x27, 0xe4, 0x4b, 0xfb, 0x6e, 0xe4, 0xec, - 0x12, 0x36, 0x79, 0x09, 0x0d, 0xcb, 0x9c, 0x98, 0x57, 0xf4, 0xac, 0x46, 0x20, 0x11, 0xb9, 0xe1, - 0x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ytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0x15, 0x55, + 0x18, 0xee, 0xd0, 0x52, 0x7a, 0x4f, 0xa1, 0xc0, 0xe9, 0x07, 0xed, 0x14, 0x6e, 0xe1, 0x00, 0x6d, + 0x6d, 0xc3, 0x4c, 0x2e, 0x20, 0x04, 0x95, 0x10, 0x0b, 0xd5, 0xd4, 0x0f, 0xa8, 0x17, 0x63, 0xe2, + 0x47, 0x72, 0x33, 0x6d, 0x4f, 0x6f, 0x07, 0x7a, 0xe7, 0x5c, 0xee, 0x9c, 0x81, 0x36, 0x82, 0x26, + 0x6e, 0x8c, 0x6e, 0xd4, 0x90, 0xb8, 0x72, 0xe1, 0xc6, 0x8d, 0x1b, 0x35, 0x26, 0xc6, 0x85, 0x3f, + 0x80, 0x25, 0x89, 0x1b, 0xe3, 0xa2, 0x1a, 0xea, 0x2f, 0xe0, 0x0f, 0x68, 0xce, 0x39, 0xef, 0xcc, + 0x9d, 0xcf, 0x3b, 0x73, 0x13, 0x16, 0xae, 0xb8, 0x3d, 0xe7, 0x7d, 0xdf, 0xe7, 0x79, 0x9f, 0xf3, + 0xcc, 0xcc, 0x7b, 0x40, 0xba, 0x63, 0xaf, 0xd8, 0x2d, 0xcf, 0x74, 0x9b, 0x8c, 0x9b, 0x77, 0x2b, + 0xe6, 0x1d, 0x8f, 0xb6, 0xb6, 0x8d, 0x66, 0x8b, 0x71, 0x86, 0x87, 0xd4, 0x9e, 0x21, 0xf6, 0x8c, + 0xbb, 0x15, 0x7d, 0xa4, 0xce, 0xea, 0x4c, 0x6e, 0x99, 0xe2, 0x97, 0x8a, 0xd2, 0x8f, 0xd6, 0x19, + 0xab, 0x6f, 0x52, 0xd3, 0x6a, 0xda, 0xa6, 0xe5, 0x38, 0x8c, 0x5b, 0xdc, 0x66, 0x8e, 0x0b, 0xbb, + 0x73, 0xab, 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 0x93, 0xab, 0x7c, 0xf6, + 0xa0, 0x55, 0x5c, 0xf9, 0x24, 0x7b, 0xe6, 0xf1, 0x85, 0x6b, 0x8f, 0x9e, 0x94, 0xb5, 0xc7, 0x4f, + 0xca, 0xda, 0xdf, 0x4f, 0xca, 0xda, 0x97, 0xbb, 0xe5, 0x9e, 0xc7, 0xbb, 0xe5, 0x9e, 0x3f, 0x76, + 0xcb, 0x3d, 0xef, 0xcd, 0x85, 0xe6, 0xc9, 0xeb, 0xb2, 0xf4, 0xd5, 0x0d, 0xcb, 0x76, 0x7c, 0x98, + 0x2d, 0xf8, 0x20, 0x89, 0xb9, 0x72, 0xa5, 0x5f, 0xfe, 0x27, 0xf4, 0xb9, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x41, 0x4c, 0xce, 0x12, 0x6a, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/spot/types/shares.go b/x/spot/types/shares.go index b6a958b70..cd4df02c8 100644 --- a/x/spot/types/shares.go +++ b/x/spot/types/shares.go @@ -26,18 +26,19 @@ ret: func (pool Pool) numSharesOutFromTokensIn(tokensIn sdk.Coins) ( numShares sdkmath.Int, remCoins sdk.Coins, err error, ) { - coinShareRatios := make([]sdk.Dec, len(tokensIn)) - minShareRatio := sdk.MaxSortableDec - maxShareRatio := sdk.ZeroDec() + coinShareRatios := make([]sdkmath.LegacyDec, len(tokensIn)) + minShareRatio := sdkmath.LegacyMaxSortableDec + maxShareRatio := sdkmath.LegacyZeroDec() poolLiquidity := pool.PoolBalances() if len(tokensIn) == 1 { // From balancer whitepaper, for 2 assets with the same weight, the shares issued are: // P_{supply} * (sqrt(1+((1-f/2) * x_{in})/X)-1) - one := sdk.OneDec() + one := sdkmath.LegacyOneDec() - joinShare := sdk.NewDecFromInt(tokensIn[0].Amount).Mul(one.Sub(pool.PoolParams.SwapFee.Quo(sdk.NewDec(2)))).QuoInt( + joinShare := sdkmath.LegacyNewDecFromInt(tokensIn[0].Amount).Mul( + one.Sub(pool.PoolParams.SwapFee.Quo(sdkmath.LegacyNewDec(2)))).QuoInt( poolLiquidity.AmountOfNoDenomValidation(tokensIn[0].Denom), ).Add(one) @@ -51,7 +52,7 @@ func (pool Pool) numSharesOutFromTokensIn(tokensIn sdk.Coins) ( } for i, coin := range tokensIn { - shareRatio := sdk.NewDecFromInt(coin.Amount).QuoInt( + shareRatio := sdkmath.LegacyNewDecFromInt(coin.Amount).QuoInt( poolLiquidity.AmountOfNoDenomValidation(coin.Denom), ) if shareRatio.LT(minShareRatio) { @@ -63,12 +64,12 @@ func (pool Pool) numSharesOutFromTokensIn(tokensIn sdk.Coins) ( coinShareRatios[i] = shareRatio } - if minShareRatio.Equal(sdk.MaxSortableDec) { - return sdk.ZeroInt(), sdk.NewCoins(), errors.New("unexpected error in balancer maximalExactRatioJoin") + if minShareRatio.Equal(sdkmath.LegacyMaxSortableDec) { + return sdkmath.ZeroInt(), sdk.NewCoins(), errors.New("unexpected error in balancer maximalExactRatioJoin") } if minShareRatio.IsZero() { - return sdk.ZeroInt(), tokensIn, nil + return sdkmath.ZeroInt(), tokensIn, nil } numShares = minShareRatio.MulInt(pool.TotalShares.Amount).TruncateInt() @@ -121,7 +122,7 @@ func (pool Pool) numSharesOutFromTokensInStableSwap(tokensIn sdk.Coins) ( if err != nil { return } - D0 := sdk.NewInt(int64(D.Uint64())) + D0 := sdkmath.NewInt(int64(D.Uint64())) var newPoolAssets []PoolAsset @@ -141,7 +142,7 @@ func (pool Pool) numSharesOutFromTokensInStableSwap(tokensIn sdk.Coins) ( if err != nil { return } - D1 := sdk.NewInt(int64(newD.Uint64())) + D1 := sdkmath.NewInt(int64(newD.Uint64())) if D1.LT(D0) { // Should not happen err = ErrInvariantLowerAfterJoining @@ -175,11 +176,11 @@ func (pool Pool) TokensOutFromPoolSharesIn(numSharesIn sdkmath.Int) ( return nil, nil, errors.New("num shares in must be greater than zero") } - shareRatio := sdk.NewDecFromInt(numSharesIn).QuoInt(pool.TotalShares.Amount) + shareRatio := sdkmath.LegacyNewDecFromInt(numSharesIn).QuoInt(pool.TotalShares.Amount) if shareRatio.IsZero() { return nil, nil, errors.New("share ratio must be greater than zero") } - if shareRatio.GT(sdk.OneDec()) { + if shareRatio.GT(sdkmath.LegacyOneDec()) { return nil, nil, errors.New("share ratio cannot be greater than one") } @@ -190,7 +191,7 @@ func (pool Pool) TokensOutFromPoolSharesIn(numSharesIn sdkmath.Int) ( // tokenOut = shareRatio * poolTokenAmt * (1 - exitFee) tokenAmount := shareRatio.MulInt(coin.Amount) tokenOutAmt := tokenAmount.Mul( - sdk.OneDec().Sub(pool.PoolParams.ExitFee), + sdkmath.LegacyOneDec().Sub(pool.PoolParams.ExitFee), ).TruncateInt() tokensOut[i] = sdk.NewCoin(coin.Denom, tokenOutAmt) fees[i] = sdk.NewCoin(coin.Denom, tokenAmount.TruncateInt().Sub(tokenOutAmt)) @@ -205,10 +206,12 @@ Compute the minimum number of shares a user need to provide to get at least one func (pool Pool) MinSharesInForTokensOut() (minShares sdkmath.Int) { poolLiquidity := pool.PoolBalances() - minShares = sdk.ZeroInt() + minShares = sdkmath.ZeroInt() for _, coin := range poolLiquidity { - shareRatio := sdk.MustNewDecFromStr("2").Quo(sdk.NewDecFromInt(coin.Amount).Quo(sdk.OneDec().Sub(pool.PoolParams.ExitFee))) + shareRatio := sdkmath.LegacyMustNewDecFromStr("2").Quo( + sdkmath.LegacyNewDecFromInt(coin.Amount).Quo(sdkmath.LegacyOneDec().Sub(pool.PoolParams.ExitFee)), + ) shares := shareRatio.MulInt(pool.TotalShares.Amount).TruncateInt() diff --git a/x/spot/types/swap.go b/x/spot/types/swap.go index a73172b7f..7bda7c56c 100644 --- a/x/spot/types/swap.go +++ b/x/spot/types/swap.go @@ -38,16 +38,18 @@ func (pool Pool) CalcOutAmtGivenIn(tokenIn sdk.Coin, tokenOutDenom string, noFee return tokenOut, fee, err } - var tokenAmountInAfterFee sdk.Dec + var tokenAmountInAfterFee sdkmath.LegacyDec if noFee { - tokenAmountInAfterFee = sdk.NewDecFromInt(tokenIn.Amount) + tokenAmountInAfterFee = sdkmath.LegacyNewDecFromInt(tokenIn.Amount) } else { - tokenAmountInAfterFee = sdk.NewDecFromInt(tokenIn.Amount).Mul(sdk.OneDec().Sub(pool.PoolParams.SwapFee)) + tokenAmountInAfterFee = sdkmath.LegacyNewDecFromInt(tokenIn.Amount).Mul( + sdkmath.LegacyOneDec().Sub(pool.PoolParams.SwapFee), + ) } - feeAmount := sdk.NewDecFromInt(tokenIn.Amount).Sub(tokenAmountInAfterFee) + feeAmount := sdkmath.LegacyNewDecFromInt(tokenIn.Amount).Sub(tokenAmountInAfterFee) fee = sdk.NewCoin(tokenIn.Denom, feeAmount.TruncateInt()) - poolTokenInBalance := sdk.NewDecFromInt(poolAssetIn.Token.Amount) + poolTokenInBalance := sdkmath.LegacyNewDecFromInt(poolAssetIn.Token.Amount) poolTokenInBalancePostSwap := poolTokenInBalance.Add(tokenAmountInAfterFee) // deduct swapfee on the in asset @@ -63,9 +65,9 @@ func (pool Pool) CalcOutAmtGivenIn(tokenIn sdk.Coin, tokenOutDenom string, noFee tokenAmountOut = math.SolveConstantProductInvariant( /*xPrior=*/ poolTokenInBalance, /*xAfter=*/ poolTokenInBalancePostSwap, - /*xWeight=*/ sdk.NewDecFromInt(poolAssetIn.Weight), - /*yPrior=*/ sdk.NewDecFromInt(poolAssetOut.Token.Amount), - /*yWeight=*/ sdk.NewDecFromInt(poolAssetOut.Weight), + /*xWeight=*/ sdkmath.LegacyNewDecFromInt(poolAssetIn.Weight), + /*yPrior=*/ sdkmath.LegacyNewDecFromInt(poolAssetOut.Token.Amount), + /*yWeight=*/ sdkmath.LegacyNewDecFromInt(poolAssetOut.Weight), ).TruncateInt() } @@ -139,22 +141,22 @@ func (pool Pool) CalcInAmtGivenOutBalancer(tokenOut sdk.Coin, tokenInDenom strin } // assuming the user wishes to withdraw 'tokenOut', the balance of 'tokenOut' post swap will be lower - poolTokenOutBalance := sdk.NewDecFromInt(poolAssetOut.Token.Amount) - poolTokenOutBalancePostSwap := poolTokenOutBalance.Sub(sdk.NewDecFromInt(tokenOut.Amount)) + poolTokenOutBalance := sdkmath.LegacyNewDecFromInt(poolAssetOut.Token.Amount) + poolTokenOutBalancePostSwap := poolTokenOutBalance.Sub(sdkmath.LegacyNewDecFromInt(tokenOut.Amount)) // (x_0)(y_0) = (x_0 + in)(y_0 - out) tokenAmountIn := math.SolveConstantProductInvariant( /*xPrior=*/ poolTokenOutBalance, /*xAfter=*/ poolTokenOutBalancePostSwap, - /*xWeight=*/ sdk.NewDecFromInt(poolAssetOut.Weight), - /*yPrior=*/ sdk.NewDecFromInt(poolAssetIn.Token.Amount), - /*yWeight=*/ sdk.NewDecFromInt(poolAssetIn.Weight), + /*xWeight=*/ sdkmath.LegacyNewDecFromInt(poolAssetOut.Weight), + /*yPrior=*/ sdkmath.LegacyNewDecFromInt(poolAssetIn.Token.Amount), + /*yWeight=*/ sdkmath.LegacyNewDecFromInt(poolAssetIn.Weight), ).Neg() // We deduct a swap fee on the input asset. The swap happens by following the invariant curve on the input * (1 - swap fee) // and then the swap fee is added to the pool. // Thus in order to give X amount out, we solve the invariant for the invariant input. However invariant input = (1 - swapfee) * trade input. // Therefore we divide by (1 - swapfee) here - tokenAmountInBeforeFee := tokenAmountIn.Quo(sdk.OneDec().Sub(pool.PoolParams.SwapFee)).Ceil().TruncateInt() + tokenAmountInBeforeFee := tokenAmountIn.Quo(sdkmath.LegacyOneDec().Sub(pool.PoolParams.SwapFee)).Ceil().TruncateInt() return sdk.NewCoin(tokenInDenom, tokenAmountInBeforeFee), nil } @@ -169,10 +171,10 @@ ret: - err: error if any */ func (pool *Pool) ApplySwap(tokenIn sdk.Coin, tokenOut sdk.Coin) (err error) { - if tokenIn.Amount.LTE(sdk.ZeroInt()) { + if tokenIn.Amount.LTE(sdkmath.ZeroInt()) { return fmt.Errorf("tokenIn (%s) cannot be zero", tokenIn.Denom) } - if tokenOut.Amount.LTE(sdk.ZeroInt()) { + if tokenOut.Amount.LTE(sdkmath.ZeroInt()) { return fmt.Errorf("tokenOut (%s) cannot be zero", tokenOut.Denom) } diff --git a/x/sudo/keeper/keeper.go b/x/sudo/keeper/keeper.go index e7474b0ee..4e9f78ac8 100644 --- a/x/sudo/keeper/keeper.go +++ b/x/sudo/keeper/keeper.go @@ -2,11 +2,12 @@ package keeper import ( "context" + storetypes "cosmossdk.io/store/types" "fmt" + "github.com/cosmos/cosmos-sdk/runtime" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/common/set" @@ -19,10 +20,19 @@ type Keeper struct { func NewKeeper( cdc codec.BinaryCodec, - storeKey types.StoreKey, + storeKey *storetypes.KVStoreKey, ) Keeper { + + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) + return Keeper{ - Sudoers: collections.NewItem(storeKey, 1, SudoersValueEncoder(cdc)), + Sudoers: collections.NewItem( + sb, + collections.NewPrefix(1), + storeKey.String(), + SudoersValueEncoder(cdc), + ), } } diff --git a/x/sudo/keeper/msg_server.go b/x/sudo/keeper/msg_server.go index ad22c3afb..86d678cea 100644 --- a/x/sudo/keeper/msg_server.go +++ b/x/sudo/keeper/msg_server.go @@ -3,11 +3,10 @@ package keeper import ( "context" "fmt" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + collcodec "cosmossdk.io/collections/codec" "github.com/NibiruChain/nibiru/x/common/set" sudotypes "github.com/NibiruChain/nibiru/x/sudo/types" @@ -79,8 +78,8 @@ func (m MsgServer) validateRootPermissions(pbSudoers sudotypes.Sudoers, msg *sud // Encoder for the Sudoers type // ———————————————————————————————————————————————————————————————————————————— -func SudoersValueEncoder(cdc codec.BinaryCodec) collections.ValueEncoder[sudotypes.Sudoers] { - return collections.ProtoValueEncoder[sudotypes.Sudoers](cdc) +func SudoersValueEncoder(cdc codec.BinaryCodec) collcodec.ValueCodec[sudotypes.Sudoers] { + return codec.CollValue[sudotypes.Sudoers](cdc) } type Sudoers struct { diff --git a/x/sudo/module.go b/x/sudo/module.go index 1e0031ad1..a86e80e26 100644 --- a/x/sudo/module.go +++ b/x/sudo/module.go @@ -147,11 +147,11 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(_ sdk.Context) {} // EndBlock executes all ABCI EndBlock logic respective to the capability module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(_ sdk.Context) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } @@ -165,10 +165,20 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // RegisterStoreDecoder implements module.AppModuleSimulation. -func (AppModule) RegisterStoreDecoder(sdk.StoreDecoderRegistry) { +func (AppModule) RegisterStoreDecoder(simtypes.StoreDecoderRegistry) { } // WeightedOperations implements module.AppModuleSimulation. func (AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return nil } + +func (am AppModule) IsOnePerModuleType() { + //TODO implement me + panic("implement me") +} + +func (am AppModule) IsAppModule() { + //TODO implement me + panic("implement me") +} diff --git a/x/tokenfactory/keeper/genesis.go b/x/tokenfactory/keeper/genesis.go index 488861333..c3328e0a2 100644 --- a/x/tokenfactory/keeper/genesis.go +++ b/x/tokenfactory/keeper/genesis.go @@ -1,7 +1,7 @@ package keeper import ( - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -30,10 +30,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { genDenoms := []types.GenesisDenom{} // iterator := k.GetAllDenomsIterator(ctx) - iter := k.Store.Denoms.Iterate(ctx, collections.Range[string]{}) + iter, _ := k.Store.Denoms.Iterate(ctx, &collections.Range[string]{}) defer iter.Close() for ; iter.Valid(); iter.Next() { - denom := iter.Value() + denom, _ := iter.Value() authorityMetadata, err := k.Store.GetDenomAuthorityMetadata( ctx, denom.String()) diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go index 98070f8a2..2b98ee4c7 100644 --- a/x/tokenfactory/keeper/grpc_query.go +++ b/x/tokenfactory/keeper/grpc_query.go @@ -33,8 +33,17 @@ func (q Querier) Params( // QueryDenoms: Returns all registered denoms for a given creator. func (k Keeper) QueryDenoms(ctx sdk.Context, creator string) []string { - iter := k.Store.Denoms.Indexes.Creator.ExactMatch(ctx, creator) - return iter.PrimaryKeys() + iter, err := k.Store.Denoms.Indexes.Creator.MatchExact(ctx, creator) + if err != nil { + pks, err := iter.PrimaryKeys() + if err == nil { + return pks + } else { + return []string{} + } + } else { + return []string{} + } } // Denoms: Returns all registered denoms for a given creator. diff --git a/x/tokenfactory/keeper/keeper.go b/x/tokenfactory/keeper/keeper.go index bc2908d16..18e0311da 100644 --- a/x/tokenfactory/keeper/keeper.go +++ b/x/tokenfactory/keeper/keeper.go @@ -2,14 +2,15 @@ package keeper import ( "fmt" + "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" tftypes "github.com/NibiruChain/nibiru/x/tokenfactory/types" ) @@ -34,29 +35,38 @@ type Keeper struct { // NewKeeper: creates a Keeper instance for the module. func NewKeeper( - storeKey storetypes.StoreKey, + storeKey *storetypes.KVStoreKey, cdc codec.BinaryCodec, bk tftypes.BankKeeper, ak tftypes.AccountKeeper, communityPoolKeeper tftypes.CommunityPoolKeeper, authority string, ) Keeper { + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) + return Keeper{ storeKey: storeKey, Store: StoreAPI{ Denoms: NewTFDenomStore(storeKey, cdc), ModuleParams: collections.NewItem( - storeKey, tftypes.KeyPrefixModuleParams, - collections.ProtoValueEncoder[tftypes.ModuleParams](cdc), + sb, + collections.NewPrefix(int(tftypes.KeyPrefixModuleParams)), + storeKey.String(), + codec.CollValue[tftypes.ModuleParams](cdc), ), creator: collections.NewKeySet[string]( - storeKey, tftypes.KeyPrefixCreator, - collections.StringKeyEncoder, + sb, + collections.NewPrefix(int(tftypes.KeyPrefixCreator)), + storeKey.String(), + collections.StringKey, ), denomAdmins: collections.NewMap[storePKType, tftypes.DenomAuthorityMetadata]( - storeKey, tftypes.KeyPrefixDenomAdmin, - collections.StringKeyEncoder, - collections.ProtoValueEncoder[tftypes.DenomAuthorityMetadata](cdc), + sb, + collections.NewPrefix(int(tftypes.KeyPrefixDenomAdmin)), + storeKey.String(), + collections.StringKey, + codec.CollValue[tftypes.DenomAuthorityMetadata](cdc), ), bankKeeper: bk, }, diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 2ef592a2e..2a11cfe6f 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -63,7 +63,7 @@ func (k Keeper) ChangeAdmin( } authData.Admin = txMsg.NewAdmin - k.Store.denomAdmins.Insert(ctx, txMsg.Denom, authData) + k.Store.denomAdmins.Set(ctx, txMsg.Denom, authData) return &types.MsgChangeAdminResponse{}, ctx.EventManager().EmitTypedEvent( &types.EventChangeAdmin{ diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index abda9991b..b7e462a7d 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/tokenfactory/keeper/store.go b/x/tokenfactory/keeper/store.go index c0d7db2bf..72718d523 100644 --- a/x/tokenfactory/keeper/store.go +++ b/x/tokenfactory/keeper/store.go @@ -1,9 +1,12 @@ package keeper import ( - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" + collindexes "cosmossdk.io/collections/indexes" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" sdkcodec "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" tftypes "github.com/NibiruChain/nibiru/x/tokenfactory/types" @@ -44,7 +47,7 @@ func (api StoreAPI) InsertDenom( api.unsafeInsertDenom(ctx, denom, admin) api.bankKeeper.SetDenomMetaData(ctx, denom.DefaultBankMetadata()) - api.denomAdmins.Insert(ctx, key, tftypes.DenomAuthorityMetadata{ + api.denomAdmins.Set(ctx, key, tftypes.DenomAuthorityMetadata{ Admin: admin, }) return nil @@ -56,10 +59,10 @@ func (api StoreAPI) unsafeInsertDenom( ctx sdk.Context, denom tftypes.TFDenom, admin string, ) { denomStr := denom.String() - api.Denoms.Insert(ctx, denomStr, denom) - api.creator.Insert(ctx, denom.Creator) + api.Denoms.Set(ctx, denomStr, denom) + api.creator.Set(ctx, denom.Creator) api.bankKeeper.SetDenomMetaData(ctx, denom.DefaultBankMetadata()) - api.denomAdmins.Insert(ctx, denomStr, tftypes.DenomAuthorityMetadata{ + api.denomAdmins.Set(ctx, denomStr, tftypes.DenomAuthorityMetadata{ Admin: admin, }) _ = ctx.EventManager().EmitTypedEvent(&tftypes.EventCreateDenom{ @@ -89,7 +92,9 @@ func (api StoreAPI) HasDenom( } func (api StoreAPI) HasCreator(ctx sdk.Context, creator string) bool { - return api.creator.Has(ctx, creator) + hasCreator, _ := api.creator.Has(ctx, creator) + return hasCreator + } // GetDenomAuthorityMetadata returns the admin (authority metadata) for a @@ -126,22 +131,31 @@ type ( // NewTFDenomStore: Creates an indexed map over token facotry denoms indexed // by creator address. func NewTFDenomStore( - storeKey storetypes.StoreKey, cdc sdkcodec.BinaryCodec, + storeKey *storetypes.KVStoreKey, cdc sdkcodec.BinaryCodec, ) collections.IndexedMap[storePKType, storeVType, IndexesTokenFactory] { - primaryKeyEncoder := collections.StringKeyEncoder - valueEncoder := collections.ProtoValueEncoder[tftypes.TFDenom](cdc) + storeService := runtime.NewKVStoreService(storeKey) + sb := collections.NewSchemaBuilder(storeService) + + primaryKeyEncoder := collections.StringKey + valueEncoder := codec.CollValue[tftypes.TFDenom](cdc) - var namespace collections.Namespace = tftypes.KeyPrefixDenom - var namespaceCreatorIdx collections.Namespace = tftypes.KeyPrefixCreatorIndexer + var namespace uint8 = tftypes.KeyPrefixDenom + var namespaceCreatorIdx uint8 = tftypes.KeyPrefixCreatorIndexer - return collections.NewIndexedMap[storePKType, storeVType]( - storeKey, namespace, primaryKeyEncoder, valueEncoder, + return *collections.NewIndexedMap[storePKType, storeVType]( + sb, + collections.NewPrefix(int(namespace)), + storeKey.String(), + primaryKeyEncoder, + valueEncoder, IndexesTokenFactory{ - Creator: collections.NewMultiIndex[string, storePKType, storeVType]( - storeKey, namespaceCreatorIdx, - collections.StringKeyEncoder, // index key (IK) - collections.StringKeyEncoder, // primary key (PK) - func(v tftypes.TFDenom) string { return v.Creator }, + Creator: *collindexes.NewMulti[string, storePKType, storeVType]( + sb, + collections.NewPrefix(int(namespaceCreatorIdx)), + storeKey.String(), + collections.StringKey, // index key (IK) + collections.StringKey, // primary key (PK) + func(pk string, v tftypes.TFDenom) (string, error) { return v.Creator, nil }, ), }, ) @@ -153,11 +167,11 @@ type IndexesTokenFactory struct { // - indexing key (IK): bech32 address of the creator of TF denom. // - primary key (PK): full TF denom of the form 'factory/{creator}/{subdenom}' // - value (V): struct version of TF denom with validate function - Creator collections.MultiIndex[string, string, storeVType] + Creator collindexes.Multi[string, string, storeVType] } -func (idxs IndexesTokenFactory) IndexerList() []collections.Indexer[string, storeVType] { - return []collections.Indexer[string, storeVType]{ - idxs.Creator, +func (idxs IndexesTokenFactory) IndexesList() []collections.Index[string, storeVType] { + return []collections.Index[string, storeVType]{ + &idxs.Creator, } } diff --git a/x/tokenfactory/keeper/store_test.go b/x/tokenfactory/keeper/store_test.go index 23c716fc1..a5a807594 100644 --- a/x/tokenfactory/keeper/store_test.go +++ b/x/tokenfactory/keeper/store_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/NibiruChain/collections" + "cosmossdk.io/collections" "github.com/NibiruChain/nibiru/x/common/testutil" diff --git a/x/tokenfactory/module.go b/x/tokenfactory/module.go index 9cc05ec99..c02fc35f0 100644 --- a/x/tokenfactory/module.go +++ b/x/tokenfactory/module.go @@ -36,8 +36,8 @@ var ( _ module.AppModuleBasic = AppModuleBasic{} _ module.AppModule = AppModule{} _ module.AppModuleSimulation = AppModule{} - _ module.BeginBlockAppModule = AppModule{} - _ module.EndBlockAppModule = AppModule{} + //_ module.BeginBlockAppModule = AppModule{} + //_ module.EndBlockAppModule = AppModule{} ) // ConsensusVersion defines the current module consensus version. @@ -152,12 +152,12 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } // BeginBlock executes all ABCI BeginBlock logic respective to the fees module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { +func (am AppModule) BeginBlock(_ sdk.Context) { } // EndBlock executes all ABCI EndBlock logic respective to the fee-share module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(_ sdk.Context) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } @@ -183,10 +183,20 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // RegisterStoreDecoder implements module.AppModuleSimulation. -func (AppModule) RegisterStoreDecoder(sdk.StoreDecoderRegistry) { +func (AppModule) RegisterStoreDecoder(simtypes.StoreDecoderRegistry) { } // WeightedOperations implements module.AppModuleSimulation. func (AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return []simtypes.WeightedOperation{} } + +func (am AppModule) IsOnePerModuleType() { + //TODO implement me + panic("implement me") +} + +func (am AppModule) IsAppModule() { + //TODO implement me + panic("implement me") +} diff --git a/x/tokenfactory/simulation/genesis.go b/x/tokenfactory/simulation/genesis.go index 40856bd06..2d26915a0 100644 --- a/x/tokenfactory/simulation/genesis.go +++ b/x/tokenfactory/simulation/genesis.go @@ -24,7 +24,7 @@ func GenDenomCreationGasConsume(r *rand.Rand) uint64 { func RandomizedGenState(simState *module.SimulationState) { var denomCreationGasConsume uint64 simState.AppParams.GetOrGenerate( - simState.Cdc, DenomCreationGasConsume, &denomCreationGasConsume, simState.Rand, + DenomCreationGasConsume, &denomCreationGasConsume, simState.Rand, func(r *rand.Rand) { denomCreationGasConsume = GenDenomCreationGasConsume(r) }, ) diff --git a/x/tokenfactory/types/codec.go b/x/tokenfactory/types/codec.go index 84be87b73..24a9d9daf 100644 --- a/x/tokenfactory/types/codec.go +++ b/x/tokenfactory/types/codec.go @@ -5,7 +5,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" ) var ( @@ -22,7 +21,8 @@ func init() { // Register all Amino interfaces and concrete types on the authz Amino codec // so that this can later be used to properly serialize MsgGrant and MsgExec // instances. - RegisterLegacyAminoCodec(authzcodec.Amino) + // TODO: check! no more Amino in authzcodec + //RegisterLegacyAminoCodec(authzcodec.Amino) } // RegisterInterfaces register implementations diff --git a/x/tokenfactory/types/expected_keepers.go b/x/tokenfactory/types/expected_keepers.go index c25e9a489..a7475fc78 100644 --- a/x/tokenfactory/types/expected_keepers.go +++ b/x/tokenfactory/types/expected_keepers.go @@ -1,46 +1,46 @@ package types import ( + "context" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) type BankKeeper interface { // Methods imported from bank should be defined here - GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool) - SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata) + GetDenomMetaData(ctx context.Context, denom string) (banktypes.Metadata, bool) + SetDenomMetaData(ctx context.Context, denomMetaData banktypes.Metadata) - GetSupply(ctx sdk.Context, denom string) sdk.Coin - HasSupply(ctx sdk.Context, denom string) bool - IterateTotalSupply(ctx sdk.Context, cb func(sdk.Coin) bool) + GetSupply(ctx context.Context, denom string) sdk.Coin + HasSupply(ctx context.Context, denom string) bool + IterateTotalSupply(ctx context.Context, cb func(sdk.Coin) bool) SendCoinsFromModuleToAccount( - ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, + ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, ) error SendCoinsFromAccountToModule( - ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, + ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, ) error - MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error SendCoins( - ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins, + ctx context.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins, ) error - HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool - GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + HasBalance(ctx context.Context, addr sdk.AccAddress, amt sdk.Coin) bool + GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin BlockedAddr(addr sdk.AccAddress) bool } type AccountKeeper interface { - SetModuleAccount(ctx sdk.Context, macc authtypes.ModuleAccountI) - GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + SetModuleAccount(ctx context.Context, macc sdk.ModuleAccountI) + GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI } // CommunityPoolKeeper defines the contract needed to be fulfilled for community pool interactions. type CommunityPoolKeeper interface { - FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error + FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error } diff --git a/x/tokenfactory/types/keys.go b/x/tokenfactory/types/keys.go index db04de34d..8219c83e3 100644 --- a/x/tokenfactory/types/keys.go +++ b/x/tokenfactory/types/keys.go @@ -1,9 +1,5 @@ package types -import ( - "github.com/NibiruChain/collections" -) - // constants const ( // module name @@ -19,7 +15,7 @@ const ( // KVStore key and mutli-index prefixes // prefix bytes for the fees persistent store const ( - KeyPrefixDenom collections.Namespace = iota + 1 + KeyPrefixDenom uint8 = iota + 1 KeyPrefixCreator KeyPrefixModuleParams KeyPrefixDenomAdmin