adding wallet factory

This commit is contained in:
Manuel Araoz 2014-04-14 18:30:08 -03:00
commit 00d4a4b979
5 changed files with 168 additions and 93 deletions

View file

@ -1,25 +1,47 @@
'use strict';
var chai = chai || require('chai');
var should = chai.should();
var bitcore = bitcore || require('bitcore');
var copay = copay || require('../copay');
var Wallet = copay.Wallet || require('./js/models/core/Wallet');
var chai = chai || require('chai');
var should = chai.should();
var copay = copay || require('../copay');
var Wallet = require('soop').load('../js/models/core/Wallet', {
Storage: require('./FakeStorage'),
Network: copay.WebRTC,
Blockchain: copay.Insight
});
console.log(Wallet);
var config = {
wallet: {
requiredCopayers: 3,
totalCopayers: 5,
}
};
describe('Wallet model', function() {
var config = {
wallet: {
requiredCopayers: 3,
totalCopayers: 5,
}
};
var opts = {};
it('should create an instance', function () {
it.skip('should create an instance', function () {
var opts = {};
var w = new Wallet(config, opts);
var w = Wallet.create(config, opts);
should.exist(w);
});
describe('factory', function() {
it('should create the factory', function() {
should.exist(Wallet.factory);
});
it('should be able to create wallets', function() {
var w = Wallet.factory.create(config, opts);
should.exist(w);
});
it.skip('should be able to get wallets', function() {
var w = Wallet.factory.create(config, opts);
var v = Wallet.factory.get(config, w.id);
should.exist(w);
});
});
});