The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/test/deploy.test.ts

67 lines
1.9 KiB

import path from 'path';
import '@nomiclabs/hardhat-waffle';
import { ethers } from 'hardhat';
import { utils } from '@abacus-network/deploy';
import { YoAddresses, YoApp } from '../src';
import { YoChecker, YoDeployer } from '../src/deploy';
import { configs } from '../src/deploy/networks';
import { AbacusCore } from '@abacus-network/sdk';
describe('deploy', async () => {
type TestNetworks = 'test1' | 'test2' | 'test3';
let deployer: YoDeployer<TestNetworks>;
let addresses: Record<TestNetworks, YoAddresses>;
let core: AbacusCore<TestNetworks>;
before(async () => {
const transactionConfigs = {
test1: configs.test1,
test2: configs.test2,
test3: configs.test3,
};
const [signer] = await ethers.getSigners();
const multiProvider = utils.getMultiProviderFromConfigAndSigner(
transactionConfigs,
signer,
);
core = AbacusCore.fromEnvironment('test', multiProvider);
deployer = new YoDeployer(multiProvider, { owner: signer.address }, core);
});
it('deploys', async () => {
addresses = await deployer.deploy();
});
it('writes', async () => {
const base = './test/outputs/yo';
deployer.writeVerification(path.join(base, 'verification'));
deployer.writeContracts(addresses, path.join(base, 'contracts.ts'));
});
it('checks', async () => {
const transactionConfigs = {
test1: configs.test1,
test2: configs.test2,
test3: configs.test3,
};
const [signer] = await ethers.getSigners();
const multiProvider = utils.getMultiProviderFromConfigAndSigner(
transactionConfigs,
signer,
);
const app = YoApp.fromNetworkAddresses<TestNetworks>(
addresses,
multiProvider,
core,
);
const checker = new YoChecker(multiProvider, app, {
test1: { owner: signer.address },
test2: { owner: signer.address },
test3: { owner: signer.address },
});
await checker.check();
checker.expectEmpty();
});
});