Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
affanv14 committed Sep 23, 2024
1 parent e69bbb7 commit 962942e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 5 additions & 6 deletions protocol/x/revshare/keeper/revshare.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,16 @@ func (k Keeper) GetAllRevShares(
return types.RevSharesForFill{}, nil
}
netFeesSubAffiliateFeesShared := new(big.Int).Sub(netFees, affiliateFeesShared)
unconditionalRevShares, err := k.getUnconditionalRevShares(ctx, netFeesSubAffiliateFeesShared)
if err != nil {
log.ErrorLogWithError(ctx, "error getting unconditional rev shares", err)
return types.RevSharesForFill{}, nil
}

if netFeesSubAffiliateFeesShared.Sign() <= 0 {
log.ErrorLog(ctx, "net fees sub affiliate fees shared is less than or equal to 0")
return types.RevSharesForFill{}, nil
}

unconditionalRevShares, err := k.getUnconditionalRevShares(ctx, netFeesSubAffiliateFeesShared)
if err != nil {
log.ErrorLogWithError(ctx, "error getting unconditional rev shares", err)
return types.RevSharesForFill{}, nil
}
marketMapperRevShares, err := k.getMarketMapperRevShare(ctx, fill.MarketId, netFeesSubAffiliateFeesShared)
if err != nil {
log.ErrorLogWithError(ctx, "error getting market mapper rev shares", err)
Expand Down
3 changes: 3 additions & 0 deletions protocol/x/revshare/keeper/revshare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ func TestKeeper_GetAllRevShares_Valid(t *testing.T) {
expectedRevSharesForFill: types.RevSharesForFill{
AllRevShares: []types.RevShare{
{
// BobAddress has 500000000000000000000000 coins staked
// via genesis. Which puts Bob at the highest tier
// and gives him a 15% taker fee share.
Recipient: constants.BobAccAddress.String(),
RevShareFeeSource: types.REV_SHARE_FEE_SOURCE_TAKER_FEE,
RevShareType: types.REV_SHARE_TYPE_AFFILIATE,
Expand Down

0 comments on commit 962942e

Please sign in to comment.