Skip to content

Commit

Permalink
Merge pull request #2240 from zeitgeistpm/tr-cross-chain-proxy
Browse files Browse the repository at this point in the history
Cross chain proxy info and error handling
  • Loading branch information
Robiquet authored Feb 7, 2024
2 parents cb8f4b0 + dca3ce0 commit 03e191d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/markets/market-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const MarketCardPredictionBar = ({
return (
<div className={`relative h-[30px] w-full bg-gray-200 transition-all`}>
<div className="absolute flex h-full w-full items-center justify-between px-2.5 text-sm">
<span className="text-blue">{name}</span>
<span className="line-clamp-1 text-blue">{name}</span>
<span className="text-blue transition-all">{impliedPercentage}%</span>
</div>
<div
Expand Down
11 changes: 10 additions & 1 deletion lib/hooks/useCrossChainExtrinsic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ export const useCrossChainExtrinsic = <T>(
if (extrinsic && proxy?.enabled && proxy?.address) {
console.info("Proxying cross chain transaction");
extrinsic = sdk.api.tx.proxy.proxy(proxy?.address, null, extrinsic);
notifications.pushNotification(
"Proxies are not supported for cross chain transactions",
{
type: "Info",
},
);
}

if (!signer || !extrinsic || !sourceChainApi || !destinationChainApi)
Expand Down Expand Up @@ -116,7 +122,10 @@ export const useCrossChainExtrinsic = <T>(
},
}),
IOForeignAssetId.is(fee?.assetId) ? fee?.assetId.ForeignAsset : undefined,
).catch(() => {
).catch((error) => {
notifications.pushNotification(error?.toString() ?? "Unknown Error", {
type: "Error",
});
setIsLoading(false);
});
};
Expand Down

0 comments on commit 03e191d

Please sign in to comment.