File tree Expand file tree Collapse file tree 2 files changed +0
-12
lines changed Expand file tree Collapse file tree 2 files changed +0
-12
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,6 @@ Otherwise, pull requests are appreciated.
109109Some examples interact (via HTTPS) with a 3rd Party Blockchain Provider (3PBP).
110110
111111- [ Generate a random address] ( https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L22 )
112- - [ Generate an address from a SHA256 hash] ( https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L29 )
113112- [ Import an address via WIF] ( https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L40 )
114113- [ Generate a 2-of-3 P2SH multisig address] ( https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L47 )
115114- [ Generate a SegWit address] ( https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L60 )
Original file line number Diff line number Diff line change @@ -25,17 +25,6 @@ describe('bitcoinjs-lib (addresses)', function () {
2525 assert . strictEqual ( address , '1F5VhMHukdnUES9kfXqzPzMeF1GPHKiF64' )
2626 } )
2727
28- it ( 'can generate an address from a SHA256 hash' , function ( ) {
29- const hash = bitcoin . crypto . sha256 ( Buffer . from ( 'correct horse battery staple' ) )
30-
31- const keyPair = bitcoin . ECPair . fromPrivateKey ( hash )
32- const { address } = bitcoin . payments . p2pkh ( { pubkey : keyPair . publicKey } )
33-
34- // Generating addresses from SHA256 hashes is not secure if the input to the hash function is predictable
35- // Do not use with predictable inputs
36- assert . strictEqual ( address , '1C7zdTfnkzmr13HfA2vNm5SJYRK6nEKyq8' )
37- } )
38-
3928 it ( 'can import an address via WIF' , function ( ) {
4029 const keyPair = bitcoin . ECPair . fromWIF ( 'Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct' )
4130 const { address } = bitcoin . payments . p2pkh ( { pubkey : keyPair . publicKey } )
You can’t perform that action at this time.
0 commit comments