Skip to content

Commit

Permalink
Merge branch 'CNS-869-iprpc-fund-tx' into CNS-871-iprpc-queries
Browse files Browse the repository at this point in the history
  • Loading branch information
oren-lava committed Mar 6, 2024
2 parents 584cf88 + b246353 commit e3ba213
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/rewards/keeper/iprpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"strconv"

"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/lavanet/lava/utils"
"github.com/lavanet/lava/x/rewards/types"
Expand Down Expand Up @@ -42,9 +43,10 @@ func (k Keeper) FundIprpc(ctx sdk.Context, creator string, duration uint64, fund
)
}
fund = fund.Sub(minIprpcFundCost)
allFunds := fund.MulInt(math.NewIntFromUint64(duration))

// send the funds to the iprpc pool
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, string(types.IprpcPoolName), fund)
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, string(types.IprpcPoolName), allFunds)
if err != nil {
return utils.LavaFormatError(types.ErrFundIprpc.Error()+"for funding iprpc pool", err,
utils.LogAttr("creator", creator),
Expand Down

0 comments on commit e3ba213

Please sign in to comment.