Skip to content

Commit 001c662

Browse files
Merge pull request #7553 from BitGo/WIN-7914-1
refactor: code optimisation for erc20
2 parents 9461c9d + b76e247 commit 001c662

File tree

3 files changed

+714
-461
lines changed

3 files changed

+714
-461
lines changed

modules/bitgo/src/v2/coinFactory.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,15 @@ export function getCoinConstructor(coinName: string): CoinConstructor | undefine
903903
}
904904
}
905905

906+
// TODO: add IP token here and test changes (Ticket: https://bitgoinc.atlassian.net/browse/WIN-7835)
907+
const ethLikeChainToTestnetMap: Record<string, string> = {};
906908
export function getTokenConstructor(tokenConfig: TokenConfig): CoinConstructor | undefined {
909+
if (tokenConfig.coin in ethLikeChainToTestnetMap) {
910+
return EthLikeErc20Token.createTokenConstructor(tokenConfig as EthLikeTokenConfig, {
911+
Mainnet: tokenConfig.coin,
912+
Testnet: ethLikeChainToTestnetMap[tokenConfig.coin],
913+
});
914+
}
907915
switch (tokenConfig.coin) {
908916
case 'eth':
909917
case 'hteth':

0 commit comments

Comments
 (0)