fix tests
This commit is contained in:
parent
37a02c37ec
commit
39b254b163
|
@ -6,5 +6,6 @@ Model.TxProposal = require('./txproposal');
|
|||
Model.Address = require('./address');
|
||||
Model.Notification = require('./notification');
|
||||
Model.Preferences = require('./preferences');
|
||||
Model.Email = require('./email');
|
||||
|
||||
module.exports = Model;
|
||||
|
|
|
@ -21,11 +21,6 @@ var BlockchainExplorer = require('./blockchainexplorer');
|
|||
|
||||
var Model = require('./model');
|
||||
var Wallet = Model.Wallet;
|
||||
var Copayer = Model.Copayer;
|
||||
var Address = Model.Address;
|
||||
var TxProposal = Model.TxProposal;
|
||||
var Notification = Model.Notification;
|
||||
var Preferences = Model.Preferences;
|
||||
|
||||
var initialized = false;
|
||||
var lock, storage, blockchainExplorer, blockchainExplorerOpts;
|
||||
|
@ -329,7 +324,7 @@ WalletService.prototype._notify = function(type, data, opts, cb) {
|
|||
|
||||
$.checkState(walletId);
|
||||
|
||||
var n = Notification.create({
|
||||
var notification = Model.Notification.create({
|
||||
type: type,
|
||||
data: data,
|
||||
ticker: this.notifyTicker++,
|
||||
|
@ -342,6 +337,7 @@ WalletService.prototype._notify = function(type, data, opts, cb) {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Joins a wallet in creation.
|
||||
* @param {Object} opts
|
||||
|
@ -380,7 +376,7 @@ WalletService.prototype.joinWallet = function(opts, cb) {
|
|||
if (wallet.copayers.length == wallet.n)
|
||||
return cb(new ClientError('WFULL', 'Wallet full'));
|
||||
|
||||
var copayer = Copayer.create({
|
||||
var copayer = Model.Copayer.create({
|
||||
name: opts.name,
|
||||
copayerIndex: wallet.copayers.length,
|
||||
xPubKey: opts.xPubKey,
|
||||
|
@ -425,7 +421,7 @@ WalletService.prototype.savePreferences = function(opts, cb) {
|
|||
opts = opts || {};
|
||||
|
||||
self._runLocked(cb, function(cb) {
|
||||
var preferences = Preferences.create({
|
||||
var preferences = Model.Preferences.create({
|
||||
walletId: self.walletId,
|
||||
copayerId: self.copayerId,
|
||||
email: opts.email,
|
||||
|
@ -746,7 +742,7 @@ WalletService.prototype.createTx = function(opts, cb) {
|
|||
|
||||
var changeAddress = wallet.createAddress(true);
|
||||
|
||||
var txp = TxProposal.create({
|
||||
var txp = Model.TxProposal.create({
|
||||
walletId: self.walletId,
|
||||
creatorId: self.copayerId,
|
||||
toAddress: opts.toAddress,
|
||||
|
|
|
@ -21,11 +21,6 @@ var Bitcore = WalletUtils.Bitcore;
|
|||
var Storage = require('../../lib/storage');
|
||||
|
||||
var Model = require('../../lib/model');
|
||||
var Wallet = Model.Wallet;
|
||||
var TxProposal = Model.TxProposal;
|
||||
var Address = Model.Address;
|
||||
var Copayer = Model.Copayer;
|
||||
var Preferences = Model.Preferences;
|
||||
|
||||
var WalletService = require('../../lib/server');
|
||||
var TestData = require('../testdata');
|
||||
|
@ -729,7 +724,7 @@ describe('Wallet service', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe.only('Preferences', function() {
|
||||
describe('Preferences', function() {
|
||||
var server, wallet;
|
||||
beforeEach(function(done) {
|
||||
helpers.createAndJoinWallet(2, 2, function(s, w) {
|
||||
|
|
Loading…
Reference in New Issue