mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-02-12 20:46:35 +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,
|
deployTokens,
|
||||||
deployUniswapV3Callee,
|
deployUniswapV3Callee,
|
||||||
TESTERC20_ABI,
|
TESTERC20_ABI,
|
||||||
|
TICK_MIN,
|
||||||
createPool,
|
createPool,
|
||||||
initializePool,
|
initializePool,
|
||||||
getMinTick,
|
getMinTick,
|
||||||
@ -38,8 +39,6 @@ import {
|
|||||||
|
|
||||||
const NETWORK_RPC_URL = 'http://localhost:8545';
|
const NETWORK_RPC_URL = 'http://localhost:8545';
|
||||||
|
|
||||||
const TICK_MIN = -887272;
|
|
||||||
|
|
||||||
describe('uni-info-watcher', () => {
|
describe('uni-info-watcher', () => {
|
||||||
let factory: Contract;
|
let factory: Contract;
|
||||||
let pool: Contract;
|
let pool: Contract;
|
||||||
@ -239,7 +238,7 @@ describe('uni-info-watcher', () => {
|
|||||||
|
|
||||||
data = await request(endpoint, queryFactory);
|
data = await request(endpoint, queryFactory);
|
||||||
oldFactory = data.factories[0];
|
oldFactory = data.factories[0];
|
||||||
|
|
||||||
data = await request(endpoint, queryToken, { id: token0.address });
|
data = await request(endpoint, queryToken, { id: token0.address });
|
||||||
oldToken0 = data.token;
|
oldToken0 = data.token;
|
||||||
|
|
||||||
@ -311,7 +310,7 @@ describe('uni-info-watcher', () => {
|
|||||||
first: 1,
|
first: 1,
|
||||||
orderBy: 'timestamp',
|
orderBy: 'timestamp',
|
||||||
orderDirection: 'desc',
|
orderDirection: 'desc',
|
||||||
pool: pool.address,
|
pool: pool.address
|
||||||
};
|
};
|
||||||
data = await request(endpoint, queryMints, variables);
|
data = await request(endpoint, queryMints, variables);
|
||||||
expect(data.mints).to.not.be.empty;
|
expect(data.mints).to.not.be.empty;
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
deployTokens,
|
deployTokens,
|
||||||
deployUniswapV3Callee,
|
deployUniswapV3Callee,
|
||||||
TESTERC20_ABI,
|
TESTERC20_ABI,
|
||||||
|
TICK_MIN,
|
||||||
getMinTick,
|
getMinTick,
|
||||||
getMaxTick,
|
getMaxTick,
|
||||||
approveToken
|
approveToken
|
||||||
@ -58,9 +59,6 @@ import {
|
|||||||
|
|
||||||
const NETWORK_RPC_URL = 'http://localhost:8545';
|
const NETWORK_RPC_URL = 'http://localhost:8545';
|
||||||
|
|
||||||
const TICK_MIN = -887272;
|
|
||||||
const TICK_MAX = 887272;
|
|
||||||
|
|
||||||
describe('uni-watcher', () => {
|
describe('uni-watcher', () => {
|
||||||
let factory: Contract;
|
let factory: Contract;
|
||||||
let pool: Contract;
|
let pool: Contract;
|
||||||
|
@ -11,10 +11,16 @@ import {
|
|||||||
|
|
||||||
export { abi as TESTERC20_ABI } from '../artifacts/test/contracts/TestERC20.sol/TestERC20.json';
|
export { abi as TESTERC20_ABI } from '../artifacts/test/contracts/TestERC20.sol/TestERC20.json';
|
||||||
|
|
||||||
const TICK_MIN = -887272;
|
export const TICK_MIN = -887272;
|
||||||
const TICK_MAX = 887272;
|
export 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 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}> => {
|
export const deployTokens = async (signer: Signer): Promise<{token0Address: string, token1Address: string}> => {
|
||||||
const Token = new ethers.ContractFactory(TESTERC20_ABI, TESTERC20_BYTECODE, signer);
|
const Token = new ethers.ContractFactory(TESTERC20_ABI, TESTERC20_BYTECODE, signer);
|
||||||
|
Loading…
Reference in New Issue
Block a user