@airdao/astra-cl-periphery
Version:
🎚 Peripheral smart contracts for interacting with AstraDEX Concentrated Liquidity version
57 lines (45 loc) • 1.68 kB
text/typescript
import { Contract } from 'ethers'
import { waffle, ethers } from 'hardhat'
import { Fixture } from 'ethereum-waffle'
import { PeripheryImmutableStateTest, ISAMB } from '../typechain'
import { expect } from './shared/expect'
import { CLRouterFixture } from './shared/externalFixtures'
describe('PeripheryImmutableState', () => {
const nonfungiblePositionManagerFixture: Fixture<{
samb: ISAMB
factory: Contract
state: PeripheryImmutableStateTest
}> = async (wallets, provider) => {
const { samb, factory } = await CLRouterFixture(wallets, provider)
const stateFactory = await ethers.getContractFactory('PeripheryImmutableStateTest')
const state = (await stateFactory.deploy(factory.address, samb.address)) as PeripheryImmutableStateTest
return {
samb,
factory,
state,
}
}
let factory: Contract
let samb: ISAMB
let state: PeripheryImmutableStateTest
let loadFixture: ReturnType<typeof waffle.createFixtureLoader>
before('create fixture loader', async () => {
loadFixture = waffle.createFixtureLoader(await (ethers as any).getSigners())
})
beforeEach('load fixture', async () => {
;({ state, samb, factory } = await loadFixture(nonfungiblePositionManagerFixture))
})
it('bytecode size', async () => {
expect(((await state.provider.getCode(state.address)).length - 2) / 2).to.matchSnapshot()
})
describe('#SAMB', () => {
it('points to SAMB', async () => {
expect(await state.SAMB()).to.eq(samb.address)
})
})
describe('#factory', () => {
it('points to CL core factory', async () => {
expect(await state.factory()).to.eq(factory.address)
})
})
})