Skip to content

Commit d9bb3e3

Browse files
committed
Address ISM metadata review feedback
1 parent 2fd7056 commit d9bb3e3

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/features/debugger/debugMessage.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ function routeHasEmptyMultisig(route?: IsmRouteModule): boolean {
318318
if (
319319
(route.moduleType === IsmModuleTypes.LEGACY_MULTISIG ||
320320
route.moduleType === IsmModuleTypes.MULTISIG) &&
321+
route.multisigResolved &&
321322
(!route.validators?.length || !route.threshold || route.threshold < 1)
322323
) {
323324
return true;
@@ -386,6 +387,7 @@ async function tryDescribeIsmRoute(
386387
const [validators, threshold] = await multisigIsm.validatorsAndThreshold(messageBytes);
387388
node.validators = validators;
388389
node.threshold = Number(threshold);
390+
node.multisigResolved = true;
389391
}
390392
} catch (error) {
391393
logger.warn(`Error describing ISM route for ${ismAddress}`, error);
@@ -593,7 +595,7 @@ function decodeAggregationRanges(metadata: string) {
593595
if (start < AGGREGATION_RANGE_SIZE || end <= start || end > length) break;
594596
ranges.push({ start, end, hasMetadata: true });
595597
}
596-
return ranges.length > 1 ? ranges : [];
598+
return ranges.length > 0 ? ranges : [];
597599
}
598600

599601
function readUint32(hex: string, byteOffset: number) {

src/features/debugger/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export interface IsmRouteModule {
6565
moduleType?: IsmModuleTypes;
6666
threshold?: number;
6767
validators?: Address[];
68+
multisigResolved?: boolean;
6869
metadata?: IsmMetadataDetails;
6970
children?: IsmRouteModule[];
7071
}

src/features/messages/cards/IsmDetailsCard.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { isNullish } from '@hyperlane-xyz/utils';
22
import { Tooltip } from '@hyperlane-xyz/widgets';
3+
import clsx from 'clsx';
34

45
import { SectionCard } from '../../../components/layout/SectionCard';
56
import { docLinks } from '../../../consts/links';
@@ -154,7 +155,10 @@ function IsmRouteNode({
154155
const labelWidth = depth ? 'w-24' : 'w-28';
155156
return (
156157
<div
157-
className={`${depth ? 'ml-4 border-l border-gray-200 pl-3 dark:border-gray-700' : ''} space-y-2`}
158+
className={clsx(
159+
'space-y-2',
160+
depth && 'ml-4 border-l border-gray-200 pl-3 dark:border-gray-700',
161+
)}
158162
>
159163
<KeyValueRow
160164
label={depth ? 'Module:' : 'Root:'}

0 commit comments

Comments
 (0)