From 689768bbf15d6f3a5e83cfaa892811bd06cbef12 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 30 Nov 2021 14:38:46 -0500 Subject: [PATCH] respond to comments --- packages/ripple-binary-codec/src/types/st-object.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/ripple-binary-codec/src/types/st-object.ts b/packages/ripple-binary-codec/src/types/st-object.ts index 99c894b0..2a9c41b7 100644 --- a/packages/ripple-binary-codec/src/types/st-object.ts +++ b/packages/ripple-binary-codec/src/types/st-object.ts @@ -96,8 +96,6 @@ class STObject extends SerializedType { const list: BytesList = new BytesList() const bytes: BinarySerializer = new BinarySerializer(list) - let isUnlModify = false - const xAddressDecoded = Object.entries(value).reduce((acc, [key, val]) => { let handled: JsonObject | undefined = undefined if (val && isValidXAddress(val.toString())) { @@ -127,9 +125,8 @@ class STObject extends SerializedType { const associatedValue = field.associatedType.from( xAddressDecoded[field.name], ) - if ((associatedValue as unknown as Bytes).name === 'UNLModify') { - isUnlModify = true - } + const isUnlModify = + (associatedValue as unknown as Bytes).name === 'UNLModify' const isUnlModifyWorkaround = field.name == 'Account' && isUnlModify bytes.writeFieldAndValue(field, associatedValue, isUnlModifyWorkaround) if (field.type.name === ST_OBJECT) {