Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
markolazic01 committed Aug 9, 2024
1 parent 56a359a commit aebeb6a
Show file tree
Hide file tree
Showing 6 changed files with 766 additions and 979 deletions.
1 change: 0 additions & 1 deletion test/DragonswapV2Staker.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('integration', async () => {
const amountsToStake: [BigNumber, BigNumber] = [BNe18(1_000), BNe18(1_000)]

const scenario: Fixture<TestSubject> = async (_wallets, _provider) => {

const context = await dragonswapFixture(_wallets, _provider)
const epoch = await blockTimestamp()

Expand Down
3 changes: 1 addition & 2 deletions test/shared/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const dragonswapFactoryFixture: Fixture<DragonswapFactoryFixture> = async
bytecode: linkedBytecode,
abi: NonfungibleTokenPositionDescriptor.abi,
}, // 'FUNNYMONEY' as a bytes32 string
[tokens[0].address, "0x46554e4e594d4f4e455900000000000000000000000000000000000000000000"]
[tokens[0].address, '0x46554e4e594d4f4e455900000000000000000000000000000000000000000000']
)

const nftFactory = new ethers.ContractFactory(
Expand Down Expand Up @@ -214,7 +214,6 @@ export type DragonswapFixtureType = {
rewardToken: TestERC20
}
export const dragonswapFixture: Fixture<DragonswapFixtureType> = async (wallets, provider) => {

const { tokens, nft, factory, router } = await dragonswapFactoryFixture(wallets, provider)
const signer = new ActorFixture(wallets, provider).stakerDeployer()
const stakerFactory = await ethers.getContractFactory('DragonswapV2Staker', signer)
Expand Down
12 changes: 9 additions & 3 deletions test/unit/Stakes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ describe('unit/Stakes', () => {
it('deposit is already staked in the incentive', async () => {
await Time.set(timestamps.startTime + 500)
await subject(tokenId, lpUser0)
await expect(subject(tokenId, lpUser0)).to.be.revertedWith('DragonswapV2Staker::stakeToken: token already staked')
await expect(subject(tokenId, lpUser0)).to.be.revertedWith(
'DragonswapV2Staker::stakeToken: token already staked'
)
})

it('you are not the owner of the deposit', async () => {
Expand Down Expand Up @@ -269,7 +271,9 @@ describe('unit/Stakes', () => {
throw new Error('no good')
}
await Time.set(timestamps.startTime - 2)
await expect(subject(tokenId, lpUser0)).to.be.revertedWith('DragonswapV2Staker::stakeToken: incentive not started')
await expect(subject(tokenId, lpUser0)).to.be.revertedWith(
'DragonswapV2Staker::stakeToken: incentive not started'
)
})
})
})
Expand Down Expand Up @@ -615,7 +619,9 @@ describe('unit/Stakes', () => {
it('non-owner tries to unstake before the end time', async () => {
const nonOwner = actors.lpUser2()
await Time.setAndMine(timestamps.startTime + 100)
await expect(subject(nonOwner)).to.revertedWith('DragonswapV2Staker::unstakeToken: only owner can withdraw token')
await expect(subject(nonOwner)).to.revertedWith(
'DragonswapV2Staker::unstakeToken: only owner can withdraw token'
)
expect(await blockTimestamp(), 'test setup: after end time').to.be.lt(timestamps.endTime)
})
})
Expand Down
Loading

0 comments on commit aebeb6a

Please sign in to comment.