* Refactor common code in uni-watcher and uni-info-watcher.
* Implement client.ts in uni-info-watcher for queries and use in smoke-test.
* Disable cache in graphql client.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Implement hierarchical query for checking ancestor block.
* Prune blocks together in single query.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Create dummy test blocks and refactor test code.
* Intial test for pruning block in a chain without branches.
* Add test for pruning with multiple branches.
* Add test for pruning at frothy region.
* Test for pruning block at height more than max reorg depth.
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
* Implement block filler for uni-info-watcher.
* Pull common code for Block filler to util.
* Watch for job events in block filler command.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Implement heirarchical query for getting previous entity.
* Check entity id in hierarchical query to limit number of recursions.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Insert and remove a dummy BlockProgress from db.
* Test to fetch a Token entity from pruned region.
* Check if db is empty initially.
* Test to fetch a Token entity from frothy region.
* Test to fetch a Token from frothy region (same block num).
* Test to fetch a Token entity from another branch.
* Tests to fetch a Token entity (multiple tokens).
* Test to fetch updated Token entity in pruned region.
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
* Implement watcher for Lighthouse StorageRequest event.
* Add smoke test for lighthouse watcher.
* Add fileCost as value to Lighthouse store call.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Add resolver for Position entity in uni-info-watcher.
* Test for entities after TransferEvent.
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
* Run db operations inside event handlers atomically using transaction.
* Implement database transaction for Pool Initialize event.
* Implement typeorm transaction without callback.
* Implement transaction for NFPM event handlers.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Test for Token & Factory entities after MintEvent.
* Test for Pool, Mint & Tick entities after MintEvent.
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
* Smoke test for uni-info-watcher and refactor token deployment code.
* Test for Token entity after PoolCreated event.
* Test for Pool entity after PoolCreated event.
* Tests for entities after InitializeEvent.
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
* Implement transaction from to set entity origin field.
* Add all transaction fields specified in schema and add delay in uni-info block processing.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Created a smoke test for uni-watcher.
* Added test for createPool.
* Added more pool tests.
* Using ethers instead of hardhat-ethers in smoke test.
Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
* Use getEntities to get result for queries.
* Implement resolver for Mint entity.
* Implement resolvers for Pool and PoolDayData entities.
* Add query resolver for Swap entity.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Implement last processed event in uni-info-watcher.
* Check if block or event is already processed.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Implement eth_call for ERC20 totalSupply.
* Use eth_call for erc20-watcher.
* Implement fallback for ERC20 symbol method call.
* Implement fallback for ERC20 name and totalSupply.
* implement fallback for erc20 decimals method.
* Lint fixes.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Watch all blocks and fetch events for each block.
* Implement getPrevVersionEntity in database.
* Implement getPrevVersionEntity for PoolCreated event.
* Implement getPrevEntityVersion for Pool events.
* Implement getPrevEntityVersion for NFPM events.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Split get and set entity for PoolCreated and Initialize events.
* Split get/set entity for Mint, Burn and Swap events.
* Split get/set entity for IncreaseLiquidity and DecreaseLiquidity events.
* Split get/set for NFPM Transfer and Collect events.
* Add blockHash to entities.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Handle reorgs upto known canonical block hash.
* Process block events strictly in order.
* Support filling old blocks, process in-order.
* Always publish block progress.