Skip to content

Commit

Permalink
Support transfer from Goerli to ArbitrumGoerli through LnBridge (#499)
Browse files Browse the repository at this point in the history
* Config network

* Support transfer from Goerli to ArbitrumGoerli with LnBridge

* Fix unit tests
  • Loading branch information
JayJay1024 authored Aug 2, 2023
1 parent 587426c commit 6d28964
Show file tree
Hide file tree
Showing 30 changed files with 1,426 additions and 34 deletions.
2 changes: 1 addition & 1 deletion packages/apps/__tests__/bridge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('bridge utils', () => {
});

it('should support transfer count: ', () => {
expect(allDirections).toHaveLength(114);
expect(allDirections).toHaveLength(118);
});

it('Should correct bridge category name', () => {
Expand Down
14 changes: 13 additions & 1 deletion packages/apps/__tests__/network.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe('network utils', () => {
'arbitrum',
'arbitrum',
'arbitrum',
'arbitrum',
'astar',
'avalanche',
'optimism',
Expand Down Expand Up @@ -101,7 +102,18 @@ describe('network utils', () => {

expect(group).not.toEqual(undefined);
expect(sort(group![1])).toEqual(
sort(['astar', 'avalanche', 'optimism', 'bsc', 'ethereum', 'ethereum', 'ethereum', 'ethereum', 'polygon'])
sort([
'astar',
'avalanche',
'optimism',
'bsc',
'ethereum',
'ethereum',
'ethereum',
'ethereum',
'ethereum',
'polygon',
])
);
});

Expand Down
2 changes: 2 additions & 0 deletions packages/apps/bridges/bridges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { ArbitrumEthereumBridge } from './helixlp/arbitrum-ethereum/utils';
import { EthereumArbitrumBridgeL2 } from './l1tol2/ethereum-arbitrum/utils';
import { HelixLpBridgeBridge } from './helixlp/helixLpBridge/utils';
import { ArbitrumEthereumBridge as ArbitrumEthereumBridgeLnBridge } from './lnbridge/arbitrum-ethereum/utils';
import { EthereumArbitrumBridge as EthereumArbitrumBridgeLnBridge } from './lnbridge/ethereum-arbitrum/utils';

export const bridgeConstructors = [
CBridgeBridge,
Expand Down Expand Up @@ -53,6 +54,7 @@ export const bridgeConstructors = [
ArbitrumEthereumBridge,
EthereumArbitrumBridgeL2,
ArbitrumEthereumBridgeLnBridge,
EthereumArbitrumBridgeLnBridge,
];

export function bridgeFactory<C extends BridgeConfig, O extends ChainConfig, T extends ChainConfig>(
Expand Down
2 changes: 2 additions & 0 deletions packages/apps/bridges/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ export { Arbitrum2EthereumLn, Ethereum2ArbitrumLn } from './helixlp/arbitrum-eth
export { Ethereum2ArbitrumL2, Arbitrum2EthereumL2 } from './l1tol2/ethereum-arbitrum';

export { Arbitrum2EthereumLnBridge } from './lnbridge/arbitrum-ethereum';

export { Ethereum2ArbitrumLnBridge } from './lnbridge/ethereum-arbitrum';
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ethereumArbitrumL2 = new BridgeBase(ethereumConfig, arbitrumConfig,
category: 'l1tol2',
});

export const arbitrumGoerliL2 = new BridgeBase(goerliConfig, arbitrumGoerliConfig, arbitrumGoerliGoerliConfig, {
export const goerliArbitrumL2 = new BridgeBase(goerliConfig, arbitrumGoerliConfig, arbitrumGoerliGoerliConfig, {
name: 'ethereum-arbitrum',
category: 'l1tol2',
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { CrossToken, DVMChainConfig } from 'shared/model';
import { Bridge } from '../../../components/bridge/Bridge';
import { CrossChainComponentProps } from '../../../model/component';
import { EthereumArbitrumBridge } from './utils/bridge';

export function Arbitrum2EthereumLnBridge(
props: CrossChainComponentProps<EthereumArbitrumBridge, CrossToken<DVMChainConfig>, CrossToken<DVMChainConfig>>
) {
return <Bridge {...props} hideRecipient />;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { CrossToken, DVMChainConfig } from 'shared/model';
import { Bridge } from '../../../components/bridge/Bridge';
import { CrossChainComponentProps } from '../../../model/component';
import { EthereumArbitrumBridge } from './utils/bridge';

export function Ethereum2ArbitrumLnBridge(
props: CrossChainComponentProps<EthereumArbitrumBridge, CrossToken<DVMChainConfig>, CrossToken<DVMChainConfig>>
) {
return <Bridge {...props} hideRecipient />;
}
Loading

0 comments on commit 6d28964

Please sign in to comment.