Browse Source
Update rng function
In case someone copy pastes, instead of getting a dangerous key, they will get a random key, and a console error.
v4
Jonathan Underwood
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
1 deletions
-
test/integration/addresses.js
|
@ -15,7 +15,14 @@ const LITECOIN = { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// deterministic RNG for testing only
|
|
|
// deterministic RNG for testing only
|
|
|
function rng () { return Buffer.from('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz') } |
|
|
function rng (c) { |
|
|
|
|
|
if (describe === undefined || it === undefined) { |
|
|
|
|
|
console.error('DO NOT USE THIS rng FUNCTION OUTSIDE OF AUTOMATED TESTING!') |
|
|
|
|
|
const randomBytes = require('randombytes') |
|
|
|
|
|
return randomBytes(c) |
|
|
|
|
|
} |
|
|
|
|
|
return Buffer.from('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
describe('bitcoinjs-lib (addresses)', function () { |
|
|
describe('bitcoinjs-lib (addresses)', function () { |
|
|
it('can generate a random address', function () { |
|
|
it('can generate a random address', function () { |
|
|