Skip to content

Add mnemonic string parsing, improve keystore/address handling, update README and tests#37

Merged
GalaxySciTech merged 2 commits into
masterfrom
codex-jnlk9p
Apr 30, 2026
Merged

Add mnemonic string parsing, improve keystore/address handling, update README and tests#37
GalaxySciTech merged 2 commits into
masterfrom
codex-jnlk9p

Conversation

@GalaxySciTech

Copy link
Copy Markdown
Owner

Motivation

  • Normalize and accept mnemonic input supplied as a single string and make mnemonic handling more robust across the codebase.
  • Improve keystore validation and address derivation to account for chain-specific address formats (EVM vs non-EVM) and network/segwit metadata.
  • Refresh documentation examples and Quick Start to match current APIs and recommended usage.

Description

  • Add MnemonicUtil.toMnemonicCodes(String) to trim, normalize whitespace, and split mnemonic sentences and update callers to use it (Identity, WalletManager, HDMnemonicKeystore, V3MnemonicKeystore).
  • Harden WalletManager keystore validation and address derivation by adding deriveAddressByChain, isBitcoinFamily, and isEvmFamily helpers and by passing chainType into keystore validation to enforce correct address checks for EVM families.
  • Replace fragile String.split(" ") usages with MnemonicUtil.toMnemonicCodes and use normalized mnemonic lists when changing passwords or deriving wallets.
  • Overhaul README.md to clarify features, supported chains, install instructions, quick-start runnable examples, security recommendations, and build/test commands.
  • Update and add unit tests to cover the new mnemonic-string parsing and WalletManager behaviors.

Testing

  • Ran the test suite with ./gradlew test and ./gradlew build in CI (Java 8/11/17 matrix); the test run completed successfully.
  • Added tests MnemonicUtilTest.toMnemonicCodes_string_shouldTrimAndNormalizeWhitespace and MnemonicUtilTest.toMnemonicCodes_string_shouldRejectBlankInput, which passed.
  • Added tests WalletManagerTest.findWalletByKeystore_ethereum_shouldReturnWallet and WalletManagerTest.findWalletByMnemonic_dogecoin_shouldReturnWallet, which passed.

Codex Task

@GalaxySciTech GalaxySciTech merged commit fee0c75 into master Apr 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant