From c6593f1a70ab1d5aa5440c04f073e2398f29d86f Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 23 Oct 2015 16:24:04 -0400 Subject: [PATCH 1/2] Update coveralls. --- .coveralls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coveralls.yml b/.coveralls.yml index 3a0646a..042007d 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1 +1 @@ -repo_token: DPmQxVTui2krriKgoXsUS4ahhOAEY6Ron +repo_token: 5ki6iPbGaiwHzIwcfNDzTXoiqAcffqUQs From d3a8926bd9b54bae494903414d04fb2650daafd6 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 27 Oct 2015 14:34:07 -0400 Subject: [PATCH 2/2] Correct millis unit typo. --- lib/unit.js | 4 ++-- test/unit.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/unit.js b/lib/unit.js index c2bedfa..b5dee29 100644 --- a/lib/unit.js +++ b/lib/unit.js @@ -95,7 +95,7 @@ Unit.fromBTC = function(amount) { * @param {Number} amount - The amount in mBTC * @returns {Unit} A Unit instance */ -Unit.fromMilis = function(amount) { +Unit.fromMillis = Unit.fromMilis = function(amount) { return new Unit(amount, Unit.mBTC); }; @@ -173,7 +173,7 @@ Unit.prototype.toBTC = function() { * * @returns {Number} The value converted to mBTC */ -Unit.prototype.toMilis = function() { +Unit.prototype.toMillis = Unit.prototype.toMilis = function() { return this.to(Unit.mBTC); }; diff --git a/test/unit.js b/test/unit.js index bf10628..5668e45 100644 --- a/test/unit.js +++ b/test/unit.js @@ -49,6 +49,9 @@ describe('Unit', function() { unit = Unit.fromMilis('1.00001'); unit.mBTC.should.equal(1.00001); + unit = Unit.fromMillis('1.00001'); + unit.mBTC.should.equal(1.00001); + unit = Unit.fromBits('100'); unit.bits.should.equal(100); @@ -136,6 +139,7 @@ describe('Unit', function() { var unit = new Unit(1.3, 'BTC'); unit.toBTC().should.equal(unit.BTC); unit.toMilis().should.equal(unit.mBTC); + unit.toMillis().should.equal(unit.mBTC); unit.toBits().should.equal(unit.bits); unit.toSatoshis().should.equal(unit.satoshis); });