Add useful error message when token config cannot be built (#70)

pull/2435/head
Asa Oines 2 years ago committed by GitHub
parent 5047ac5130
commit d574b9185a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/deploy.ts

@ -13,6 +13,8 @@ import { GasConfig, RouterConfig } from '@hyperlane-xyz/sdk/dist/router/types';
import {
CollateralConfig,
ERC20Metadata,
ERC20RouterConfig,
ERC721RouterConfig,
HypERC20CollateralConfig,
HypERC20Config,
HypERC721CollateralConfig,
@ -24,11 +26,9 @@ import {
isErc20Metadata,
isNativeConfig,
isSyntheticConfig,
isTokenMetadata,
isUriConfig,
} from './config';
import { isTokenMetadata } from './config';
import { ERC721RouterConfig } from './config';
import { ERC20RouterConfig } from './config';
import { HypERC20Factories, HypERC721Factories } from './contracts';
import {
ERC20__factory,
@ -180,6 +180,10 @@ export class HypERC20Deployer extends GasRouterDeployer<
...chainMetadata.nativeToken,
totalSupply: 0,
};
} else {
throw new Error(
`Warp route config specifies native token but chain metadata for ${chain} does not provide native token details`,
);
}
} else if (isErc20Metadata(config)) {
tokenMetadata = config;

Loading…
Cancel
Save