Skip to content

Commit

Permalink
Merge pull request #636 from comdex-official/addrfix
Browse files Browse the repository at this point in the history
Address formatting fixed
  • Loading branch information
vishnukumavat authored Dec 15, 2022
2 parents 35a1222 + b543bdb commit 9e8e007
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion x/auction/keeper/debt.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ func (k Keeper) closeDebtAuction(
if err != nil {
return err
}
err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(bidding.Bidder), sdk.NewCoins(debtAuction.ExpectedUserToken))
bidder, err := sdk.AccAddressFromBech32(bidding.Bidder)
if err != nil {
panic(err)
}
err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidder, sdk.NewCoins(debtAuction.ExpectedUserToken))
if err != nil {
return err
}
Expand Down
6 changes: 5 additions & 1 deletion x/auction/keeper/dutch.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,14 @@ func (k Keeper) PlaceDutchAuctionBid(ctx sdk.Context, appID, auctionMappingID, a
// if inflow token current amount >= InflowTokenTargetAmount
if auction.InflowTokenCurrentAmount.IsGTE(auction.InflowTokenTargetAmount) {
// send left overcollateral to vault owner as target cmst reached and also
vaultHolder, err := sdk.AccAddressFromBech32(lockedVault.Owner)
if err != nil {
panic(err)
}

total := auction.OutflowTokenCurrentAmount
if total.Amount.GT(sdk.ZeroInt()) {
err := k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(lockedVault.Owner), sdk.NewCoins(total))
err := k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, vaultHolder, sdk.NewCoins(total))
if err != nil {
return err
}
Expand Down
6 changes: 5 additions & 1 deletion x/auction/keeper/dutch_lend.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,12 @@ func (k Keeper) PlaceLendDutchAuctionBid(ctx sdk.Context, appID, auctionMappingI
// if inflow token current amount >= InflowTokenTargetAmount
if auction.InflowTokenCurrentAmount.IsGTE(auction.InflowTokenTargetAmount) {
total := auction.OutflowTokenCurrentAmount
vaultHolder, err := sdk.AccAddressFromBech32(lockedVault.Owner)
if err != nil {
panic(err)
}
if total.Amount.GT(sdk.ZeroInt()) {
err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(lockedVault.Owner), sdk.NewCoins(total))
err = k.bank.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, vaultHolder, sdk.NewCoins(total))
if err != nil {
return err
}
Expand Down

0 comments on commit 9e8e007

Please sign in to comment.