mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 04:35:49 +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:
@@ -29,9 +29,7 @@ function isIsoCode(iso: string): boolean {
|
||||
function isoCodeFromHex(code: Buffer): string | null {
|
||||
const iso = code.toString()
|
||||
if (iso === 'XRP') {
|
||||
throw new Error(
|
||||
'Disallowed currency code: to indicate the currency XRP you must use 20 bytes of 0s',
|
||||
)
|
||||
return null
|
||||
}
|
||||
if (isIsoCode(iso)) {
|
||||
return iso
|
||||
|
||||
Reference in New Issue
Block a user