You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/integration/addresses.js
+10-13Lines changed: 10 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -14,20 +14,17 @@ const LITECOIN = {
14
14
wif: 0xb0
15
15
}
16
16
17
-
// deterministic RNG for testing only
18
-
functionrng(c){
19
-
if(describe===undefined||it===undefined){
20
-
console.error('DO NOT USE THIS rng FUNCTION OUTSIDE OF AUTOMATED TESTING!')
21
-
constrandomBytes=require('randombytes')
22
-
returnrandomBytes(c)
23
-
}
17
+
// deterministic random number generator for TESTING ONLY
18
+
// WARNING: DO NOT USE THIS - IT IS NOT RANDOM - it produces the same private key every time for the purposes of testing.
19
+
functionunsafeDeterministicRng(c){
20
+
if(process.env.NODE_ENV!=='TESTING-BITCOINJS')thrownewError('DO NOT USE THIS FUNCTION - IT IS NOT RANDOM - IT IS FOR TESTING ONLY - IT PRODUCES THE SAME PRIVATE KEY EVERY TIME')
0 commit comments