Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
new sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Dec 6, 2022
1 parent 757053b commit c965f54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/tokenswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export namespace UnsupportedSwapErrors {
}

export namespace TokenSwap {
import DFK_ETH = Tokens.DFK_ETH;
const BRIDGE_CONFIG_INSTANCE: BridgeConfigV3Contract = BridgeConfigV3ContractInstance();

export interface SwapParams {
Expand Down Expand Up @@ -640,7 +641,7 @@ export namespace TokenSwap {
}
}

if (chainId === ChainId.KLAYTN) {
if (chainId === ChainId.KLAYTN && token.name != DFK_ETH.name) {
// For bridging WETH from L2s, it must be swapped to nETH and redeemed
// 'bridgeConfigIntermediateToken' is just WETH, whose address is used to calculate swap price
if (BridgeUtils.isL2ETHChain(otherChainId) && token.swapType === SwapType.ETH) {
Expand Down
3 changes: 2 additions & 1 deletion test/synapsebridge/getEstimatedBridgeOutput-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ describe("SynapseBridge - getEstimatedBridgeOutput tests", function(this: Mocha.
makeTestCase(Tokens.GAS_JEWEL, Tokens.JEWEL, ChainId.DFK, ChainId.KLAYTN),
makeTestCase(Tokens.BTCB, Tokens.BTCB, ChainId.DFK, ChainId.KLAYTN),
makeTestCase(Tokens.BTCB, Tokens.BTCB, ChainId.AVALANCHE, ChainId.DFK),
makeTestCase(Tokens.WAVAX, Tokens.WAVAX, ChainId.DFK, ChainId.KLAYTN)
makeTestCase(Tokens.WAVAX, Tokens.WAVAX, ChainId.DFK, ChainId.KLAYTN),
makeTestCase(Tokens.DFK_ETH, Tokens.NETH, ChainId.DFK, ChainId.KLAYTN)
].forEach((tc: TestCase) => {
const [describeTitle, bridgeOutputTestTitle, transactionTestTitle, approveTestTitle] = makeTestName(tc);

Expand Down

0 comments on commit c965f54

Please sign in to comment.