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

feat: Update ConsensusUpdateTopicHandler with new custom fee functionality #15539

Draft
wants to merge 7 commits into
base: hip-991-topic-fees-create
Choose a base branch
from

Conversation

vtronkov
Copy link
Contributor

@vtronkov vtronkov commented Sep 18, 2024

Description:

Related issue(s):

Fixes #15513

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
@vtronkov vtronkov changed the title 15513 hip 991 topic fee update feat: Update ConsensusUpdateTopicHandler with new custom fee functionality Sep 18, 2024
@vtronkov vtronkov self-assigned this Sep 18, 2024
@vtronkov vtronkov added this to the v0.55 milestone Sep 18, 2024
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Copy link

codacy-production bot commented Sep 18, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 44.26%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c339784) 108899 67081 61.60%
Head commit (d204248) 108940 (+41) 67105 (+24) 61.60% (+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 (#15539) 61 27 44.26%

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 Sep 18, 2024

Codecov Report

Attention: Patch coverage is 31.14754% with 42 lines in your changes missing coverage. Please review.

Project coverage is 58.05%. Comparing base (c339784) to head (d204248).
Report is 1 commits behind head on hip-991-topic-fees-create.

Files with missing lines Patch % Lines
...sus/impl/handlers/ConsensusUpdateTopicHandler.java 30.35% 32 Missing and 7 partials ⚠️
.../impl/validators/ConsensusCustomFeesValidator.java 33.33% 2 Missing ⚠️
...sus/impl/handlers/ConsensusCreateTopicHandler.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                       Coverage Diff                       @@
##             hip-991-topic-fees-create   #15539      +/-   ##
===============================================================
- Coverage                        58.05%   58.05%   -0.01%     
- Complexity                       21535    21546      +11     
===============================================================
  Files                             2776     2776              
  Lines                           109082   109123      +41     
  Branches                         11188    11198      +10     
===============================================================
+ Hits                             63326    63346      +20     
- Misses                           41891    41908      +17     
- Partials                          3865     3869       +4     
Files with missing lines Coverage Δ
...java/com/hedera/node/config/data/TopicsConfig.java 100.00% <ø> (ø)
...sus/impl/handlers/ConsensusCreateTopicHandler.java 78.40% <50.00%> (+12.50%) ⬆️
.../impl/validators/ConsensusCustomFeesValidator.java 60.00% <33.33%> (+53.10%) ⬆️
...sus/impl/handlers/ConsensusUpdateTopicHandler.java 50.00% <30.35%> (-14.40%) ⬇️

... and 22 files with indirect coverage changes

Impacted file tree graph

Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Comment on lines -191 to -192
} else {
builder.adminKey(topic.adminKey());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the change here the builder is one to one to the topic. There is no need to copy over the values again. Also, I changed the resolvedUpdateMetaFrom method(called below) to expect ExpiryMeta instead of Topic and build the ExpiryMeta before the call. That way we don't need to pass Topic

Comment on lines -229 to -233
private void validateMaybeNewExpiry(
@NonNull final ExpiryValidator expiryValidator,
@NonNull final ConsensusUpdateTopicTransactionBody op,
@NonNull final Topic topic) {
resolvedUpdateMetaFrom(expiryValidator, op, topic);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted this method because the resolvedUpdateMetaFrom method is called twice in the handle - once from validateMaybeNewAttributes.validateMaybeNewExpiry and once from resolveMutableBuilderAttributes

Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
Signed-off-by: Valentin Tronkov <99957253+vtronkov@users.noreply.github.com>
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.

Update ConsensusUpdateTopicHandler with new custom fee functionality
1 participant