Skip to content

Commit d325b85

Browse files
refactor: code optimisation for erc20
Ticket: WIN-7914
1 parent 667008e commit d325b85

File tree

2 files changed

+229
-461
lines changed

2 files changed

+229
-461
lines changed

modules/bitgo/src/v2/coinFactory.ts

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

906+
const ethLikeChainToTestnetMap: Record<string, string> = {};
906907
export function getTokenConstructor(tokenConfig: TokenConfig): CoinConstructor | undefined {
908+
if (tokenConfig.coin in ethLikeChainToTestnetMap) {
909+
return EthLikeErc20Token.createTokenConstructor(tokenConfig as EthLikeTokenConfig, {
910+
Mainnet: tokenConfig.coin,
911+
Testnet: ethLikeChainToTestnetMap[tokenConfig.coin],
912+
});
913+
}
907914
switch (tokenConfig.coin) {
908915
case 'eth':
909916
case 'hteth':

0 commit comments

Comments
 (0)