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

resolve wrong denom in debt auction #848

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions x/auctionsV2/keeper/auctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ func (k Keeper) CloseEnglishAuction(ctx sdk.Context, englishAuction types.Auctio
//send newly minted token((collateral)) to the user
// send debt to collector to get added
//set net fees data
err = k.tokenMint.MintNewTokensForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId, bidding.BidderAddress, englishAuction.DebtToken.Amount)
err = k.tokenMint.MintNewTokensForApp(ctx, englishAuction.AppId, englishAuction.DebtAssetId, bidding.BidderAddress, englishAuction.CollateralToken.Amount)
if err != nil {
return err
}

err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.CollateralToken))
err = k.bankKeeper.SendCoinsFromModuleToModule(ctx, auctionsV2types.ModuleName, collectortypes.ModuleName, sdk.NewCoins(englishAuction.DebtToken))
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion x/liquidationsV2/keeper/liquidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ func (k Keeper) CheckStatsForSurplusAndDebt(ctx sdk.Context, appID, assetID uint
//
// --Collateral cmst harbor
// debt harbor cmst
func (k Keeper) DebtTokenAmount(ctx sdk.Context, CollateralAssetId, DebtAssetID uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) {
func (k Keeper) DebtTokenAmount(ctx sdk.Context, DebtAssetID, CollateralAssetId uint64, lotSize, debtLotSize sdk.Int) (collateralToken, debtToken sdk.Coin) {
collateralAsset, found1 := k.asset.GetAsset(ctx, CollateralAssetId)
debtAsset, found2 := k.asset.GetAsset(ctx, DebtAssetID)
if !found1 || !found2 {
Expand Down
8 changes: 4 additions & 4 deletions x/liquidationsV2/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,12 @@ func (s *KeeperTestSuite) WasmSetCollectorLookupTableAndAuctionControlForDebt()
AppID: 2,
CollectorAssetID: 2,
SecondaryAssetID: 3,
SurplusThreshold: sdk.NewInt(10000000),
DebtThreshold: sdk.NewInt(5000000),
SurplusThreshold: sdk.NewInt(1000000000000000000),
DebtThreshold: sdk.NewInt(282078000000),
LockerSavingRate: sdk.MustNewDecFromStr("0.1"),
LotSize: sdk.NewInt(200000),
LotSize: sdk.NewInt(25000000000),
BidFactor: sdk.MustNewDecFromStr("0.01"),
DebtLotSize: sdk.NewInt(2000000),
DebtLotSize: sdk.NewInt(13157894000000),
},
},
} {
Expand Down
Loading