UNPKG

@hyperlane-xyz/cli

Version:

A command-line utility for common Hyperlane operations

29 lines 1.59 kB
import { expect } from 'chai'; import { Wallet, ethers } from 'ethers'; import { readYamlOrJson } from '../../utils/files.js'; import { hyperlaneCoreDeploy, readCoreConfig } from '../commands/core.js'; import { ANVIL_KEY, CHAIN_2_METADATA_PATH, CHAIN_NAME_2, CORE_CONFIG_PATH, CORE_READ_CONFIG_PATH_2, DEFAULT_E2E_TEST_TIMEOUT, } from '../commands/helpers.js'; describe('hyperlane core read e2e tests', async function () { this.timeout(DEFAULT_E2E_TEST_TIMEOUT); let signer; let initialOwnerAddress; before(async () => { const chainMetadata = readYamlOrJson(CHAIN_2_METADATA_PATH); const provider = new ethers.providers.JsonRpcProvider(chainMetadata.rpcUrls[0].http); const wallet = new Wallet(ANVIL_KEY); signer = wallet.connect(provider); initialOwnerAddress = await signer.getAddress(); }); it('should read a core deployment', async () => { await hyperlaneCoreDeploy(CHAIN_NAME_2, CORE_CONFIG_PATH); const coreConfig = await readCoreConfig(CHAIN_NAME_2, CORE_READ_CONFIG_PATH_2); expect(coreConfig.owner).to.equal(initialOwnerAddress); expect(coreConfig.proxyAdmin?.owner).to.equal(initialOwnerAddress); expect(coreConfig.requiredHook).not.to.be.undefined; expect(coreConfig.defaultHook).not.to.be.undefined; expect(coreConfig.defaultIsm).not.to.be.undefined; // Assuming that the ProtocolFeeHook is used for deployment expect(coreConfig.requiredHook.owner).to.equal(initialOwnerAddress); }); }); //# sourceMappingURL=core-read.e2e-test.js.map