diff --git a/src/js/amount.js b/src/js/amount.js index be10b6f6..521aeaad 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 bbd19c8b..98eff5b0 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" : {