Skip to content

Commit

Permalink
another handle
Browse files Browse the repository at this point in the history
  • Loading branch information
Anil K authored and Anil K committed Oct 13, 2023
1 parent 1b40e18 commit 38fe83d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions x/claim/keeper/claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,20 @@ func (k Keeper) UpdateClaimRecord(ctx sdk.Context, claimRecord types.ClaimRecord

if len(existingClaimRecord.ClaimableAmount) != 0 {
amountInt := existingClaimRecord.ClaimableAmount[0].Amount
if amountInt.IsZero() {
newAmount := amountInt.Int64() / int643800 * int649322

newAmount := amountInt.Int64() / int643800 * int649322
fmt.Println("************ NEW AMOUNT ***************: ", newAmount)

fmt.Println("************NEW AMOUNT***************: ", newAmount)
newCoin := sdk.NewCoin(claimRecord.ClaimableAmount[0].Denom, sdk.NewInt(newAmount))

newCoin := sdk.NewCoin(claimRecord.ClaimableAmount[0].Denom, sdk.NewInt(newAmount))
effectiveAmount = newCoin.Sub(existingClaimRecord.ClaimableAmount[0])

effectiveAmount = newCoin.Sub(existingClaimRecord.ClaimableAmount[0])
fmt.Println("************ Effective Amount ***************: ", effectiveAmount)

fmt.Println("************effectiveAmount***************: ", effectiveAmount)

existingClaimRecord.ClaimableAmount = sdk.NewCoins([]sdk.Coin{newCoin}...).Add(claimRecord.ClaimableAmount...)
claimRecord = existingClaimRecord
existingClaimRecord.ClaimableAmount = sdk.NewCoins([]sdk.Coin{newCoin}...).Add(claimRecord.ClaimableAmount...)
claimRecord = existingClaimRecord
}
}

return effectiveAmount, k.SetClaimRecord(ctx, claimRecord)
Expand Down

0 comments on commit 38fe83d

Please sign in to comment.