Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tryGetChainName
Browse files Browse the repository at this point in the history
paulbalaji committed Nov 7, 2024
1 parent b8e0d31 commit 5ca53df
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/features/deliveryStatus/fetchDeliveryStatus.ts
Original file line number Diff line number Diff line change
@@ -25,7 +25,11 @@ export async function fetchDeliveryStatus(
overrideChainMetadata: ChainMap<Partial<ChainMetadata>>,
message: Message,
): Promise<MessageDeliveryStatusResponse> {
const destName = multiProvider.getChainName(message.destinationDomainId);
const destName = multiProvider.tryGetChainName(message.destinationDomainId);
if (!destName)
throw new Error(
`Cannot check delivery status, no chain name provided for domain ${message.destinationDomainId}`,
);
const destMailboxAddr = await getMailboxAddress(destName, overrideChainMetadata, registry);
if (!destMailboxAddr)
throw new Error(
4 changes: 2 additions & 2 deletions src/features/messages/MessageDetails.tsx
Original file line number Diff line number Diff line change
@@ -88,8 +88,8 @@ export function MessageDetails({ messageId, message: messageFromUrlParams }: Pro
// Banner color setter
useDynamicBannerColor(isFetching, status, isMessageFound, isError || isPiError);

const originChainName = multiProvider.getChainName(originDomainId);
const destinationChainName = multiProvider.getChainName(destinationDomainId);
const originChainName = multiProvider.tryGetChainName(originDomainId) || 'Unknown';
const destinationChainName = multiProvider.tryGetChainName(destinationDomainId) || 'Unknown';

return (
<>
4 changes: 2 additions & 2 deletions src/features/messages/MessageTable.tsx
Original file line number Diff line number Diff line change
@@ -67,8 +67,8 @@ export function MessageSummaryRow({ message, mp }: { message: MessageStub; mp: M

const base64 = message.isPiMsg ? serializeMessage(message) : undefined;

const originChainName = mp.getChainName(originDomainId);
const destinationChainName = mp.getChainName(destinationDomainId);
const originChainName = mp.tryGetChainName(originDomainId) || 'Unknown';
const destinationChainName = mp.tryGetChainName(destinationDomainId) || 'Unknown';

return (
<>

0 comments on commit 5ca53df

Please sign in to comment.