rm getAddress
This commit is contained in:
parent
4ed1a49dc5
commit
c2a5d9dc1a
9 changed files with 115 additions and 92 deletions
test/integration
|
@ -67,10 +67,18 @@ function verify (txo, callback) {
|
|||
})
|
||||
}
|
||||
|
||||
// TODO: remove
|
||||
let baddress = bitcoin.address
|
||||
let bcrypto = bitcoin.crypto
|
||||
function getAddress (node, network) {
|
||||
network = network || bitcoin.networks.bitcoin
|
||||
return baddress.toBase58Check(bcrypto.hash160(node.getPublicKeyBuffer()), network.pubKeyHash)
|
||||
}
|
||||
|
||||
function randomAddress () {
|
||||
return bitcoin.ECPair.makeRandom({
|
||||
return getAddress(bitcoin.ECPair.makeRandom({
|
||||
network: bitcoin.networks.testnet
|
||||
}).getAddress()
|
||||
}), bitcoin.networks.testnet)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue