mirror of https://github.com/BTCPrivate/copay.git
renaming files
This commit is contained in:
parent
8f15578bb4
commit
609ba4ef71
2
API.js
2
API.js
|
@ -11,7 +11,7 @@ API.prototype._init = function(opts) {
|
|||
self.opts = opts;
|
||||
|
||||
var Wallet = require('soop').load('./js/models/core/Wallet', {
|
||||
Storage: opts.Storage || require('./test/FakeStorage'),
|
||||
Storage: opts.Storage || require('./test/mocks/FakeStorage'),
|
||||
Network: opts.Network || require('./js/models/network/WebRTC'),
|
||||
Blockchain: opts.Blockchain || require('./js/models/blockchain/Insight')
|
||||
});
|
||||
|
|
6
copay.js
6
copay.js
|
@ -7,12 +7,12 @@ module.exports.PrivateKey = require('./js/models/core/PrivateKey');
|
|||
// components
|
||||
var WebRTC = module.exports.WebRTC = require('./js/models/network/WebRTC');
|
||||
var Insight = module.exports.Insight = require('./js/models/blockchain/Insight');
|
||||
var StoragePlain = module.exports.StoragePlain = require('./js/models/storage/Plain');
|
||||
var StorageEncrypted = module.exports.StorageEncrypted = require('./js/models/storage/Encrypted');
|
||||
var StorageLocalPlain = module.exports.StorageLocalPlain = require('./js/models/storage/LocalPlain');
|
||||
var StorageLocalEncrypted = module.exports.StorageLocalEncrypted = require('./js/models/storage/LocalEncrypted');
|
||||
|
||||
module.exports.Wallet = require('soop').load('./js/models/core/Wallet',{
|
||||
Network: WebRTC,
|
||||
Blockchain: Insight,
|
||||
Storage: StoragePlain,
|
||||
Storage: StorageLocalPlain,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
var imports = require('soop').imports();
|
||||
//var buffertools = imports.buffertools || require('buffertools');
|
||||
var parent = imports.parent || require('./Plain');
|
||||
var parent = imports.parent || require('./LocalPlain');
|
||||
|
||||
var id = 0;
|
||||
function Storage() {
|
|
@ -4,7 +4,7 @@ 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'),
|
||||
Storage: require('./mocks/FakeStorage'),
|
||||
Network: copay.WebRTC,
|
||||
Blockchain: copay.Insight
|
||||
});
|
|
@ -5,19 +5,19 @@ if (typeof process === 'undefined' || !process.version) {
|
|||
var chai = chai || require('chai');
|
||||
var should = chai.should();
|
||||
var copay = copay || require('../copay');
|
||||
var Encrypted = copay.StorageEncrypted;
|
||||
var LocalEncrypted = copay.StorageLocalEncrypted;
|
||||
|
||||
describe('Storage/Encrypted model', function() {
|
||||
describe('Storage/LocalEncrypted model', function() {
|
||||
var wid = 'fake-wallet-id';
|
||||
var s = new Encrypted();
|
||||
var s = new LocalEncrypted();
|
||||
s._setPassphrase('mysupercoolpassword');
|
||||
|
||||
it('should create an instance', function() {
|
||||
var s = new Encrypted();
|
||||
var s = new LocalEncrypted();
|
||||
should.exist(s);
|
||||
});
|
||||
it('should fail when encrypting without a password', function() {
|
||||
var s = new Encrypted();
|
||||
var s = new LocalEncrypted();
|
||||
(function(){s.set(wid, 'x', 1);}).should.throw();
|
||||
});
|
||||
it('should be able to encrypt and decrypt', function() {
|
|
@ -5,12 +5,12 @@ if (typeof process === 'undefined' || !process.version) {
|
|||
var chai = chai || require('chai');
|
||||
var should = chai.should();
|
||||
var copay = copay || require('../copay');
|
||||
var Plain = copay.StoragePlain;
|
||||
var LocalPlain = copay.StorageLocalPlain;
|
||||
|
||||
describe('Storage/Plain model', function() {
|
||||
describe('Storage/LocalPlain model', function() {
|
||||
|
||||
it('should create an instance', function () {
|
||||
var s = new Plain();
|
||||
var s = new LocalPlain();
|
||||
should.exist(s);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue