fix: validate all entity IDs in max_custom_fees - #26840
Open
aderevets wants to merge 1 commit into
Open
Conversation
Signed-off-by: aderevets <artem.derevets@limechain.tech>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #26840 +/- ##
=========================================
Coverage 70.44% 70.44%
Complexity 11667 11667
=========================================
Files 2583 2583
Lines 108282 108290 +8
Branches 12109 12111 +2
=========================================
+ Hits 76280 76286 +6
- Misses 28020 28022 +2
Partials 3982 3982
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: 24f68ef Learn more about TestLens at testlens.app. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validates every entity ID in
max_custom_feesat precheck, not just the entry matching the payer. Applies even when the topic has no custom fees or the payer is fee exempt. Invalid IDs returnINVALID_MAX_CUSTOM_FEES.CustomFeeLimit.account_idgoes through the existingValidations.validateAccountID, plus a shard/realm check. Alias-form IDs stay valid.FixedFee.denominating_token_id, when populated, must be positive and in this network's shard/realm.Placed in
PreCheckValidator.checkMaxCustomFeesso it covers both callers:TransactionChecker(top-level and inner-batch txns) andScheduleCreateHandler(scheduled bodies). Takesshard/realmas longs rather thanHederaConfigbecausehedera-app-spirequirescom.hedera.node.confignon-transitively.TOPIC_FEE_190previously registered token0.0.0and asserted success, so it now asserts the rejection.TOPIC_FEE_199is about a collector not being charged, so its incidental invalid token was swapped for a valid one to keep the test on its own subject.Closes #26528