Skip to content

Commit

Permalink
Merge pull request #848 from comdex-official/debt-test
Browse files Browse the repository at this point in the history
resolve wrong denom in debt auction
  • Loading branch information
cgsingh33 authored Oct 16, 2023
2 parents b5ccfb9 + bb7d57b commit e93cb55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit e93cb55

Please sign in to comment.