diff --git a/packages/ua-utils-evm-hardhat-test/test/__utils__/endpoint.ts b/packages/ua-utils-evm-hardhat-test/test/__utils__/endpoint.ts index 7917328c5..2014385d7 100644 --- a/packages/ua-utils-evm-hardhat-test/test/__utils__/endpoint.ts +++ b/packages/ua-utils-evm-hardhat-test/test/__utils__/endpoint.ts @@ -12,14 +12,12 @@ import { omniContractToPoint } from '@layerzerolabs/utils-evm' import { configureEndpoint, EndpointEdgeConfig, - EndpointFactory, Uln302NodeConfig, Uln302ExecutorConfig, configureUln302, - Uln302Factory, Uln302UlnConfig, } from '@layerzerolabs/protocol-utils' -import { Endpoint, Uln302 } from '@layerzerolabs/protocol-utils-evm' +import { createEndpointFactory, createUln302Factory } from '@layerzerolabs/protocol-utils-evm' import { formatOmniPoint } from '@layerzerolabs/utils' export const ethEndpoint = { eid: EndpointId.ETHEREUM_MAINNET, contractName: 'EndpointV2' } @@ -76,8 +74,8 @@ export const setupDefaultEndpoint = async (): Promise => { const environmentFactory = createNetworkEnvironmentFactory() const contractFactory = createConnectedContractFactory() const signerFactory = createSignerFactory() - const endpointSdkFactory: EndpointFactory = async (point) => new Endpoint(await contractFactory(point)) - const ulnSdkFactory: Uln302Factory = async (point) => new Uln302(await contractFactory(point)) + const ulnSdkFactory = createUln302Factory(contractFactory) + const endpointSdkFactory = createEndpointFactory(contractFactory, ulnSdkFactory) // First we deploy the endpoint await deploy(await environmentFactory(EndpointId.ETHEREUM_MAINNET)) diff --git a/packages/ua-utils-evm-hardhat-test/test/endpoint/config.test.ts b/packages/ua-utils-evm-hardhat-test/test/endpoint/config.test.ts index c0e549de3..db1d6fa5a 100644 --- a/packages/ua-utils-evm-hardhat-test/test/endpoint/config.test.ts +++ b/packages/ua-utils-evm-hardhat-test/test/endpoint/config.test.ts @@ -4,7 +4,7 @@ import type { OmniPoint } from '@layerzerolabs/utils' import { omniContractToPoint } from '@layerzerolabs/utils-evm' import { EndpointId } from '@layerzerolabs/lz-definitions' import { getDefaultUlnConfig, setupDefaultEndpoint } from '../__utils__/endpoint' -import { Endpoint, Uln302 } from '@layerzerolabs/protocol-utils-evm' +import { Uln302, createEndpointFactory, createUln302Factory } from '@layerzerolabs/protocol-utils-evm' describe('endpoint/config', () => { const ethEndpoint = { eid: EndpointId.ETHEREUM_MAINNET, contractName: 'EndpointV2' } @@ -24,7 +24,7 @@ describe('endpoint/config', () => { it('should have default libraries configured', async () => { // This is the required tooling we need to set up const connectedContractFactory = createConnectedContractFactory() - const sdkFactory = async (point: OmniPoint) => new Endpoint(await connectedContractFactory(point)) + const sdkFactory = createEndpointFactory(connectedContractFactory) // Now for the purposes of the test, we need to get coordinates of our contracts const ethEndpointPoint = omniContractToPoint(await connectedContractFactory(ethEndpoint)) @@ -59,7 +59,7 @@ describe('endpoint/config', () => { it('should have default executors configured', async () => { // This is the required tooling we need to set up const connectedContractFactory = createConnectedContractFactory() - const sdkFactory = async (point: OmniPoint) => new Uln302(await connectedContractFactory(point)) + const sdkFactory = createUln302Factory(connectedContractFactory) const ethSendUlnPoint = omniContractToPoint(await connectedContractFactory(ethSendUln)) const avaxSendUlnPoint = omniContractToPoint(await connectedContractFactory(avaxSendUln))