Skip to content

Commit 03b815a

Browse files
authored
Better claim validation (#333)
1 parent 675073d commit 03b815a

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Contains all the PRs that improved the code without changing the behaviors.
4949
- Fixed fee stuck in arkeo module by moving fees to arkeo-reserve
5050
- Fixed signature replay on different network
5151
- Fixed informational issues
52+
- Fixed claim validation
5253

5354
---
5455

x/claim/keeper/msg_server_claim_eth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (k msgServer) ClaimEth(goCtx context.Context, msg *types.MsgClaimEth) (*typ
2424
return nil, errors.Wrapf(err, "failed to get claim record for %s", msg.EthAddress)
2525
}
2626

27-
if ethClaim.IsEmpty() || ethClaim.AmountClaim.IsZero() {
27+
if ethClaim.IsEmpty() || (ethClaim.AmountClaim.IsZero() && ethClaim.AmountVote.IsZero() && ethClaim.AmountDelegate.IsZero()) {
2828
return nil, errors.Wrapf(types.ErrNoClaimableAmount, "no claimable amount for %s", msg.EthAddress)
2929
}
3030
totalAmountClaimable := getInitialClaimableAmountTotal(ethClaim)

x/claim/keeper/msg_server_transfer_claim.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (k msgServer) TransferClaim(goCtx context.Context, msg *types.MsgTransferCl
1818
return nil, errors.Wrapf(err, "failed to get claim record for %s", msg.Creator)
1919
}
2020

21-
if originalClaim.IsEmpty() || originalClaim.AmountClaim.IsZero() {
21+
if originalClaim.IsEmpty() || (originalClaim.AmountClaim.IsZero() && originalClaim.AmountVote.IsZero() && originalClaim.AmountDelegate.IsZero()) {
2222
return nil, errors.Wrapf(types.ErrNoClaimableAmount, "no claimable amount for %s", msg.Creator)
2323
}
2424

0 commit comments

Comments
 (0)