Skip to content

refactor: move test constant out of production code and rename NET_CONF#6555

Open
vividctrlalt wants to merge 8 commits intotronprotocol:developfrom
vividctrlalt:develop
Open

refactor: move test constant out of production code and rename NET_CONF#6555
vividctrlalt wants to merge 8 commits intotronprotocol:developfrom
vividctrlalt:develop

Conversation

@vividctrlalt
Copy link

Summary

  • Move test-only constant TEST_CONF from production Constant.java to new TestConstants.java in the test module (framework/src/test)
  • Rename TESTNET_CONF to NET_CONF for clarity, since config.conf serves all network types (testnet, mainnet, beta)
  • Fix checkstyle: correct import order and line length violations

Changes

  • common/src/main/java/org/tron/core/Constant.java: Remove TEST_CONF, rename TESTNET_CONFNET_CONF
  • framework/src/test/java/org/tron/common/TestConstants.java: New test constants class with TEST_CONF
  • 213 test files: Update Constant.TEST_CONFTestConstants.TEST_CONF, fix import order and line length
  • 4 production files (FullNode, SolidityNode, KeystoreFactory, DynamicArgs): Update Constant.TESTNET_CONFConstant.NET_CONF

Test plan

  • Full framework test suite: BUILD SUCCESSFUL, all tests passed
  • Checkstyle: 0 warnings (import order + line length all fixed)
  • Compilation verified with zero errors

zhao and others added 8 commits February 26, 2026 01:44
- ApiUtilTest: replace Base58 address decoding with raw hex bytes to
  remove dependency on CommonParameter singleton initialization
- BaseNet: add null guards in destroy() to prevent NPE when P2P
  service fails to start due to port conflicts
The root cause of the flaky test is DecodeUtil.addressPreFixByte
being polluted by other tests using testnet config, not the test
itself. The proper fix should be in Args.clearParam() to reset
the address prefix byte.
…T_CONF

Move test-only constant TEST_CONF from production Constant.java to
a new TestConstants class in framework/src/test. Rename TESTNET_CONF
to NET_CONF for clarity since config.conf serves all network types.
Resolve merge conflicts by accepting remote changes and re-applying
our constant renames (TEST_CONF → TestConstants.TEST_CONF,
TESTNET_CONF → NET_CONF). Accept remote deletion of BaseNet.java.
Fix 6 new remote files that referenced old constant names.
Sort TestConstants import alphabetically among other imports.
Wrap lines exceeding 100 chars caused by longer constant name.
- Fix mixed full-width/half-width brackets in description and prerequisites
- Add separator in hardware table for storage options
- Fix incorrect Shasta link text (shastaex.io -> shasta.tronex.io)
- Unify Resources section with consistent description format
- Replace Gitter badge with Discord badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add GitHub Actions workflow that runs on PRs to develop and release
branches with four jobs: PR title/description lint, compilation check,
checkstyle validation for framework and plugins modules, and unit
tests with artifact upload on failure.
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.

1 participant