diff --git a/concat.sh b/concat.sh new file mode 100755 index 000000000..f747c6684 --- /dev/null +++ b/concat.sh @@ -0,0 +1,7 @@ +#! /bin/bash + +cd vendor/ +cat browser-adapter.js crypto-2.0.js crypto-3.1.js jsbn.js jsbn2.js prng4.js util.js rng.js ec.js sec.js ecdsa.js eckey.js > vendor-bundle.js +mv vendor-bundle.js ../ +cd ../ + diff --git a/copay.js b/copay.js new file mode 100644 index 000000000..84ac2137c --- /dev/null +++ b/copay.js @@ -0,0 +1,5 @@ + +module.exports.Storage = require('./js/models/Storage'); +module.exports.PublicKeyRing = require('./js/models/PublicKeyRing'); + +module.exports.FakeStorage = require('./test/FakeStorage'); diff --git a/index.html b/index.html index 849968164..c189e16e2 100644 --- a/index.html +++ b/index.html @@ -213,12 +213,14 @@ + + + - diff --git a/js/models/PublicKeyRing.js b/js/models/PublicKeyRing.js index e047ecb9e..c5b043a77 100644 --- a/js/models/PublicKeyRing.js +++ b/js/models/PublicKeyRing.js @@ -12,8 +12,6 @@ var Transaction = bitcore.Transaction; var buffertools = bitcore.buffertools; var Storage = imports.Storage || require('./Storage'); -var log = imports.log || console.log; - var storage = Storage.default(); /* @@ -52,12 +50,12 @@ PublicKeyRing.getRandomId = function () { }; PublicKeyRing.decrypt = function (passphrase, encPayload) { - log('[wallet.js.35] TODO READ: passphrase IGNORED'); + console.log('[wallet.js.35] TODO READ: passphrase IGNORED'); return encPayload; }; PublicKeyRing.encrypt = function (passphrase, payload) { - log('[wallet.js.92] TODO: passphrase IGNORED'); + console.log('[wallet.js.92] TODO: passphrase IGNORED'); return payload; }; @@ -188,7 +186,7 @@ PublicKeyRing.prototype.getCopayersPubKeys = function (index, isChange) { PublicKeyRing.prototype._checkIndexRange = function (index, isChange) { if ( (isChange && index > this.changeAddressIndex) || (!isChange && index > this.addressIndex)) { - log('Out of bounds at getAddress: Index %d isChange: %d', index, isChange); + console.log('Out of bounds at getAddress: Index %d isChange: %d', index, isChange); throw new Error('index out of bound'); } }; diff --git a/js/services/network.js b/js/services/network.js index 1551345d5..9e1031bf3 100644 --- a/js/services/network.js +++ b/js/services/network.js @@ -6,6 +6,7 @@ angular.module('copay.network') $rootScope.connectedPeers = []; $rootScope.connectedTo = []; $rootScope.peerId = null; + $rootScope.publicKeyRing = []; // Array helpers var _arrayDiff = function(a, b) { diff --git a/package.json b/package.json index 39ae9613b..8e593f154 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,19 @@ }, "homepage": "https://github.com/bitpay/copay", "devDependencies": { - "grunt-cli": "~0.1.13", + "grunt-contrib-watch": "~0.5.3", + "grunt-mocha-test": "~0.8.2", + "grunt-shell": "~0.6.4", + "grunt-browserify": "~2.0.0", + "grunt-markdown": "~0.5.0", "karma": "~0.12.1", "karma-chrome-launcher": "~0.1.2", "mocha": "~1.18.2", - "karma-mocha": "~0.1.3" + "karma-mocha": "~0.1.3", + "buffertools": "~2.0.1", + "browserify": "~3.32.1", + "browser-pack": "~2.0.1", + "commander": "~2.1.0", + "uglifyify": "~1.2.3" } } diff --git a/test/index.html b/test/index.html new file mode 100644 index 000000000..d84916368 --- /dev/null +++ b/test/index.html @@ -0,0 +1,28 @@ + + +
+