bitcoinjs-lib/test/wallet.js
Wei Lu 09ee406106 Revert "Merge pull request #27 from xnova/master"
due to broken tests, moved the changes to branch hd-testnet-support

This reverts commit a4ba59e9ba, reversing
changes made to 36d3d6ebaa.
2014-02-28 11:52:19 +08:00

36 lines
955 B
JavaScript

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)
})
it('defaults to Bitcoin network', function() {
assert.equal(wallet.getMasterKey().network, 'Bitcoin')
})
it('defaults to private derivationMethod', function() {
assert.equal(wallet.derivationMethod, 'private')
})
})
describe('constructor options', function() {
var wallet;
beforeEach(function() {
wallet = new Wallet(seed, {network: 'Test', derivationMethod: 'public'})
})
it('uses the network if specified', function() {
assert.equal(wallet.getMasterKey().network, 'Test')
})
it('uses the derivationMethod if specified', function() {
assert.equal(wallet.derivationMethod, 'public')
})
})
})