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... Connecting to wallet...
</div> </div>
<div ng-show="!loading"> <div ng-show="!loading">
<h2>Create new multisig wallet</h2>
<div class="row"> <div class="row">
<div class="large-6 columns"> <div class="large-6 columns">
<h3>Select total number of copayers</h3> <h3>Select total number of copayers</h3>
@ -120,7 +121,9 @@
</div> </div>
<div class="large-3 columns"> <div class="large-3 columns">
<button class="button primary expand round" type="button" <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> </div>
</div> </div>

View File

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

View File

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

View File

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