Add tests for parsing lower-case hex-strings (#97)

Add one test suite to verify that ripple-binary-codec could handle lower-case hex-strings.
This commit is contained in:
Nathan Nichols
2020-08-20 17:30:50 -05:00
parent 34d2d2c9ed
commit d1b23a8b2d
3 changed files with 47 additions and 3 deletions

View File

@@ -161,7 +161,7 @@ class Amount extends SerializedType {
return {
value: value.toString(),
currency: currency.toJSON(),
currency: currency.toJSON(),
issuer: issuer.toJSON(),
};
}

View File

@@ -116,7 +116,9 @@ class Hop extends SerializedType {
const hopParser = new BinaryParser(this.bytes.toString("hex"));
const type = hopParser.readUInt8();
let account, currency, issuer: string | undefined = undefined
let account,
currency,
issuer: string | undefined = undefined;
if (type & TYPE_ACCOUNT) {
account = (AccountID.fromParser(hopParser) as AccountID).toJSON();
}
@@ -128,7 +130,7 @@ class Hop extends SerializedType {
if (type & TYPE_ISSUER) {
issuer = (AccountID.fromParser(hopParser) as AccountID).toJSON();
}
return {
account: account,
issuer: issuer,