Skip to content

Commit

Permalink
chore: Add deployOApp test helper
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Dec 5, 2023
1 parent f70dec6 commit 9136005
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/ua-utils-evm-hardhat-test/test/__utils__/oapp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { EndpointId } from '@layerzerolabs/lz-definitions'
import { createNetworkEnvironmentFactory } from '@layerzerolabs/utils-evm-hardhat'
import deploy from '../../deploy/002_oapp'

export const deployOApp = async () => {
const environmentFactory = createNetworkEnvironmentFactory()

await deploy(await environmentFactory(EndpointId.ETHEREUM_MAINNET))
await deploy(await environmentFactory(EndpointId.AVALANCHE_MAINNET))
}
2 changes: 2 additions & 0 deletions packages/ua-utils-evm-hardhat-test/test/oapp/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { expect } from 'chai'
import { describe } from 'mocha'
import { EndpointId } from '@layerzerolabs/lz-definitions'
import { setupDefaultEndpoint } from '../__utils__/endpoint'
import { deployOApp } from '../__utils__/oapp'

describe('oapp/config', () => {
const ethContract = { eid: EndpointId.ETHEREUM_MAINNET, contractName: 'DefaultOApp' }
Expand Down Expand Up @@ -46,6 +47,7 @@ describe('oapp/config', () => {

beforeEach(async () => {
await setupDefaultEndpoint()
await deployOApp()
})

it('should return all setPeer transactions', async () => {
Expand Down

0 comments on commit 9136005

Please sign in to comment.