Throw an error when Amount or Fee contains a decimal (Fix #31)

Thanks to @jwbusch for review
This commit is contained in:
Elliot Lee
2019-07-26 16:53:25 -07:00
parent b775a6f3c8
commit da5edb0b3b
15 changed files with 413 additions and 162 deletions

View File

@@ -29,7 +29,7 @@ describe('Hash256', function() {
});
it('supports getting the nibblet values at given positions', function() {
const h = Hash256.from(
'1359BD0000000000000000000000000000000000000000000000000000000000');
'1359BD0000000000000000000000000000000000000000000000000000000000');
assert.equal(h.nibblet(0), 0x1);
assert.equal(h.nibblet(1), 0x3);
assert.equal(h.nibblet(2), 0x5);
@@ -53,6 +53,6 @@ describe('Currency', function() {
assert.throws(() => Currency.from(new Uint8Array(19)));
assert.throws(() => Currency.from(1));
assert.throws(() => Currency.from(
'00000000000000000000000000000000000000m'));
'00000000000000000000000000000000000000m'));
});
});