From 6e543dfb1d828727728d2ef2b29255dcb5866deb Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Fri, 23 Nov 2012 18:50:20 -0800 Subject: [PATCH] JS: Fix and another unit-test. --- src/js/amount.js | 2 +- test/amount-test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/amount.js b/src/js/amount.js index be10b6f6c..521aeaad1 100644 --- a/src/js/amount.js +++ b/src/js/amount.js @@ -249,7 +249,7 @@ Currency.from_json = function (j) { : j.clone(); }; -currency.is_valid = function (j) { +Currency.is_valid = function (j) { return currency.from_json(j).is_valid(); }; diff --git a/test/amount-test.js b/test/amount-test.js index bbd19c8bd..98eff5b02 100644 --- a/test/amount-test.js +++ b/test/amount-test.js @@ -38,6 +38,10 @@ buster.testCase("Amount", { "is_valid('rrrrrrrrrrrrrrrrrrrrrhoLvTp')" : function () { buster.assert(UInt160.is_valid("rrrrrrrrrrrrrrrrrrrrrhoLvTp")); }, + + "!is_valid('rrrrrrrrrrrrrrrrrrrrrhoLvT')" : function () { + buster.refute(UInt160.is_valid("rrrrrrrrrrrrrrrrrrrrrhoLvT")); + }, }, "Amount parsing" : {