fix encoding problems

This commit is contained in:
Mayukha Vadari
2021-06-24 17:35:49 -04:00
parent 5fb61c470e
commit f25aecd853
3 changed files with 48 additions and 27 deletions

View File

@@ -50,10 +50,10 @@ describe("Hash256", function () {
});
describe("Currency", function () {
test("Will have a null iso() for dodgy XRP ", function () {
const bad = Currency.from("0000000000000000000000005852500000000000");
expect(bad.iso()).toBeUndefined();
expect(bad.isNative()).toBe(false);
test("Will throw an error for dodgy XRP ", function () {
expect(() =>
Currency.from("0000000000000000000000005852500000000000")
).toThrow();
});
test("Currency with lowercase letters decode to hex", () => {
expect(Currency.from("xRp").toJSON()).toBe(