rm getAddress

This commit is contained in:
Daniel Cousens 2018-05-22 17:43:25 +10:00
parent 4ed1a49dc5
commit c2a5d9dc1a
9 changed files with 115 additions and 92 deletions
test/integration

View file

@ -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 = {