mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-19 12:26:19 +00:00
Import TICK_MIN from util and fix lint errors. (#187)
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
This commit is contained in:
parent
df85f961db
commit
b6fe8a8c47
@ -11,6 +11,7 @@ import {
|
||||
deployTokens,
|
||||
deployUniswapV3Callee,
|
||||
TESTERC20_ABI,
|
||||
TICK_MIN,
|
||||
createPool,
|
||||
initializePool,
|
||||
getMinTick,
|
||||
@ -38,8 +39,6 @@ import {
|
||||
|
||||
const NETWORK_RPC_URL = 'http://localhost:8545';
|
||||
|
||||
const TICK_MIN = -887272;
|
||||
|
||||
describe('uni-info-watcher', () => {
|
||||
let factory: Contract;
|
||||
let pool: Contract;
|
||||
@ -239,7 +238,7 @@ describe('uni-info-watcher', () => {
|
||||
|
||||
data = await request(endpoint, queryFactory);
|
||||
oldFactory = data.factories[0];
|
||||
|
||||
|
||||
data = await request(endpoint, queryToken, { id: token0.address });
|
||||
oldToken0 = data.token;
|
||||
|
||||
@ -311,7 +310,7 @@ describe('uni-info-watcher', () => {
|
||||
first: 1,
|
||||
orderBy: 'timestamp',
|
||||
orderDirection: 'desc',
|
||||
pool: pool.address,
|
||||
pool: pool.address
|
||||
};
|
||||
data = await request(endpoint, queryMints, variables);
|
||||
expect(data.mints).to.not.be.empty;
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
deployTokens,
|
||||
deployUniswapV3Callee,
|
||||
TESTERC20_ABI,
|
||||
TICK_MIN,
|
||||
getMinTick,
|
||||
getMaxTick,
|
||||
approveToken
|
||||
@ -58,9 +59,6 @@ import {
|
||||
|
||||
const NETWORK_RPC_URL = 'http://localhost:8545';
|
||||
|
||||
const TICK_MIN = -887272;
|
||||
const TICK_MAX = 887272;
|
||||
|
||||
describe('uni-watcher', () => {
|
||||
let factory: Contract;
|
||||
let pool: Contract;
|
||||
|
@ -11,10 +11,16 @@ import {
|
||||
|
||||
export { abi as TESTERC20_ABI } from '../artifacts/test/contracts/TestERC20.sol/TestERC20.json';
|
||||
|
||||
const TICK_MIN = -887272;
|
||||
const TICK_MAX = 887272;
|
||||
export const getMinTick = (tickSpacing: number) => Math.ceil(TICK_MIN / tickSpacing) * tickSpacing;
|
||||
export const getMaxTick = (tickSpacing: number) => Math.floor(TICK_MAX / tickSpacing) * tickSpacing;
|
||||
export const TICK_MIN = -887272;
|
||||
export const TICK_MAX = 887272;
|
||||
|
||||
export const getMinTick = (tickSpacing: number): number => {
|
||||
return Math.ceil(TICK_MIN / tickSpacing) * tickSpacing;
|
||||
};
|
||||
|
||||
export const getMaxTick = (tickSpacing: number): number => {
|
||||
return Math.floor(TICK_MAX / tickSpacing) * tickSpacing;
|
||||
};
|
||||
|
||||
export const deployTokens = async (signer: Signer): Promise<{token0Address: string, token1Address: string}> => {
|
||||
const Token = new ethers.ContractFactory(TESTERC20_ABI, TESTERC20_BYTECODE, signer);
|
||||
|
Loading…
Reference in New Issue
Block a user