From 5ad661f19f9f3ea773e7177dd388e491c9d7cadd Mon Sep 17 00:00:00 2001 From: Mario J Maurello Date: Wed, 13 Nov 2024 11:21:46 +0100 Subject: [PATCH] apply type inference and fix tyeps --- .../builder/src/extrinsic/ExtrinsicBuilder.utils.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/extrinsic/ExtrinsicBuilder.utils.ts b/packages/builder/src/extrinsic/ExtrinsicBuilder.utils.ts index de9ce379..3692a713 100644 --- a/packages/builder/src/extrinsic/ExtrinsicBuilder.utils.ts +++ b/packages/builder/src/extrinsic/ExtrinsicBuilder.utils.ts @@ -67,15 +67,18 @@ export function isXcmV4(xcmVersion: XcmVersion): boolean { return xcmVersion >= XcmVersion.v4; } -export function normalizeX1(xcmVersion: XcmVersion, versionedObject: Record) { +export function normalizeX1( + xcmVersion: XcmVersion, + versionedObject: Record, +) { if (!isXcmV4(xcmVersion)) return versionedObject; const normalizedObject = { ...versionedObject }; - const interior = normalizedObject.interior; + const interior = normalizedObject.interior as object; - if (interior?.X1 && !Array.isArray(interior.X1)) { + if ('X1' in interior && interior?.X1 && !Array.isArray(interior.X1)) { interior.X1 = [interior.X1]; - } else if (interior?.x1 && !Array.isArray(interior.x1)) { + } else if ('x1' in interior && interior?.x1 && !Array.isArray(interior.x1)) { interior.x1 = [interior.x1]; }