Browse Source

tests: bitcoin/core check WIF exports correctly

hk-custom-address
Daniel Cousens 10 years ago
parent
commit
376c6533f1
  1. 10
      test/bitcoin.core.js

10
test/bitcoin.core.js

@ -96,17 +96,19 @@ describe('Bitcoin-core', function() {
var string = f[0]
var hex = f[1]
var params = f[2]
var network = networks.bitcoin
var network = params.isTestnet ? networks.testnet : networks.bitcoin
if (!params.isPrivkey) return
if (params.isTestnet) network = networks.testnet
var privKey = ECKey.fromWIF(string)
it('imports ' + string + ' correctly', function() {
var privKey = ECKey.fromWIF(string)
assert.equal(privKey.d.toHex(), hex)
assert.equal(privKey.pub.compressed, params.isCompressed)
})
it('exports ' + hex + ' to ' + string, function() {
assert.equal(privKey.toWIF(network), string)
})
})
})

Loading…
Cancel
Save