Skip to content

refactor: 25854 - clean up consensus fee tests#25965

Open
ruslanvelkov-beep wants to merge 5 commits into
hiero-ledger:mainfrom
ruslanvelkov-beep:25854-cleanup-consensus-fee-tests
Open

refactor: 25854 - clean up consensus fee tests#25965
ruslanvelkov-beep wants to merge 5 commits into
hiero-ledger:mainfrom
ruslanvelkov-beep:25854-cleanup-consensus-fee-tests

Conversation

@ruslanvelkov-beep

@ruslanvelkov-beep ruslanvelkov-beep commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description:

Redundant tests: ConsensusServiceFeesSuite.topicCreateBaseUSDFee() and AtomicConsensusServiceFeesSuite.topicCreateWithMultipleCustomFee() - 5-custom-fees create in atomic batch. Under Simple Fees the fee is a function of sigs + processing bytes only; the number of custom fees doesn't change the price.

ConsensusServiceFeesSuite contains the following tests:

  • topicCreateBaseUSDFee (mentioned above) - tests topicCreate, topicCreateWithCustomFee, topicCreateWithMultipleCustomFees. First 2 are already covered by ConsensusServiceSimpleFeesSuite.{createTopicPlainComparison, createTopicCustomFeeComparison}, the last one is tested by TopicCreateCustomFeeSimpleFeesTest.topicCreateWithMultipleCustomFees.
  • topicUpdateBaseUSDFee - covered by fees/ConsensusServiceSimpleFeesSuite.updateTopicComparison and hip1261/TopicUpdateSimpleFeesTest.
  • topicDeleteBaseUSDFee - covered by fees/ConsensusServiceSimpleFeesSuite.deleteTopicPlainComparison and consensus/TopicDeleteSuite.
  • topicSubmitMessageFeeScales - covered by hip1261/TopicSubmitMessageSimpleFeesTest (~24 cases, 50 bytes → 1024+ bytes).
  • tokenGetTopicInfoBaseUSDFee - covered by fees/ConsensusServiceSimpleFeesSuite.getTopicInfoComparison.

AtomicConsensusServiceFeesSuite contains the following tests:

  • topicCreateBaseUSDFee - covered by consensus/AtomicTopicCreateSuite.autoRenewAccountIdDoesNotNeedAdminKeyAutoRenewIsAlsoPayer{,_ECDSA,PrivateTopic} (three tests, all asserting expectedTopicCreateFullFeeUsd)
  • topicCreateWithCustomFee - covered by the newly added test consensus/AtomicTopicCreateSuite.topicCreateWithCustomFeeInBatchChargesExpectedFee.
  • topicCreateWithMultipleCustomFee (mentioned above) - no longer meaningful.
  • topicUpdateBaseUSDFee - covered by hip1261/AtomicBatchCrossServiceSimpleFeesTest (lines 596, 1214, 1263) + hip1261/AtomicBatchNegativeSimpleFeesTest (line 1009).
  • topicDeleteBaseUSDFee - covered by consensus/AtomicTopicDeleteSuite.topicDelete (validates expectedTopicDeleteFullFeeUsd).
  • topicSubmitMessageBaseUSDFee - covered by hip1261/AtomicBatchBoundarySimpleFeesTest (lines 533, 604, 1135, 1143, 1151) + hip1261/AtomicBatchCrossServiceSimpleFeesTest (lines 1220, 1269) + hip1261/AtomicBatchNegativeSimpleFeesTest (line 980)

Related issue(s):

Fixes #

Notes for reviewer:

Checklist

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

Signed-off-by: Ruslan Velkov <ruslan.velkov@limechain.tech>
@ruslanvelkov-beep ruslanvelkov-beep requested review from a team as code owners June 17, 2026 09:11
@trunk-io

trunk-io Bot commented Jun 17, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@lfdt-bot

lfdt-bot commented Jun 17, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ibankov

ibankov commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Do we have coverage for the submit message transactions deleted from the consensus test suite?

@ibankov ibankov mentioned this pull request Jun 17, 2026
2 tasks
@ruslanvelkov-beep

Copy link
Copy Markdown
Contributor Author

Do we have coverage for the submit message transactions deleted from the consensus test suite?

Updated the PR description.

ConsensusServiceFeesSuite.topicSubmitMessageFeeScales is already covered by hip1261/TopicSubmitMessageSimpleFeesTest (~24 cases, 50 bytes → 1024+ bytes).

@testlens-app

testlens-app Bot commented Jun 17, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: abf33ee
▶️ Tests: 7054 executed
⚪️ Checks: 31/31 completed


Learn more about TestLens at testlens.app.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #25965      +/-   ##
============================================
- Coverage     70.36%   70.36%   -0.01%     
+ Complexity    11823    11822       -1     
============================================
  Files          2627     2627              
  Lines        110235   110235              
  Branches      12097    12096       -1     
============================================
- Hits          77570    77565       -5     
- Misses        28663    28666       +3     
- Partials       4002     4004       +2     

see 2 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ibankov ibankov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

4 participants