mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 19:55:51 +00:00
UInt160 can be an account or a plain hash.
The UInt160 class used to be hardcoded to be an Account. This commit changes it so it can be used as an account or a plain hash. It will try to automatically self-classify based on how it is initialized. In the future we may want to have some dedicated classes rather than a single configurable UInt160.
This commit is contained in:
@@ -36,7 +36,7 @@ describe('Amount', function() {
|
||||
assert.deepEqual(new BigInteger(), UInt160.from_generic('0')._value);
|
||||
});
|
||||
it('Parse 0 export', function () {
|
||||
assert.strictEqual(UInt160.ACCOUNT_ZERO, UInt160.from_generic('0').to_json());
|
||||
assert.strictEqual(UInt160.ACCOUNT_ZERO, UInt160.from_generic('0').set_version(0).to_json());
|
||||
});
|
||||
it('Parse 1', function () {
|
||||
assert.deepEqual(new BigInteger([1]), UInt160.from_generic('1')._value);
|
||||
|
||||
Reference in New Issue
Block a user