mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
Remove exception from decoding issued currencies which evaluate to 'XRP' (#1920)
* Remove throw and revise tests * Update chai dependency * Disabling linter error about extraneous import * Fix typo in test description * Revert unnecessary test changes * Remove unnecessary comments * Revert chai change * Add HISTORY.md * Revert chai change in package-lock as well * Fix typo * Check the result of the decoding * Update tests with correct expected behavior. * Fix tests and update currency.js * Update currency.ts
This commit is contained in:
@@ -50,10 +50,9 @@ describe('Hash256', function () {
|
||||
})
|
||||
|
||||
describe('Currency', function () {
|
||||
test('Will throw an error for dodgy XRP', function () {
|
||||
expect(() =>
|
||||
Currency.from('0000000000000000000000005852500000000000'),
|
||||
).toThrow()
|
||||
test('Decoding allows dodgy XRP without throwing', function () {
|
||||
const currencyCode = '0000000000000000000000005852500000000000'
|
||||
expect(Currency.from(currencyCode).toJSON()).toBe(currencyCode)
|
||||
})
|
||||
test('Currency with lowercase letters decode to hex', () => {
|
||||
expect(Currency.from('xRp').toJSON()).toBe(
|
||||
|
||||
Reference in New Issue
Block a user