Skip to content

Commit

Permalink
simplify artifact parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-savu committed Mar 14, 2024
1 parent 0a85b4a commit 7f2e05d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
9 changes: 4 additions & 5 deletions typescript/infra/config/environments/mainnet3/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import {
GasPaymentEnforcementConfig,
routerMatchingList,
warpRouteMatchingList,
} from '../../../src/config/agent/relayer';
import { ALL_KEY_ROLES, Role } from '../../../src/roles';
import { Contexts } from '../../contexts';
Expand All @@ -23,8 +22,8 @@ import { environment, supportedChainNames } from './chains';
import { helloWorld } from './helloworld';
import { validatorChainConfig } from './validators';
import arbitrumTIAAddresses from './warp/arbitrum-TIA-addresses.json';
import injectiveInevmUsdcAddresses from './warp/inevm-USDC-addresses.json';
import injectiveInevmUsdtAddresses from './warp/inevm-USDT-addresses.json';
import inevmEthereumUsdcAddresses from './warp/inevm-USDC-addresses.json';
import inevmEthereumUsdtAddresses from './warp/inevm-USDT-addresses.json';
import injectiveInevmInjAddresses from './warp/injective-inevm-addresses.json';
import mantaTIAAddresses from './warp/manta-TIA-addresses.json';

Expand Down Expand Up @@ -158,11 +157,11 @@ const hyperlane: RootAgentConfig = {
},
{
name: 'inevm_ethereum_usdc',
matchingList: warpRouteMatchingList(injectiveInevmUsdcAddresses),
matchingList: routerMatchingList(inevmEthereumUsdcAddresses),
},
{
name: 'inevm_ethereum_usdt',
matchingList: warpRouteMatchingList(injectiveInevmUsdtAddresses),
matchingList: routerMatchingList(inevmEthereumUsdtAddresses),
},
],
},
Expand Down
27 changes: 0 additions & 27 deletions typescript/infra/src/config/agent/relayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,30 +178,3 @@ export function routerMatchingList(

return matchingList;
}

type HypErc20Address = { HypERC20: string };
type HypERC20CollateralAddress = { HypERC20Collateral: string };
type HypErc721Address = { HypERC721: string };
type HypErc721CollateralAddress = { HypERC721Collateral: string };
type HypNativeAddress = { HypNativeAddress: string };

type WarpRoute =
| HypErc20Address
| HypERC20CollateralAddress
| HypErc721Address
| HypErc721CollateralAddress
| HypNativeAddress;

// Create a matching list for the given warp route addresses
export function warpRouteMatchingList(
routers: ChainMap<WarpRoute>,
): MatchingList {
let standardizedRouters: ChainMap<{ router: string }> = {};
Object.entries(routers).forEach(([chain, route]) => {
let routerAddress = Object.values(route);
// Due to duck typing there could be more than one value in the route object,
// but the line below assumes there is only one.
standardizedRouters[chain] = { router: routerAddress[0] };
});
return routerMatchingList(standardizedRouters);
}

0 comments on commit 7f2e05d

Please sign in to comment.