Skip to content

Commit d94fd12

Browse files
committed
Better claim validation
1 parent 8a2b13b commit d94fd12

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
@@ -48,6 +48,7 @@ Contains all the PRs that improved the code without changing the behaviors.
4848
- Fixed fee stuck in arkeo module by moving fees to arkeo-reserve
4949
- Fixed signature replay on different network
5050
- Fixed informational issues
51+
- Fixed claim validation
5152

5253
---
5354

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)