From 05779ecfbf2acc7c2862fcaa61e19f32cde10f53 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Sat, 30 Jan 2016 10:21:28 +0500 Subject: [PATCH 1/2] add travis file --- .travis.yml | 18 ++++++++++++++++++ package.json | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1c0bada --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +sudo: false +os: + - linux +language: node_js +node_js: + - "0.10" + - "0.11" + - "0.12" + - "4" + - "5" +env: + matrix: + - TEST_SUITE=unit +matrix: + include: + - node_js: "4" + env: TEST_SUITE=lint +script: npm run $TEST_SUITE diff --git a/package.json b/package.json index f69495c..79420df 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,9 @@ }, "main": "./lib/coininfo.js", "scripts": { - "test": "standard && mocha" + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "mocha" }, "dependencies": { "object-assign": "^4.0.1" From 17fbb5f761c2d11f3e744ed8dc1ccd568b4540a7 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Sat, 30 Jan 2016 10:28:53 +0500 Subject: [PATCH 2/2] fix for using with node <=0.12 --- lib/coininfo.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/coininfo.js b/lib/coininfo.js index 36a1888..1831904 100644 --- a/lib/coininfo.js +++ b/lib/coininfo.js @@ -1,3 +1,5 @@ +var assign = require('object-assign') + // annoyingly, this is for browserify var coins = [ require('./coins/blk'), @@ -55,7 +57,7 @@ coins.forEach(function (coin) { }) function toBitcoinJS () { - return Object.assign({}, this, { + return assign({}, this, { messagePrefix: null, // TODO bip32: { public: this.versions.bip32.public, @@ -71,10 +73,10 @@ function toBitcoinJS () { function toBitcore () { // reverse magic var nm = new Buffer(4) - nm.writeUInt32BE(this.protocol ? this.protocol.magic : 0) + nm.writeUInt32BE(this.protocol ? this.protocol.magic : 0, 0) nm = nm.readUInt32LE(0) - return Object.assign({}, this, { + return assign({}, this, { name: this.testnet ? 'testnet' : 'livenet', alias: this.testnet ? 'testnet' : 'mainnet', pubkeyhash: this.versions.public,