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))))
|
totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(auction.WinnerAddresses))))
|
||||||
creatorLeftOverAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid))
|
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(
|
sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(
|
||||||
ctx,
|
ctx,
|
||||||
auctiontypes.ModuleName,
|
auctiontypes.ModuleName,
|
||||||
sdk.AccAddress(auction.OwnerAddress),
|
creatorAddress,
|
||||||
sdk.NewCoins(creatorLeftOverAmount),
|
sdk.NewCoins(creatorLeftOverAmount),
|
||||||
)
|
)
|
||||||
if sdkErr != nil {
|
if sdkErr != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user