Skip to content

Commit

Permalink
chore: Fix test setups
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Dec 11, 2023
1 parent 7c12c38 commit 1fec150
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions packages/ua-utils-evm-hardhat-test/test/__utils__/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down Expand Up @@ -76,8 +74,8 @@ export const setupDefaultEndpoint = async (): Promise<void> => {
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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Check failure on line 7 in packages/ua-utils-evm-hardhat-test/test/endpoint/config.test.ts

View workflow job for this annotation

GitHub Actions / Check code / Build, Lint & Test

'Uln302' is defined but never used

describe('endpoint/config', () => {
const ethEndpoint = { eid: EndpointId.ETHEREUM_MAINNET, contractName: 'EndpointV2' }
Expand All @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 1fec150

Please sign in to comment.