Add service provider auctions #59
@ -910,10 +910,16 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype
|
||||
totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(auction.WinnerAddresses))))
|
||||
creatorLeftOverAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid))
|
||||
|
||||
creatorAddress, err := sdk.AccAddressFromBech32(auction.OwnerAddress)
|
||||
if err != nil {
|
||||
k.Logger(ctx).Error(fmt.Sprintf("Invalid creatorAddress address. %v", err))
|
||||
panic("Invalid creator address.")
|
||||
}
|
||||
|
||||
sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(
|
||||
ctx,
|
||||
auctiontypes.ModuleName,
|
||||
sdk.AccAddress(auction.OwnerAddress),
|
||||
creatorAddress,
|
||||
sdk.NewCoins(creatorLeftOverAmount),
|
||||
)
|
||||
if sdkErr != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user