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

All module remove alias and refactor code #515

Merged
merged 9 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
9 changes: 6 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,11 +840,14 @@ func New(
bandoracleModule,
liquidation.NewAppModule(app.cdc, app.LiquidationKeeper, app.AccountKeeper, app.BankKeeper),
locker.NewAppModule(app.cdc, app.LockerKeeper, app.AccountKeeper, app.BankKeeper),
collector.NewAppModule(app.cdc, app.CollectorKeeper, app.AccountKeeper, app.BankKeeper),
esm.NewAppModule(app.cdc, app.EsmKeeper, app.AccountKeeper, app.BankKeeper),
collector.NewAppModule(app.cdc, app.CollectorKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper,
app.AuctionKeeper, app.LockerKeeper, app.Rewardskeeper),
esm.NewAppModule(app.cdc, app.EsmKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper, app.VaultKeeper,
app.MarketKeeper, app.TokenmintKeeper, app.CollectorKeeper),
lend.NewAppModule(app.cdc, app.LendKeeper, app.AccountKeeper, app.BankKeeper),
wasm.NewAppModule(app.cdc, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
auction.NewAppModule(app.cdc, app.AuctionKeeper, app.AccountKeeper, app.BankKeeper),
auction.NewAppModule(app.cdc, app.AuctionKeeper, app.AccountKeeper, app.BankKeeper, app.CollectorKeeper,
app.LiquidationKeeper, app.AssetKeeper, app.MarketKeeper, app.EsmKeeper, app.VaultKeeper, app.TokenmintKeeper),
tokenmint.NewAppModule(app.cdc, app.TokenmintKeeper, app.AccountKeeper, app.BankKeeper),
liquidity.NewAppModule(app.cdc, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper),
rewards.NewAppModule(app.cdc, app.Rewardskeeper, app.AccountKeeper, app.BankKeeper),
Expand Down
259 changes: 0 additions & 259 deletions x/auction/keeper/alias.go

This file was deleted.

10 changes: 5 additions & 5 deletions x/auction/keeper/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ func (k Keeper) AddAuctionParams(ctx sdk.Context, auctionParamsBinding *bindings
}

func (k Keeper) makeFalseForFlags(ctx sdk.Context, appID, assetID uint64) error {
auctionLookupTable, found := k.GetAuctionMappingForApp(ctx, appID, assetID)
auctionLookupTable, found := k.collector.GetAuctionMappingForApp(ctx, appID, assetID)
if !found {
return auctiontypes.ErrorInvalidAddress
}

auctionLookupTable.IsAuctionActive = false
err := k.SetAuctionMappingForApp(ctx, auctionLookupTable)
err := k.collector.SetAuctionMappingForApp(ctx, auctionLookupTable)
if err != nil {
return err
}
return nil
}

func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, id uint64, rate sdk.Dec, amt sdk.Int) (price sdk.Dec, err error) {
asset, found := k.GetAsset(ctx, id)
asset, found := k.asset.GetAsset(ctx, id)
if !found {
return sdk.ZeroDec(), assettypes.ErrorAssetDoesNotExist
}
Expand All @@ -72,11 +72,11 @@ func (k Keeper) CalcDollarValueForToken(ctx sdk.Context, id uint64, rate sdk.Dec
}

func (k Keeper) GetAmountOfOtherToken(ctx sdk.Context, id1 uint64, rate1 sdk.Dec, amt1 sdk.Int, id2 uint64, rate2 sdk.Dec) (sdk.Dec, sdk.Int, error) {
asset1, found := k.GetAsset(ctx, id1)
asset1, found := k.asset.GetAsset(ctx, id1)
if !found {
return sdk.ZeroDec(), sdk.ZeroInt(), assettypes.ErrorAssetDoesNotExist
}
asset2, found := k.GetAsset(ctx, id2)
asset2, found := k.asset.GetAsset(ctx, id2)
if !found {
return sdk.ZeroDec(), sdk.ZeroInt(), assettypes.ErrorAssetDoesNotExist
}
Expand Down
Loading