From 9870236650ea2bc88872f9a5dcacde6ad585f9cf Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 5 Mar 2015 12:34:17 -0300 Subject: [PATCH 1/2] add check in fromObj --- lib/credentials.js | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/credentials.js b/lib/credentials.js index 83caacb7..de12e9e9 100644 --- a/lib/credentials.js +++ b/lib/credentials.js @@ -86,6 +86,8 @@ Credentials.fromObj = function(obj) { x[k] = obj[k]; }); + $.checkState(x.version, "invalid input"); + return x; }; diff --git a/package.json b/package.json index 81b7dae1..8dc5b6eb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "bitcore-wallet-client", "description": "Client for bitcore-wallet-service", "author": "BitPay Inc", - "version": "0.0.1", + "version": "0.0.2", "keywords": [ "bitcoin", "copay", From b0e65dd29b89fa92191df9ff7284c5c243457415 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 5 Mar 2015 12:40:26 -0300 Subject: [PATCH 2/2] update check --- lib/credentials.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/credentials.js b/lib/credentials.js index de12e9e9..303bc8a0 100644 --- a/lib/credentials.js +++ b/lib/credentials.js @@ -86,7 +86,7 @@ Credentials.fromObj = function(obj) { x[k] = obj[k]; }); - $.checkState(x.version, "invalid input"); + $.checkState(x.xPrivKey || x.xPubKey, "invalid input"); return x; };