Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tokenClaimAirdrop throws NPE on null sender or receiver (cherry-pick) #17097

Merged

Conversation

kimbor
Copy link
Member

@kimbor kimbor commented Dec 18, 2024

Description:
When submitting a tokenClaimAirdrop transaction, if one of the PendingAirdropIds in the list has an empty senderId or receiverId then the transaction fails catastrophically. This PR fixes the problem and add unit tests and hapi tests to verify the fix.

Related issue(s):
Fixes #17095
This PR is a cherry-pick of PR #17096

…ansaction

Signed-off-by: Kim Rader <kim.rader@swirldslabs.com>
@kimbor kimbor added this to the v0.58 milestone Dec 18, 2024
@kimbor kimbor self-assigned this Dec 18, 2024
@kimbor kimbor requested review from a team as code owners December 18, 2024 00:42
@kimbor kimbor requested a review from netopyr December 18, 2024 00:42
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7ffc174) 98472 64906 65.91%
Head commit (4d707c9) 98476 (+4) 64912 (+6) 65.92% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#17097) 4 4 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.24%. Comparing base (7ffc174) to head (4d707c9).
Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop   #17097   +/-   ##
==========================================
  Coverage      64.24%   64.24%           
- Complexity     20817    20819    +2     
==========================================
  Files           2547     2547           
  Lines          95707    95711    +4     
  Branches       10014    10014           
==========================================
+ Hits           61485    61492    +7     
+ Misses         30610    30608    -2     
+ Partials        3612     3611    -1     
Files with missing lines Coverage Δ
.../token/impl/handlers/TokenClaimAirdropHandler.java 76.85% <100.00%> (+0.79%) ⬆️

... and 1 file with indirect coverage changes

Impacted file tree graph

Copy link
Member

@lukelee-sl lukelee-sl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kimbor kimbor merged commit 1128c74 into develop Dec 18, 2024
64 checks passed
@kimbor kimbor deleted the 17095-tokenClaimAirdrop-empty-sender-or-receiver-cherry-pick branch December 18, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE on tokenClaimAirdrop with AirdropId with null sender or receiver
3 participants