UNPKG

@hyperlane-xyz/sdk

Version:

The official SDK for the Hyperlane Network

85 lines 3.08 kB
import { Address } from '@arbitrum/sdk'; import { expect } from 'chai'; import { HookType } from '../hook/types.js'; import { IsmType } from '../ism/types.js'; import { transformConfigToCheck } from './configUtils.js'; describe('configUtils', () => { describe(transformConfigToCheck.name, () => { const ADDRESS = '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359'; const testCases = [ { msg: 'It should remove the address and ownerOverrides fields from the config', input: { ownerOverrides: { owner: ADDRESS, }, hook: { type: HookType.AMOUNT_ROUTING, address: ADDRESS, }, interchainSecurityModule: { type: IsmType.AGGREGATION, address: ADDRESS, modules: [ { type: IsmType.AMOUNT_ROUTING, address: ADDRESS, }, { type: IsmType.FALLBACK_ROUTING, address: Address, }, ], }, }, expected: { hook: { type: HookType.AMOUNT_ROUTING, }, interchainSecurityModule: { type: IsmType.AGGREGATION, modules: [ { type: IsmType.AMOUNT_ROUTING, }, { type: IsmType.FALLBACK_ROUTING, }, ], }, }, }, { msg: 'It should not remove the address property from the remoteRouters object', input: { interchainSecurityModule: { address: ADDRESS, type: 'NULL', }, remoteRouters: { '1': { address: ADDRESS, }, }, }, expected: { interchainSecurityModule: { type: 'NULL', }, remoteRouters: { '1': { address: ADDRESS, }, }, }, }, ]; for (const { msg, input, expected } of testCases) { it(msg, () => { const tranformedObj = transformConfigToCheck(input); expect(tranformedObj).to.eql(expected); }); } }); }); //# sourceMappingURL=configUtils.test.js.map