mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
Currency: Add support for complex currencies. (UInt160)
This patch might regress the performance of the Currency class and by extension the Amount class. Since Amount is on a lot of hot paths in the client we should make sure this isn't a major problem. As for compatibility, this patch is a major change, but it should maintain the public interface very well, which the exception of some strange edge cases (e.g. Currency.from_json(1337)), which weren't well-defined before anyway. Any code that accesses _value directly (shame on you!) will need to be fixed. There aren't any such references in ripple-client or the rippled test suite, so I think we're looking pretty good.
This commit is contained in:
@@ -19,8 +19,8 @@ describe('Currency', function() {
|
||||
});
|
||||
it('from_json("XRP").to_json() == "XRP"', function() {
|
||||
var r = currency.from_json('XRP');
|
||||
assert.strictEqual(0, r._value);
|
||||
assert(r.is_valid());
|
||||
assert(r.is_native());
|
||||
assert.strictEqual('XRP', r.to_json());
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user