-
Notifications
You must be signed in to change notification settings - Fork 143
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
feat: Airdrops with treasury and custom fee receivers #14455
feat: Airdrops with treasury and custom fee receivers #14455
Conversation
… the custom fee collector Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM TY @vtronkov
please rerun spotless |
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Oops. Done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have been a unit test that covered this aspect of handle
that, now, would fail unless fixed. Sorry I missed that earlier. Not too late to add unit tests to TokenAirdropHandlerTest
. (Especially if refactored according to comments below.)
boolean shouldExecuteCryptoTransfer = false; | ||
final var transferListBuilder = TokenTransferList.newBuilder().token(tokenId); | ||
|
||
// process fungible token transfers if any | ||
if (!xfers.transfers().isEmpty()) { | ||
for (var transfer : xfers.transfers()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving this entire loop into a method - or the body of the loop (or both). Would make it possible to unit test.
Same at L222-227 for nfts.
This method handle
is incredibly complex - far too complex for reasonable testing. THis code here is a loop in a conditional in a loop. 140 lines in one method ... not a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but since this method is implemented in #14279 - we will refactor it there 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, ok! thank you!
...-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenAirdropHandler.java
Outdated
Show resolved
Hide resolved
...-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenAirdropHandler.java
Outdated
Show resolved
Hide resolved
...-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenAirdropHandler.java
Outdated
Show resolved
Hide resolved
Node: Unit Test Results 1 546 files 1 546 suites 3h 25m 56s ⏱️ For more details on these failures, see this check. Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Node Death Reconnect) Results3 tests 3 ✅ 5m 1s ⏱️ Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Token) Results 22 files 22 suites 7m 0s ⏱️ Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Restart) Results7 files 7 suites 8m 50s ⏱️ Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Crypto) Results 32 files 32 suites 15m 44s ⏱️ For more details on these failures, see this check. Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Misc) Results 61 files 61 suites 16m 1s ⏱️ For more details on these failures, see this check. Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Time Consuming) Results19 tests 19 ✅ 23m 1s ⏱️ Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Node: HAPI Test (Smart Contract) Results 91 files 91 suites 25m 5s ⏱️ Results for commit 64a01b6. ♻️ This comment has been updated with latest results. |
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
...-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenAirdropHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
…ts' into 14423-14443-airdrops-with-treasury-and-custom-fee-recivers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still like to see unit tests for handle()
- but I'll assume you'll do that when you refactor that method in the base feature branch.
...-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenAirdropHandler.java
Outdated
Show resolved
Hide resolved
...-impl/src/main/java/com/hedera/node/app/service/token/impl/handlers/TokenAirdropHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…ts' into 14423-14443-airdrops-with-treasury-and-custom-fee-recivers
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
c1441cd
into
13658-add-TokenAirdropHandler-additional-tests
Description:
Related issue(s):
Fixes #14423
Fixes #14443
Fixes #14479
Fixes #14485