UNIT TEST PROTOCOL
hd_wallet.js
www/js/crypto/HDWallet/hd_wallet.js · tests/jest/unit/wallet/hd_wallet.test.js
📁
www/js/crypto/HDWallet/
📝 Génération de wallets HD (BIP32/BIP44) multi-blockchain depuis une entropie hex + UUID sel.
37
Tests
37
Passing
0
Skipped
10
Suites
▸
HDWallet Initialization
InitializeWallet creates null wallet with correct structure
NULL_BLOCKCHAIN, Null-NET, Null-UUID, BIP32_PROTOCOL=44, Null-ADDRESS, Null-MNEMONICS
pass
▸
Error Handling
throws error when entropy_hex is undefined
pass
throws error when entropy_hex is empty string
pass
throws error when salt_uuid is undefined
pass
throws error when salt_uuid is empty string
pass
▸
Bitcoin HD Wallet (BIP44)
generates a valid Bitcoin HD wallet
pass
has valid Bitcoin address (toBeValidBitcoinAddress)
pass
has valid private key (64 hex chars)
pass
has valid WIF (toBeValidWIF)
pass
has valid mnemonic phrase
pass
has correct derivation path (m/44'/0'/0'/0/0')
pass
has coin type information (BTC, coinType=0)
pass
▸
Ethereum HD Wallet (BIP44)
generates a valid Ethereum HD wallet
pass
has valid Ethereum address
pass
has valid private key
pass
has valid mnemonic phrase
pass
has correct derivation path (m/44'/60'/0'/0/0')
pass
has coin type information (ETH, coinType=60)
pass
▸
Multi-Blockchain (Litecoin, Dogecoin, Solana, Cardano…)
Litecoin — valid address and private key
pass
Dogecoin — valid address and private key
pass
Solana — valid address (Base58) and 128-char private key
pass
Cardano — valid address and private key
pass
Stellar — valid address and WIF-format key
pass
▸
BIP Protocol Variants
different accounts generate different addresses
pass
BIP44 protocol generates valid addresses
pass
▸
BIP32 Passphrase Support
generates different addresses with different passphrases
pass
wallet with passphrase stores passphrase field
pass
wallet without passphrase does not store passphrase field
pass
▸
Default Values
uses default values when only blockchain and crypto_net given
pass
defaults to Bitcoin when no blockchain specified
pass
defaults to BIP44 when no protocol specified
pass
defaults to account 0 and address_index 0
pass
▸
Cross-Blockchain Consistency
same entropy generates same mnemonic for all blockchains
pass
same entropy generates different addresses for different blockchains
pass
all HD wallets have HD_WALLET_TYPE mode
pass
▸
Testnet Support
generates Bitcoin testnet HD wallet
pass
generates Ethereum testnet HD wallet
pass