Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(refactor): improve quality of vpool code #979

Merged
merged 27 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bb02872
check if base amount is zero first
jgimeno Sep 30, 2022
9f66cfe
clean some code, and remove unused funcs
jgimeno Sep 30, 2022
3bc2392
simplify existing pool
jgimeno Sep 30, 2022
9357fec
reduce check limit function to one
jgimeno Sep 30, 2022
b1b2d68
use mark price from the pool
jgimeno Sep 30, 2022
20b559b
use the pool mark price
jgimeno Sep 30, 2022
af914c0
update keeper
jgimeno Sep 30, 2022
895fc59
move is over fluctuation limit to pool
jgimeno Sep 30, 2022
3f9f8df
add overfluctuation check into snapshot
jgimeno Sep 30, 2022
35d96bc
rename fluctuation limit ration
jgimeno Sep 30, 2022
5c642d7
add over spread ratio check
jgimeno Sep 30, 2022
dfb164b
clean more code
jgimeno Sep 30, 2022
7b309dc
move vpool from pointer to type
jgimeno Sep 30, 2022
172a291
Merge branch 'master' into feat/clean-vpool
jgimeno Oct 2, 2022
3e77319
Merge branch 'master' into feat/clean-vpool
jgimeno Oct 3, 2022
2f3c7de
move query keeper to preperty instead of wrapped
jgimeno Oct 3, 2022
e171dec
add keeper as type instead of wrap
jgimeno Oct 3, 2022
96acf9c
lint
jgimeno Oct 3, 2022
9521fa6
change variable
jgimeno Oct 5, 2022
b584ff5
use mark price in all vpool
jgimeno Oct 5, 2022
54fe49b
change SpotPrice to MarkPrice in PositionChangedEvent event
jgimeno Oct 5, 2022
462fb81
Merge remote-tracking branch 'origin/master' into feat/clean-vpool
jgimeno Oct 5, 2022
6ba8518
change GetSpotTWAP to GetMarkPriceTWAP
jgimeno Oct 5, 2022
b4bae2c
add changes based on PR
jgimeno Oct 5, 2022
ab4ad3f
linter
jgimeno Oct 5, 2022
9afd4f7
Merge branch 'master' into feat/clean-vpool
jgimeno Oct 5, 2022
aaab015
Merge remote-tracking branch 'origin/master' into feat/clean-vpool
jgimeno Oct 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#919](https://github.com/NibiruChain/nibiru/pull/919) - refactor(proto): vpool module files consistency
* MarkPriceChanged renamed to MarkPriceChangedEvent
* [#875](https://github.com/NibiruChain/nibiru/pull/875) - x/perp add MsgMultiLiquidate
* [#979](https://github.com/NibiruChain/nibiru/pull/979) - refactor and clean VPool.

### Improvements

Expand Down
4 changes: 2 additions & 2 deletions proto/perp/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ message PositionChangedEvent {
(gogoproto.nullable) = false
];

// Spot price, synonymous with mark price in this context, is the quotient of
// Mark price, synonymous with mark price in this context, is the quotient of
// the quote reserves and base reserves
string spot_price = 12 [
string mark_price = 12 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
Expand Down
4 changes: 3 additions & 1 deletion proto/vpool/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ message QueryReserveAssetsResponse {
message QueryAllPoolsRequest { }

message QueryAllPoolsResponse {
repeated VPool pools = 1;
repeated VPool pools = 1 [
(gogoproto.nullable) = false
jgimeno marked this conversation as resolved.
Show resolved Hide resolved
];
repeated PoolPrices prices = 2 [
(gogoproto.nullable) = false
];
Expand Down
8 changes: 4 additions & 4 deletions x/perp/keeper/clearing_house.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (k Keeper) afterPositionUpdate(
return err
}

spotPrice, err := k.VpoolKeeper.GetSpotPrice(ctx, pair)
markPrice, err := k.VpoolKeeper.GetMarkPrice(ctx, pair)
if err != nil {
return err
}
Expand All @@ -199,7 +199,7 @@ func (k Keeper) afterPositionUpdate(
UnrealizedPnlAfter: positionResp.UnrealizedPnlAfter,
BadDebt: sdk.NewCoin(pair.QuoteDenom(), positionResp.BadDebt.RoundInt()),
LiquidationPenalty: sdk.ZeroDec(),
SpotPrice: spotPrice,
MarkPrice: markPrice,
FundingPayment: positionResp.FundingPayment,
BlockHeight: ctx.BlockHeight(),
BlockTimeMs: ctx.BlockTime().UnixMilli(),
Expand Down Expand Up @@ -621,7 +621,7 @@ func (k Keeper) closePositionEntirely(
baseAssetDirection = vpooltypes.Direction_REMOVE_FROM_POOL
}

ExchangedNotionalValue, err := k.VpoolKeeper.SwapBaseForQuote(
exchangedNotionalValue, err := k.VpoolKeeper.SwapBaseForQuote(
ctx,
currentPosition.Pair,
baseAssetDirection,
Expand All @@ -633,7 +633,7 @@ func (k Keeper) closePositionEntirely(
return nil, err
}

positionResp.ExchangedNotionalValue = ExchangedNotionalValue
positionResp.ExchangedNotionalValue = exchangedNotionalValue
positionResp.Position = &types.Position{
TraderAddress: currentPosition.TraderAddress,
Pair: currentPosition.Pair,
Expand Down
4 changes: 2 additions & 2 deletions x/perp/keeper/clearing_house_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ func TestClosePosition(t *testing.T) {
).Return( /*quoteAssetAmount=*/ tc.newPositionNotional, nil)

mocks.mockVpoolKeeper.EXPECT().
GetSpotPrice(
GetMarkPrice(
ctx,
tc.initialPosition.Pair,
).Return(
Expand Down Expand Up @@ -1935,7 +1935,7 @@ func TestClosePosition(t *testing.T) {
UnrealizedPnlAfter: sdk.ZeroDec(),
BadDebt: sdk.NewCoin(common.Pair_BTC_NUSD.QuoteDenom(), sdk.ZeroInt()),
LiquidationPenalty: sdk.ZeroDec(),
SpotPrice: tc.newPositionNotional.Quo(tc.initialPosition.Size_.Abs()),
MarkPrice: tc.newPositionNotional.Quo(tc.initialPosition.Size_.Abs()),
FundingPayment: sdk.MustNewDecFromStr("0.02").Mul(tc.initialPosition.Size_),
TransactionFee: sdk.NewInt64Coin(tc.initialPosition.Pair.QuoteDenom(), 0),
BlockHeight: ctx.BlockHeight(),
Expand Down
2 changes: 1 addition & 1 deletion x/perp/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ uint64)
continue
}

markTwap, err := k.VpoolKeeper.GetSpotTWAP(ctx, pairMetadata.Pair, params.TwapLookbackWindow)
markTwap, err := k.VpoolKeeper.GetMarkPriceTWAP(ctx, pairMetadata.Pair, params.TwapLookbackWindow)
if err != nil {
ctx.Logger().Error("failed to fetch twap mark price", "pairMetadata.Pair", pairMetadata.Pair, "error", err)
continue
Expand Down
4 changes: 2 additions & 2 deletions x/perp/keeper/liquidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (k Keeper) ExecuteFullLiquidation(
return types.LiquidateResp{}, err
}

markPrice, err := k.VpoolKeeper.GetSpotPrice(ctx, position.Pair)
markPrice, err := k.VpoolKeeper.GetMarkPrice(ctx, position.Pair)
if err != nil {
return types.LiquidateResp{}, err
}
Expand Down Expand Up @@ -320,7 +320,7 @@ func (k Keeper) ExecutePartialLiquidation(
return types.LiquidateResp{}, err
}

markPrice, err := k.VpoolKeeper.GetSpotPrice(ctx, currentPosition.Pair)
markPrice, err := k.VpoolKeeper.GetMarkPrice(ctx, currentPosition.Pair)
if err != nil {
return types.LiquidateResp{}, err
}
Expand Down
4 changes: 2 additions & 2 deletions x/perp/keeper/liquidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func TestExecuteFullLiquidation(t *testing.T) {
require.EqualValues(t, tc.expectedPerpEFBalance, perpEFBalance)

t.Log("check emitted events")
newMarkPrice, err := vpoolKeeper.GetSpotPrice(ctx, tokenPair)
newMarkPrice, err := vpoolKeeper.GetMarkPrice(ctx, tokenPair)
require.NoError(t, err)
testutilevents.RequireHasTypedEvent(t, ctx, &types.PositionLiquidatedEvent{
Pair: tokenPair.String(),
Expand Down Expand Up @@ -352,7 +352,7 @@ func TestExecutePartialLiquidation(t *testing.T) {
)

t.Log("check emitted events")
newMarkPrice, err := vpoolKeeper.GetSpotPrice(ctx, tokenPair)
newMarkPrice, err := vpoolKeeper.GetMarkPrice(ctx, tokenPair)
require.NoError(t, err)
testutilevents.RequireHasTypedEvent(t, ctx, &types.PositionLiquidatedEvent{
Pair: tokenPair.String(),
Expand Down
10 changes: 5 additions & 5 deletions x/perp/keeper/liquidate_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestLiquidateIntoPartialLiquidation(t *testing.T) {

mocks.mockVpoolKeeper.EXPECT().IsOverSpreadLimit(ctx, common.Pair_BTC_NUSD).Return(false)
markPrice := tc.newPositionNotional.Quo(tc.initialPositionSize)
mocks.mockVpoolKeeper.EXPECT().GetSpotPrice(ctx, common.Pair_BTC_NUSD).Return(markPrice, nil)
mocks.mockVpoolKeeper.EXPECT().GetMarkPrice(ctx, common.Pair_BTC_NUSD).Return(markPrice, nil)

mocks.mockVpoolKeeper.EXPECT().
GetBaseAssetTWAP(
Expand Down Expand Up @@ -289,7 +289,7 @@ func TestLiquidateIntoFullLiquidation(t *testing.T) {
mocks.mockVpoolKeeper.EXPECT().GetMaintenanceMarginRatio(ctx, common.Pair_BTC_NUSD).Return(sdk.MustNewDecFromStr("0.0625"))
mocks.mockVpoolKeeper.EXPECT().IsOverSpreadLimit(ctx, common.Pair_BTC_NUSD).Return(false)
markPrice := tc.newPositionNotional.Quo(tc.initialPositionSize)
mocks.mockVpoolKeeper.EXPECT().GetSpotPrice(ctx, common.Pair_BTC_NUSD).Return(markPrice, nil)
mocks.mockVpoolKeeper.EXPECT().GetMarkPrice(ctx, common.Pair_BTC_NUSD).Return(markPrice, nil)

mocks.mockVpoolKeeper.EXPECT().
GetBaseAssetTWAP(
Expand Down Expand Up @@ -459,7 +459,7 @@ func TestLiquidateIntoFullLiquidationWithBadDebt(t *testing.T) {
mocks.mockVpoolKeeper.EXPECT().GetMaintenanceMarginRatio(ctx, common.Pair_BTC_NUSD).Return(sdk.MustNewDecFromStr("0.0625"))
mocks.mockVpoolKeeper.EXPECT().IsOverSpreadLimit(ctx, common.Pair_BTC_NUSD).Return(false)
markPrice := tc.newPositionNotional.Quo(tc.initialPositionSize)
mocks.mockVpoolKeeper.EXPECT().GetSpotPrice(ctx, common.Pair_BTC_NUSD).Return(markPrice, nil)
mocks.mockVpoolKeeper.EXPECT().GetMarkPrice(ctx, common.Pair_BTC_NUSD).Return(markPrice, nil)

mocks.mockVpoolKeeper.EXPECT().
GetBaseAssetTWAP(
Expand Down Expand Up @@ -952,7 +952,7 @@ func TestKeeper_ExecuteFullLiquidation(t *testing.T) {
/* skipFluctuationLimitCheck */ true,
).Return( /*quoteAssetAmount=*/ tc.baseAssetPriceInQuote, nil)
mocks.mockVpoolKeeper.EXPECT().
GetSpotPrice(ctx, common.Pair_BTC_NUSD).
GetMarkPrice(ctx, common.Pair_BTC_NUSD).
Return(sdk.OneDec(), nil)

t.Log("create and set the initial position")
Expand Down Expand Up @@ -1268,7 +1268,7 @@ func TestKeeper_ExecutePartialLiquidation(t *testing.T) {
}

mocks.mockVpoolKeeper.EXPECT().
GetSpotPrice(ctx, common.Pair_BTC_NUSD).
GetMarkPrice(ctx, common.Pair_BTC_NUSD).
Return(sdk.OneDec(), nil)

t.Log("create and set the initial position")
Expand Down
8 changes: 4 additions & 4 deletions x/perp/keeper/margin.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (k Keeper) AddMargin(
return nil, err
}

spotPrice, err := k.VpoolKeeper.GetSpotPrice(ctx, pair)
markPrice, err := k.VpoolKeeper.GetMarkPrice(ctx, pair)
if err != nil {
return nil, err
}
Expand All @@ -77,7 +77,7 @@ func (k Keeper) AddMargin(
UnrealizedPnlAfter: unrealizedPnl,
BadDebt: sdk.NewCoin(pair.QuoteDenom(), remainingMargin.BadDebt.RoundInt()), // always zero when adding margin
FundingPayment: remainingMargin.FundingPayment,
SpotPrice: spotPrice,
MarkPrice: markPrice,
BlockHeight: ctx.BlockHeight(),
BlockTimeMs: ctx.BlockTime().UnixMilli(),
LiquidationPenalty: sdk.ZeroDec(),
Expand Down Expand Up @@ -151,7 +151,7 @@ func (k Keeper) RemoveMargin(
return sdk.Coin{}, sdk.Dec{}, types.Position{}, err
}

spotPrice, err := k.VpoolKeeper.GetSpotPrice(ctx, pair)
markPrice, err := k.VpoolKeeper.GetMarkPrice(ctx, pair)
if err != nil {
return sdk.Coin{}, sdk.Dec{}, types.Position{}, err
}
Expand All @@ -173,7 +173,7 @@ func (k Keeper) RemoveMargin(
UnrealizedPnlAfter: unrealizedPnl,
BadDebt: sdk.NewCoin(pair.QuoteDenom(), remainingMargin.BadDebt.RoundInt()), // always zero when removing margin
FundingPayment: remainingMargin.FundingPayment,
SpotPrice: spotPrice,
MarkPrice: markPrice,
BlockHeight: ctx.BlockHeight(),
BlockTimeMs: ctx.BlockTime().UnixMilli(),
LiquidationPenalty: sdk.ZeroDec(),
Expand Down
2 changes: 1 addition & 1 deletion x/perp/keeper/margin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func TestRemoveMargin(t *testing.T) {
UnrealizedPnlAfter: sdk.ZeroDec(),
BadDebt: sdk.NewCoin(pair.QuoteDenom(), sdk.ZeroInt()), // always zero when adding margin
FundingPayment: sdk.ZeroDec(),
SpotPrice: sdk.MustNewDecFromStr("1.00060009"),
MarkPrice: sdk.MustNewDecFromStr("1.00060009"),
BlockHeight: ctx.BlockHeight(),
BlockTimeMs: ctx.BlockTime().UnixMilli(),
LiquidationPenalty: sdk.ZeroDec(),
Expand Down
14 changes: 7 additions & 7 deletions x/perp/keeper/margin_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func TestRemoveMargin(t *testing.T) {
t.Log("mock vpool keeper")
mocks.mockVpoolKeeper.EXPECT().ExistsPool(ctx, pair).AnyTimes().Return(true)
mocks.mockVpoolKeeper.EXPECT().GetMaintenanceMarginRatio(ctx, pair).Return(sdk.MustNewDecFromStr("0.0625"))
mocks.mockVpoolKeeper.EXPECT().GetSpotPrice(ctx, pair).Return(sdk.OneDec(), nil)
mocks.mockVpoolKeeper.EXPECT().GetMarkPrice(ctx, pair).Return(sdk.OneDec(), nil)
mocks.mockVpoolKeeper.EXPECT().GetBaseAssetPrice(
ctx,
pair,
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestRemoveMargin(t *testing.T) {
mocks.mockVpoolKeeper.EXPECT().GetMaintenanceMarginRatio(ctx, pair).Return(sdk.MustNewDecFromStr("0.0625"))
mocks.mockVpoolKeeper.EXPECT().ExistsPool(ctx, pair).Return(true)

mocks.mockVpoolKeeper.EXPECT().GetSpotPrice(ctx, pair).Return(sdk.OneDec(), nil)
mocks.mockVpoolKeeper.EXPECT().GetMarkPrice(ctx, pair).Return(sdk.OneDec(), nil)
mocks.mockVpoolKeeper.EXPECT().GetBaseAssetPrice(
ctx, pair, vpooltypes.Direction_ADD_TO_POOL, sdk.NewDec(1_000)).
Return(sdk.NewDec(1000), nil).Times(2)
Expand Down Expand Up @@ -374,7 +374,7 @@ func TestRemoveMargin(t *testing.T) {
UnrealizedPnlAfter: sdk.ZeroDec(),
BadDebt: sdk.NewCoin(pair.QuoteDenom(), sdk.ZeroInt()), // always zero when adding margin
FundingPayment: sdk.ZeroDec(),
SpotPrice: sdk.OneDec(),
MarkPrice: sdk.OneDec(),
BlockHeight: ctx.BlockHeight(),
BlockTimeMs: ctx.BlockTime().UnixMilli(),
LiquidationPenalty: sdk.ZeroDec(),
Expand Down Expand Up @@ -498,7 +498,7 @@ func TestAddMargin(t *testing.T) {

mocks.mockVpoolKeeper.EXPECT().ExistsPool(ctx, pair).Return(true)
mocks.mockVpoolKeeper.EXPECT().GetBaseAssetPrice(ctx, pair, vpooltypes.Direction_ADD_TO_POOL, sdk.NewDec(1000)).Return(sdk.NewDec(1000), nil)
mocks.mockVpoolKeeper.EXPECT().GetSpotPrice(ctx, pair).Return(sdk.OneDec(), nil)
mocks.mockVpoolKeeper.EXPECT().GetMarkPrice(ctx, pair).Return(sdk.OneDec(), nil)

t.Log("set pair metadata")
setPairMetadata(perpKeeper, ctx, types.PairMetadata{
Expand Down Expand Up @@ -550,7 +550,7 @@ func TestAddMargin(t *testing.T) {
UnrealizedPnlAfter: sdk.ZeroDec(),
BadDebt: sdk.NewCoin(pair.QuoteDenom(), sdk.ZeroInt()), // always zero when adding margin
FundingPayment: sdk.ZeroDec(),
SpotPrice: sdk.OneDec(),
MarkPrice: sdk.OneDec(),
BlockHeight: ctx.BlockHeight(),
BlockTimeMs: ctx.BlockTime().UnixMilli(),
LiquidationPenalty: sdk.ZeroDec(),
Expand All @@ -569,7 +569,7 @@ func TestAddMargin(t *testing.T) {

mocks.mockVpoolKeeper.EXPECT().ExistsPool(ctx, pair).Return(true)
mocks.mockVpoolKeeper.EXPECT().GetBaseAssetPrice(ctx, pair, vpooltypes.Direction_ADD_TO_POOL, sdk.NewDec(1000)).Return(sdk.NewDec(1000), nil)
mocks.mockVpoolKeeper.EXPECT().GetSpotPrice(ctx, pair).Return(sdk.OneDec(), nil)
mocks.mockVpoolKeeper.EXPECT().GetMarkPrice(ctx, pair).Return(sdk.OneDec(), nil)

t.Log("set pair metadata")
setPairMetadata(perpKeeper, ctx, types.PairMetadata{
Expand Down Expand Up @@ -620,7 +620,7 @@ func TestAddMargin(t *testing.T) {
UnrealizedPnlAfter: sdk.ZeroDec(),
BadDebt: sdk.NewCoin(pair.QuoteDenom(), sdk.ZeroInt()), // always zero when adding margin
FundingPayment: sdk.OneDec(),
SpotPrice: sdk.OneDec(),
MarkPrice: sdk.OneDec(),
BlockHeight: ctx.BlockHeight(),
BlockTimeMs: ctx.BlockTime().UnixMilli(),
LiquidationPenalty: sdk.ZeroDec(),
Expand Down
4 changes: 2 additions & 2 deletions x/perp/module_simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange {
func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {}

// WeightedOperations returns the all the gov module operations with their respective weights.
func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation {
return simulation.WeightedOperations(simState.AppParams, simState.Cdc, am.ak, am.bk, am.keeper)
func (am AppModule) WeightedOperations(module.SimulationState) []simtypes.WeightedOperation {
return simulation.WeightedOperations(am.ak, am.bk, am.keeper)
}
12 changes: 3 additions & 9 deletions x/perp/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"math/rand"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
Expand All @@ -20,16 +19,11 @@ import (
const defaultWeight = 100

// WeightedOperations returns all the operations from the module with their respective weights
func WeightedOperations(
appParams simtypes.AppParams,
cdc codec.JSONCodec,
ak types.AccountKeeper,
bk types.BankKeeper,
k keeper.Keeper) simulation.WeightedOperations {
func WeightedOperations(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simulation.WeightedOperations {
return simulation.WeightedOperations{
simulation.NewWeightedOperation(
defaultWeight,
SimulateMsgOpenPosition(ak, bk, k),
SimulateMsgOpenPosition(ak, bk),
),
simulation.NewWeightedOperation(
33,
Expand All @@ -47,7 +41,7 @@ func WeightedOperations(
}

// SimulateMsgOpenPosition generates a MsgOpenPosition with random values.
func SimulateMsgOpenPosition(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation {
func SimulateMsgOpenPosition(ak types.AccountKeeper, bk types.BankKeeper) simtypes.Operation {
return func(
r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
Expand Down
Loading