From 7618488bc3d680715f166926f3ca46db638fbab9 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Wed, 10 Sep 2014 15:28:13 -0300 Subject: [PATCH 01/16] Fixed --- js/controllers/copayers.js | 8 +++++++- views/copayers.html | 33 ++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/js/controllers/copayers.js b/js/controllers/copayers.js index fc140593b..cf3b880cc 100644 --- a/js/controllers/copayers.js +++ b/js/controllers/copayers.js @@ -5,6 +5,12 @@ angular.module('copayApp.controllers').controller('CopayersController', $scope.hideAdv = true; + + $scope.skipBackup = function() { + var w = $rootScope.wallet; + w.setBackupReady(); + }; + $scope.backup = function() { var w = $rootScope.wallet; w.setBackupReady(); @@ -37,4 +43,4 @@ angular.module('copayApp.controllers').controller('CopayersController', return $rootScope.wallet.publicKeyRing.isBackupReady(copayer.copayerId); } - }); + }); \ No newline at end of file diff --git a/views/copayers.html b/views/copayers.html index cbd00e805..ddd2a02a5 100644 --- a/views/copayers.html +++ b/views/copayers.html @@ -51,6 +51,7 @@
+ Creating and storing a backup will allow to restore funds of the wallet
@@ -75,21 +76,23 @@
-
- + + + + + Skip Backup + +
- - - From e8190730030b8a37e077eaccb865115ab83b965b Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Thu, 11 Sep 2014 10:28:56 -0300 Subject: [PATCH 03/16] Conflicts solved --- js/models/core/Wallet.js | 2 +- test/test.Wallet.js | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 809c7aaa3..c2278b820 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -87,7 +87,7 @@ function Wallet(opts) { this.lastMessageFrom = {}; //to avoid confirmation of copayer's backups if is imported from a file - this.isImported = opts.isImported; + this.isImported = opts.isImported || false; this.paymentRequests = opts.paymentRequests || {}; diff --git a/test/test.Wallet.js b/test/test.Wallet.js index d6b765b46..983cfc076 100644 --- a/test/test.Wallet.js +++ b/test/test.Wallet.js @@ -829,6 +829,23 @@ describe('Wallet model', function() { }); }); + describe('#createTxSync', function() { + it('should fail if amount below min value', function() { + var w = cachedCreateW2(); + var utxo = createUTXO(w); + + var badCreate = function() { + w.createTxSync( + 'mgGJEugdPnvhmRuFdbdQcFfoFLc1XXeB79', + '123', + null, + utxo + ); + } + chai.expect(badCreate).to.throw('invalid amount'); + }); + }); + describe('removeTxWithSpentInputs', function() { it('should remove pending TxProposal with spent inputs', function(done) { var w = cachedCreateW2(); @@ -1533,4 +1550,4 @@ describe('Wallet model', function() { should.exist(n.networkNonce); }); -}); \ No newline at end of file +}); From 2a4b054ba129fe462a930056e19026f269197d68 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Thu, 11 Sep 2014 11:30:55 -0300 Subject: [PATCH 04/16] Solving conflicts --- test/test.Wallet.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/test/test.Wallet.js b/test/test.Wallet.js index 983cfc076..e55128119 100644 --- a/test/test.Wallet.js +++ b/test/test.Wallet.js @@ -829,23 +829,6 @@ describe('Wallet model', function() { }); }); - describe('#createTxSync', function() { - it('should fail if amount below min value', function() { - var w = cachedCreateW2(); - var utxo = createUTXO(w); - - var badCreate = function() { - w.createTxSync( - 'mgGJEugdPnvhmRuFdbdQcFfoFLc1XXeB79', - '123', - null, - utxo - ); - } - chai.expect(badCreate).to.throw('invalid amount'); - }); - }); - describe('removeTxWithSpentInputs', function() { it('should remove pending TxProposal with spent inputs', function(done) { var w = cachedCreateW2(); From 7de88f2cc813256b78f7b67c3f0535d446a91aa6 Mon Sep 17 00:00:00 2001 From: bechi Date: Thu, 11 Sep 2014 11:54:14 -0300 Subject: [PATCH 05/16] fix text color --- views/copayers.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/copayers.html b/views/copayers.html index a9c7427f9..1b7f82bdc 100644 --- a/views/copayers.html +++ b/views/copayers.html @@ -51,7 +51,7 @@
- Creating and storing a backup will allow to restore funds of the wallet +

Creating and storing a backup will allow to restore funds of the wallet

From 7095750d6fa1860ce0de57d2beae71f67e9acab7 Mon Sep 17 00:00:00 2001 From: bechi Date: Thu, 11 Sep 2014 13:01:22 -0300 Subject: [PATCH 06/16] fix style --- css/src/main.css | 2 +- views/copayers.html | 18 +++++++++--------- views/join.html | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/css/src/main.css b/css/src/main.css index bea1ac145..16d4d0d2a 100644 --- a/css/src/main.css +++ b/css/src/main.css @@ -1046,7 +1046,7 @@ a.text-warning:hover {color: #FD7262;} background: #2C3E50; -moz-box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20); box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20); - margin-bottom: 5px; + margin-bottom: 15px; } .box-setup-copay-required { diff --git a/views/copayers.html b/views/copayers.html index 1b7f82bdc..22f0749d3 100644 --- a/views/copayers.html +++ b/views/copayers.html @@ -51,7 +51,7 @@
-

Creating and storing a backup will allow to restore funds of the wallet

+

Creating and storing a backup will allow to restore funds of the wallet

@@ -75,14 +75,7 @@
-
- - Skip Backup - - - + + + Skip Backup + +
-

Creating and storing a backup will allow to restore funds of the wallet

+

Creating and storing a backup will allow to restore funds of the wallet

From 84dbcb038a0fcd1cbed63441f8fe91269aa1cb37 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Wed, 10 Sep 2014 15:28:13 -0300 Subject: [PATCH 08/16] Fixed --- js/controllers/copayers.js | 8 +++++++- views/copayers.html | 33 ++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/js/controllers/copayers.js b/js/controllers/copayers.js index fc140593b..cf3b880cc 100644 --- a/js/controllers/copayers.js +++ b/js/controllers/copayers.js @@ -5,6 +5,12 @@ angular.module('copayApp.controllers').controller('CopayersController', $scope.hideAdv = true; + + $scope.skipBackup = function() { + var w = $rootScope.wallet; + w.setBackupReady(); + }; + $scope.backup = function() { var w = $rootScope.wallet; w.setBackupReady(); @@ -37,4 +43,4 @@ angular.module('copayApp.controllers').controller('CopayersController', return $rootScope.wallet.publicKeyRing.isBackupReady(copayer.copayerId); } - }); + }); \ No newline at end of file diff --git a/views/copayers.html b/views/copayers.html index cbd00e805..ddd2a02a5 100644 --- a/views/copayers.html +++ b/views/copayers.html @@ -51,6 +51,7 @@
+ Creating and storing a backup will allow to restore funds of the wallet
@@ -75,21 +76,23 @@
-
- + + + + + Skip Backup + +
- - - From 2b540264a5631ceab159b92bd240cf0852e8baab Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Thu, 11 Sep 2014 10:28:56 -0300 Subject: [PATCH 10/16] Conflicts solved --- js/models/core/Wallet.js | 2 +- test/test.Wallet.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 358037fb7..06c2a08c5 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -87,7 +87,7 @@ function Wallet(opts) { this.lastMessageFrom = {}; //to avoid confirmation of copayer's backups if is imported from a file - this.isImported = opts.isImported; + this.isImported = opts.isImported || false; this.paymentRequests = opts.paymentRequests || {}; diff --git a/test/test.Wallet.js b/test/test.Wallet.js index c8ae349e5..94bef86f8 100644 --- a/test/test.Wallet.js +++ b/test/test.Wallet.js @@ -840,6 +840,23 @@ describe('Wallet model', function() { }); }); + describe('#createTxSync', function() { + it('should fail if amount below min value', function() { + var w = cachedCreateW2(); + var utxo = createUTXO(w); + + var badCreate = function() { + w.createTxSync( + 'mgGJEugdPnvhmRuFdbdQcFfoFLc1XXeB79', + '123', + null, + utxo + ); + } + chai.expect(badCreate).to.throw('invalid amount'); + }); + }); + describe('removeTxWithSpentInputs', function() { it('should remove pending TxProposal with spent inputs', function(done) { var w = cachedCreateW2(); From db7d33682e3c97bc9d6947c71cf2c2ebd6504e25 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Thu, 11 Sep 2014 11:30:55 -0300 Subject: [PATCH 11/16] Solving conflicts --- test/test.Wallet.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/test/test.Wallet.js b/test/test.Wallet.js index 94bef86f8..c8ae349e5 100644 --- a/test/test.Wallet.js +++ b/test/test.Wallet.js @@ -840,23 +840,6 @@ describe('Wallet model', function() { }); }); - describe('#createTxSync', function() { - it('should fail if amount below min value', function() { - var w = cachedCreateW2(); - var utxo = createUTXO(w); - - var badCreate = function() { - w.createTxSync( - 'mgGJEugdPnvhmRuFdbdQcFfoFLc1XXeB79', - '123', - null, - utxo - ); - } - chai.expect(badCreate).to.throw('invalid amount'); - }); - }); - describe('removeTxWithSpentInputs', function() { it('should remove pending TxProposal with spent inputs', function(done) { var w = cachedCreateW2(); From 778086ca1df38c5169926fcbaf169b9824c4ef3c Mon Sep 17 00:00:00 2001 From: bechi Date: Thu, 11 Sep 2014 11:54:14 -0300 Subject: [PATCH 12/16] fix text color --- views/copayers.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/copayers.html b/views/copayers.html index a9c7427f9..1b7f82bdc 100644 --- a/views/copayers.html +++ b/views/copayers.html @@ -51,7 +51,7 @@
- Creating and storing a backup will allow to restore funds of the wallet +

Creating and storing a backup will allow to restore funds of the wallet

From 7847cd5067eeff812810e8cf06bdf52eb74daa2d Mon Sep 17 00:00:00 2001 From: bechi Date: Thu, 11 Sep 2014 13:01:22 -0300 Subject: [PATCH 13/16] fix style --- css/src/main.css | 2 +- views/copayers.html | 18 +++++++++--------- views/join.html | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/css/src/main.css b/css/src/main.css index bea1ac145..16d4d0d2a 100644 --- a/css/src/main.css +++ b/css/src/main.css @@ -1046,7 +1046,7 @@ a.text-warning:hover {color: #FD7262;} background: #2C3E50; -moz-box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20); box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20); - margin-bottom: 5px; + margin-bottom: 15px; } .box-setup-copay-required { diff --git a/views/copayers.html b/views/copayers.html index 1b7f82bdc..22f0749d3 100644 --- a/views/copayers.html +++ b/views/copayers.html @@ -51,7 +51,7 @@
-

Creating and storing a backup will allow to restore funds of the wallet

+

Creating and storing a backup will allow to restore funds of the wallet

@@ -75,14 +75,7 @@
-
- - Skip Backup - - - + + + Skip Backup + +
-

Creating and storing a backup will allow to restore funds of the wallet

+

Creating and storing a backup will allow to restore funds of the wallet

From b7373367a18f431f9fa3b4e8aa9900775f7dde0a Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Fri, 12 Sep 2014 13:25:52 -0300 Subject: [PATCH 15/16] Skip avoid waiting for other copayers --- js/controllers/copayers.js | 4 ++-- js/models/core/Wallet.js | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/controllers/copayers.js b/js/controllers/copayers.js index cf3b880cc..57573b4d0 100644 --- a/js/controllers/copayers.js +++ b/js/controllers/copayers.js @@ -8,7 +8,7 @@ angular.module('copayApp.controllers').controller('CopayersController', $scope.skipBackup = function() { var w = $rootScope.wallet; - w.setBackupReady(); + w.setBackupReady(true); }; $scope.backup = function() { @@ -43,4 +43,4 @@ angular.module('copayApp.controllers').controller('CopayersController', return $rootScope.wallet.publicKeyRing.isBackupReady(copayer.copayerId); } - }); \ No newline at end of file + }); diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 06c2a08c5..c3508f539 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -89,6 +89,9 @@ function Wallet(opts) { //to avoid confirmation of copayer's backups if is imported from a file this.isImported = opts.isImported || false; + //to avoid waiting others copayers to make a backup and login immediatly + this.forcedLogin = opts.forcedLogin || false; + this.paymentRequests = opts.paymentRequests || {}; //network nonces are 8 byte buffers, representing a big endian number @@ -2430,7 +2433,7 @@ Wallet.prototype.isShared = function() { * @return {boolean} */ Wallet.prototype.isReady = function() { - var ret = this.publicKeyRing.isComplete() && (this.publicKeyRing.isFullyBackup() || this.isImported); + var ret = this.publicKeyRing.isComplete() && (this.publicKeyRing.isFullyBackup() || this.isImported || this.forcedLogin); return ret; }; @@ -2439,7 +2442,8 @@ Wallet.prototype.isReady = function() { * * Also backs up the wallet */ -Wallet.prototype.setBackupReady = function() { +Wallet.prototype.setBackupReady = function(forcedLogin) { + this.forcedLogin = forcedLogin; this.publicKeyRing.setBackupReady(); this.sendPublicKeyRing(); this.store(); From 0698c70cce5f3b2efec5fdb4a1ff907f74cbe826 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Fri, 12 Sep 2014 14:56:19 -0300 Subject: [PATCH 16/16] Conflicts fixed --- js/controllers/copayers.js | 4 ---- js/models/core/Wallet.js | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/js/controllers/copayers.js b/js/controllers/copayers.js index 5703c751e..57573b4d0 100644 --- a/js/controllers/copayers.js +++ b/js/controllers/copayers.js @@ -8,11 +8,7 @@ angular.module('copayApp.controllers').controller('CopayersController', $scope.skipBackup = function() { var w = $rootScope.wallet; -<<<<<<< HEAD w.setBackupReady(true); -======= - w.setBackupReady(); ->>>>>>> 6703652ea9d7e9e8c9a137a735b2fc2fc6de2494 }; $scope.backup = function() { diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 481719830..6b91a8b0d 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -2433,9 +2433,8 @@ Wallet.prototype.isShared = function() { * @desc Returns true if the keyring is complete and all users have backed up the wallet * @return {boolean} */ -Wallet.prototype.isReady = function() { << << << < HEAD - var ret = this.publicKeyRing.isComplete() && (this.publicKeyRing.isFullyBackup() || this.isImported || this.forcedLogin); === === = - var ret = this.publicKeyRing.isComplete() && (this.publicKeyRing.isFullyBackup() || this.isImported); >>> >>> > 6703652ea9d7e9e8c9a137a735b2fc2fc6de2494 +Wallet.prototype.isReady = function() { + var ret = this.publicKeyRing.isComplete() && (this.publicKeyRing.isFullyBackup() || this.isImported || this.forcedLogin); return ret; };