Deep optimization: modernize build, fix code quality, add tests, improve CI/CD#33
Merged
GalaxySciTech merged 5 commits intomasterfrom Apr 2, 2026
Conversation
Build system: - Upgrade Gradle wrapper 5.1 → 8.5 - Migrate compile → implementation (Gradle 7+ requirement) - Replace deprecated jcenter() with mavenCentral() - Replace android-maven plugin with java-library + maven-publish - Remove broken processResources (was referencing non-existent path) - Add JUnit 5 test infrastructure - Add missing dependencies (hutool, fastjson, commons-lang3) - Add Java source/javadoc jars for publishing - Version bump to 1.3.0 Code quality: - WalletManager: Hashtable → ConcurrentHashMap for thread safety - WalletManager: reuse ObjectMapper instances (avoid allocation per call) - WalletManager: fix NPE in scanWallets when directory is empty - WalletManager: fix NPE in deleteDir when dir.list() returns null - Identity: reuse shared ObjectMapper from WalletManager - Wallet: reuse ObjectMapper for keystore export - Wallet: remove unused imports (HexUtil, StandardCharsets) - TronTransaction: lazy-init ApiWrapper (avoid eager network conn) - TronTransaction: add setClient() for dependency injection - FileTransaction: remove debug System.out.println - FileTransaction: fix variable name typo (sing → sign) - HDMnemonicKeystore.Info: fix typos (spec256k1 → secp256k1, purpuse → purpose) - Internationalize error messages (Chinese → English) Co-authored-by: Galaxy <GalaxySciTech@users.noreply.github.com>
Fix bitcoinj dependency version to 0.14.7 (matching the API the code was written for; previously declared 0.16.2 which had breaking API changes and wouldn't compile). Test coverage: - NumericUtilTest: hex conversion, byte operations, BigInteger utils (18 tests) - MnemonicUtilTest: mnemonic generation, validation, entropy conversion (6 tests) - ChainTypeTest: chain type validation, constants (12 tests) - BIP44UtilTest: path generation, BTC mnemonic paths (8 tests) - MetadataTest: clone, mainnet detection, constructors (7 tests) - NetworkTest: mainnet detection, constants (4 tests) - TokenExceptionTest: message, cause propagation (2 tests) - EthereumAddressCreatorTest: address derivation from hex/bytes (3 tests) - BitcoinAddressCreatorTest: mainnet/testnet address derivation (3 tests) - AddressCreatorManagerTest: factory pattern for all chain types (7 tests) - EthereumTransactionTest: RLP encoding, signing, hash calc (4 tests) - WalletManagerTest: identity creation, wallet derivation, import, export, change password, remove wallet (12+ integration tests) Co-authored-by: Galaxy <GalaxySciTech@users.noreply.github.com>
- Add GitHub Actions workflow with Java 8/11/17 matrix - Use Gradle wrapper caching via gradle/actions - Upload test results as artifacts - Remove deprecated .travis.yml (Travis CI is EOL) Co-authored-by: Galaxy <GalaxySciTech@users.noreply.github.com>
…reum example - Update version from 1.2.7 → 1.3.0 in all integration examples - Fix Maven integration (remove bintray, correct groupId) - Fix TRON sample: use ChainType.TRON instead of ChainType.BITCOIN for TRX wallet lookup - Add Ethereum transaction signing example - Add Requirements section (Java 8+, Gradle 8.5+) - Add Running Tests and Building sections - Update CI badge from Travis to GitHub Actions - Replace hardcoded '123456' passwords with 'your_password' placeholders - Use implementation instead of compile in Gradle example Co-authored-by: Galaxy <GalaxySciTech@users.noreply.github.com>
- WalletManager.importWalletFromMnemonic: add support for TRON, FILECOIN, DASH, DOGECOIN, BCH, BSV (previously only ETH, BTC, LTC, EOS) - WalletManager.importWalletFromMnemonic: throw on unsupported chain instead of silently returning null → NPE - V3Keystore: add Filecoin support via FilecoinAddressCreator - V3Keystore: improve error message for unsupported chain types - Update .gitignore with more comprehensive patterns Co-authored-by: Galaxy <GalaxySciTech@users.noreply.github.com>
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.
Summary
Comprehensive project optimization as technical director, covering build system, code quality, testing, CI/CD, documentation, and security.
Changes
1. Build System Modernization
compile→implementation: Migrated deprecated dependency configurationjcenter(): Replaced withmavenCentral()(jcenter is read-only/EOL)android-mavenplugin with standardjava-library+maven-publishprocessResources: Was referencing non-existentsrc/main/java/resourceshutool-core,fastjson,commons-lang32. Code Quality Fixes
Hashtable→ConcurrentHashMapinWalletManagerObjectMapperinstances acrossWalletManager,Identity,Wallet(avoid per-call allocation)directory.listFiles()anddir.list()null returns inWalletManagerTronTransaction.ApiWrappernow lazy-loaded instead of eager (avoids network connection at construction)TronTransaction.setClient()for testabilityHexUtil,StandardCharsets,StringUtilsspec256k1→secp256k1,purpuse→purpose,sing→signSystem.out.printlninFileTransaction3. Test Infrastructure (96 test cases)
4. CI/CD Modernization
gradle/actions5. Documentation Overhaul
ChainType.BITCOIN→ChainType.TRON)6. Functionality & Error Handling
.gitignorewith comprehensive patternsTesting
All 96 tests pass: