UNIT TEST PROTOCOL

bip38_utils.js

www/js/crypto/bip38_utils.js  ·  tests/jest/unit/crypto/bip38_utils.test.js
📁 www/js/crypto/
📝 Chiffrement/déchiffrement BIP38 (méthode Non-EC) d'une clé privée Bitcoin par passphrase.
37
Tests
37
Passing
0
Skipped
3
Suites
Singleton Pattern
Bip38Utils.This returns a defined instance
pass
Bip38Utils.This always returns the same instance
pass
direct constructor call throws a TypeError
pass
instance exposes encrypt method
pass
instance exposes decrypt method
pass
instance exposes getMainWindow method
pass
encrypt()
returns a non-empty string for valid private key and passphrase
pass
returns a string starting with "6P" (BIP38 Non-EC prefix)
pass
forwards the private key buffer to the bip38 library
pass
forwards the passphrase to the bip38 library
pass
accepts a private key with 0x prefix
pass
produces consistent result for different valid private keys
pass
returns empty string when private_key is undefined
pass
returns empty string when private_key is empty string
pass
returns empty string when passphrase is undefined
pass
returns empty string when passphrase is empty string
pass
returns empty string when both args are undefined
pass
does not call bip38.encrypt when private_key is empty
pass
does not call bip38.encrypt when passphrase is empty
pass
returns ERROR_RETURN_VALUE when bip38.encrypt throws
pass
calls dialog.showMessageBoxSync on encrypt error
pass
passes a progress callback as 4th argument to bip38.encrypt
pass
passes scryptParams as 5th argument to bip38.encrypt
pass
decrypt()
returns a non-empty string for valid encrypted key and passphrase
pass
returns a valid 64-character hex private key
pass
returns the correct private key for the spec test vector
pass
forwards the encrypted key to the bip38 library
pass
forwards the passphrase to the bip38 library
pass
returns empty string when encrypted_pk is undefined
pass
returns empty string when encrypted_pk is empty string
pass
returns empty string when passphrase is undefined
pass
returns empty string when passphrase is empty string
pass
returns empty string when both args are undefined
pass
does not call bip38.decrypt when encrypted_pk is empty
pass
does not call bip38.decrypt when passphrase is empty
pass
returns ERROR_RETURN_VALUE when bip38.decrypt throws
pass
calls dialog.showMessageBoxSync on decrypt error
pass