From 166e35bf0e363733996a3f43a9a4cc88119ef852 Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Fri, 23 Aug 2013 19:08:53 -0700 Subject: [PATCH] Disable currency validity check for now. It's too strict unfortunately and not quick to fix. --- src/js/ripple/serializedtypes.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/js/ripple/serializedtypes.js b/src/js/ripple/serializedtypes.js index a854ee97..65735c88 100644 --- a/src/js/ripple/serializedtypes.js +++ b/src/js/ripple/serializedtypes.js @@ -256,9 +256,12 @@ var STCurrency = new SerializedType({ parse: function (so) { var bytes = so.read(20); var currency = Currency.from_bytes(bytes); - if (!currency.is_valid()) { - throw new Error("Invalid currency: "+convert_bytes_to_hex(bytes)); - } + // XXX Disabled check. Theoretically, the Currency class should support any + // UInt160 value and consider it valid. But it doesn't, so for the + // deserialization to be usable, we need to allow invalid results for now. + //if (!currency.is_valid()) { + // throw new Error("Invalid currency: "+convert_bytes_to_hex(bytes)); + //} return currency; } });