m-of-n integration complete

This commit is contained in:
Manuel Araoz 2014-04-16 19:45:22 -03:00
parent b504074009
commit 9df76b90fd
4 changed files with 14 additions and 9 deletions

View File

@ -102,6 +102,7 @@
Connecting to wallet...
</div>
<div ng-show="!loading">
<h2>Create new multisig wallet</h2>
<div class="row">
<div class="large-6 columns">
<h3>Select total number of copayers</h3>
@ -120,7 +121,9 @@
</div>
<div class="large-3 columns">
<button class="button primary expand round" type="button"
ng-click="create(totalCopayers, requiredCopayers)">Create</button>
ng-click="create(totalCopayers, requiredCopayers)">
Create {{requiredCopayers}}-of-{{totalCopayers}} wallet
</button>
</div>
</div>
</div>

View File

@ -31,12 +31,17 @@ angular.module('copay.setup').controller('SetupController',
requiredCopayers: requiredCopayers,
totalCopayers: totalCopayers
};
var w = walletFactory.create();
w.on('open', function(){
var w = walletFactory.create(opts);
w.on('created', function(){
$location.path('peer');
$rootScope.wallet = w;
$rootScope.$digest();
});
w.on('openError', function(){
$scope.loading = false;
$rootScope.flashMessage = {type:'error', message: 'Wallet not found'};
$location.path('signin');
});
w.netStart();
};

View File

@ -27,12 +27,7 @@ angular.module('copay.signin').controller('SigninController',
};
$scope.create = function() {
console.log('[signin.js.42:create:]'); //TODO
$scope.loading = true;
var w = walletFactory.create();
_setupUxHandlers(w);
w.netStart();
$location.path('setup');
};
$scope.open = function(walletId) {

View File

@ -22,6 +22,8 @@ function Wallet(opts) {
self[k] = opts[k];
});
console.log('creating '+opts.requiredCopayers+' of '+opts.totalCopayers+' wallet');
this.id = opts.id || Wallet.getRandomId();
this.publicKeyRing.walletId = this.id;
this.txProposals.walletId = this.id;