2014-02-27 04:54:54 +01:00
|
|
|
var Wallet = require('../src/wallet.js')
|
|
|
|
var assert = require('assert')
|
|
|
|
|
|
|
|
describe('Wallet', function() {
|
|
|
|
var seed = 'crazy horse battery staple'
|
|
|
|
|
|
|
|
describe('default constructor', function() {
|
|
|
|
var wallet;
|
|
|
|
beforeEach(function() {
|
|
|
|
wallet = new Wallet(seed)
|
|
|
|
})
|
|
|
|
|
2014-02-28 07:27:31 +01:00
|
|
|
it('defaults to Bitcoin mainnet', function() {
|
2014-02-28 09:57:44 +01:00
|
|
|
assert.equal(wallet.getMasterKey().network, 'mainnet')
|
2014-02-27 04:54:54 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
it('defaults to private derivationMethod', function() {
|
|
|
|
assert.equal(wallet.derivationMethod, 'private')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('constructor options', function() {
|
|
|
|
var wallet;
|
|
|
|
beforeEach(function() {
|
2014-02-28 07:27:31 +01:00
|
|
|
wallet = new Wallet(seed, {network: 'testnet', derivationMethod: 'public'})
|
2014-02-27 04:54:54 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
it('uses the network if specified', function() {
|
2014-02-28 07:27:31 +01:00
|
|
|
assert.equal(wallet.getMasterKey().network, 'testnet')
|
2014-02-27 04:54:54 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
it('uses the derivationMethod if specified', function() {
|
|
|
|
assert.equal(wallet.derivationMethod, 'public')
|
|
|
|
})
|
|
|
|
})
|
2014-02-28 05:05:48 +01:00
|
|
|
|
2014-02-27 04:54:54 +01:00
|
|
|
})
|