From 7740694663c9dcfe82b1c09ad998d83e8d824f2f Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:03:49 +0000 Subject: [PATCH] Fix "unused variable" by using temp error --- packages/sdk-router/src/rfq/fastBridgeSet.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/sdk-router/src/rfq/fastBridgeSet.ts b/packages/sdk-router/src/rfq/fastBridgeSet.ts index 3fd3baf414..86e573ba61 100644 --- a/packages/sdk-router/src/rfq/fastBridgeSet.ts +++ b/packages/sdk-router/src/rfq/fastBridgeSet.ts @@ -164,6 +164,9 @@ export class FastBridgeSet extends SynapseModuleSet { destChainId: number ): Promise { // TODO: hit Quoter API to get supported tickers, then unmarshall them + if (originChainId === destChainId) { + throw new Error('Same chain swaps are not supported') + } return [] } @@ -179,6 +182,9 @@ export class FastBridgeSet extends SynapseModuleSet { amount: BigNumber ): Promise { // TODO: hit Quoter API to get the quote for ticker.originToken -> ticker.destToken with the given amount + if (ticker.originToken.chainId === ticker.destToken.chainId) { + throw new Error('Same chain swaps are not supported') + } return amount } }