Skip to content

Commit

Permalink
fix: kv store issue in accounted pool module through margin call
Browse files Browse the repository at this point in the history
  • Loading branch information
kenta-elys committed Sep 1, 2023
1 parent a8d31b3 commit 827b423
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ func NewElysApp(
tokenomicsmoduletypes.StoreKey,
incentivemoduletypes.StoreKey,
burnermoduletypes.StoreKey,
accountedpoolmoduletypes.StoreKey,
ammmoduletypes.StoreKey,
parametermoduletypes.StoreKey,
marginmoduletypes.StoreKey,
accountedpoolmoduletypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, ammmoduletypes.TStoreKey)
Expand Down Expand Up @@ -815,6 +815,17 @@ func NewElysApp(
}
govKeeper.SetLegacyRouter(govRouter)

app.AccountedPoolKeeper = *accountedpoolmodulekeeper.NewKeeper(
appCodec,
keys[accountedpoolmoduletypes.StoreKey],
keys[accountedpoolmoduletypes.MemStoreKey],
app.GetSubspace(accountedpoolmoduletypes.ModuleName),
app.AmmKeeper,
app.MarginKeeper,
app.BankKeeper,
)
accountedPoolModule := accountedpoolmodule.NewAppModule(appCodec, app.AccountedPoolKeeper, app.AccountKeeper, app.BankKeeper)

app.MarginKeeper = *marginmodulekeeper.NewKeeper(
appCodec,
keys[marginmoduletypes.StoreKey],
Expand All @@ -827,17 +838,6 @@ func NewElysApp(
)
marginModule := marginmodule.NewAppModule(appCodec, app.MarginKeeper, app.AccountKeeper, app.BankKeeper)

app.AccountedPoolKeeper = *accountedpoolmodulekeeper.NewKeeper(
appCodec,
keys[accountedpoolmoduletypes.StoreKey],
keys[accountedpoolmoduletypes.MemStoreKey],
app.GetSubspace(accountedpoolmoduletypes.ModuleName),
app.AmmKeeper,
app.MarginKeeper,
app.BankKeeper,
)
accountedPoolModule := accountedpoolmodule.NewAppModule(appCodec, app.AccountedPoolKeeper, app.AccountKeeper, app.BankKeeper)

// this line is used by starport scaffolding # stargate/app/keeperDefinition

/**** IBC Routing ****/
Expand Down
1 change: 0 additions & 1 deletion x/accountedpool/keeper/invariant_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func TestCheckBalanceInvariant_InvalidBalance(t *testing.T) {
)

_, err = mk.Open(ctx, msg2)
panic(err)
require.NoError(t, err)

mtps := mk.GetAllMTPs(ctx)
Expand Down

0 comments on commit 827b423

Please sign in to comment.