-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor actions token approve, small improvements
- Loading branch information
1 parent
f29cb7d
commit 80311cd
Showing
9 changed files
with
175 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/bridge-ui-v2/src/libs/bridge/getContractAddressBasedOnType.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { expect } from 'chai'; | ||
|
||
import { routingContractsMap } from '$bridgeConfig'; | ||
import { ContractType, type GetContractAddressType } from '$libs/bridge'; | ||
import { TokenType } from '$libs/token'; | ||
|
||
import { getContractAddressBasedOnType } from './getContractAddressBasedOnType'; | ||
|
||
const SRC_CHAIN_ID = 1; | ||
const DEST_CHAIN_ID = 2; | ||
|
||
describe('getContractAddressBasedOnType', () => { | ||
it('should return the correct contract address based on contract type', () => { | ||
// Given | ||
const args: GetContractAddressType = { | ||
srcChainId: SRC_CHAIN_ID, | ||
destChainId: DEST_CHAIN_ID, | ||
tokenType: TokenType.ERC20, | ||
contractType: ContractType.BRIDGE, | ||
}; | ||
|
||
const expectedAddress = routingContractsMap[SRC_CHAIN_ID][DEST_CHAIN_ID].bridgeAddress; | ||
|
||
// When | ||
const address = getContractAddressBasedOnType(args); | ||
|
||
// Then | ||
expect(address).to.equal(expectedAddress); | ||
}); | ||
}); |
Oops, something went wrong.