Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Nov 7, 2023
1 parent 71504e4 commit f4b1fcf
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions yarn-project/end-to-end/src/e2e_liquidity_mining.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import {
AccountWallet,
CheatCodes,
CompleteAddress,
DebugLogger
} from '@aztec/aztec.js';
import { AccountWallet, CheatCodes, CompleteAddress, DebugLogger } from '@aztec/aztec.js';
import { CircuitsWasm } from '@aztec/circuits.js';
import { Pedersen, SparseTree, newTree } from '@aztec/merkle-tree';
import { SlowTreeContract } from '@aztec/noir-contracts/types';
import { LiquidityMiningContract } from '@aztec/noir-contracts/types';

import { jest } from '@jest/globals';
import levelup from 'levelup';
import { default as memdown, type MemDown } from 'memdown';
import { type MemDown, default as memdown } from 'memdown';

import { setup } from './fixtures/utils.js';
import { TokenSimulator } from './simulators/token_simulator.js';

export const createMemDown = () => (memdown as any)() as MemDown<any, any>;

Expand All @@ -23,31 +17,26 @@ describe('e2e_liquidity_mining', () => {
jest.setTimeout(TIMEOUT);

let teardown: () => Promise<void>;
let logger: DebugLogger;
let wallets: AccountWallet[];
let accounts: CompleteAddress[];
let logger: DebugLogger;

let tokenSim: TokenSimulator;
let cheatCodes: CheatCodes;

let tree: SparseTree;
let contract: LiquidityMiningContract;

let cheatCodes: CheatCodes;
let simulatorTree: SparseTree;

beforeAll(async () => {
({ teardown, logger, wallets, accounts, cheatCodes } = await setup(4));

slowTree = await SlowTreeContract.deploy(wallets[0]).send().deployed();
contract = await LiquidityMiningContract.deploy(wallets[0]).send().deployed();

const db = levelup(createMemDown());
const hasher = new Pedersen(await CircuitsWasm.get());
const depth = 254;
tree = await newTree(SparseTree, db, hasher, 'test', depth);

simulatorTree = await newTree(SparseTree, db, hasher, 'test', depth);
}, 100_000);

afterAll(() => teardown());

afterEach(async () => {
await tokenSim.check();
}, TIMEOUT);
});

0 comments on commit f4b1fcf

Please sign in to comment.