mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 08:54:05 +00:00
Handle increase liquidity event (#143)
* Implement handler for NFPM IncreaseLiquidity event. * Get contract values by querying uni-watcher. Co-authored-by: nabarun <nabarun@deepstacksoft.com>
This commit is contained in:
@@ -178,7 +178,7 @@ describe('Get value from storage', () => {
|
||||
const { storageLayout } = contracts.TestAddress;
|
||||
const { value, proof: { data: proofData } } = await getStorageValue(storageLayout, getStorageAt, blockHash, testAddress.address, 'address1');
|
||||
expect(value).to.be.a('string');
|
||||
expect(String(value).toLowerCase()).to.equal(address1Value);
|
||||
expect(value).to.equal(address1Value);
|
||||
|
||||
if (isIpldGql) {
|
||||
assertProofData(blockHash, testAddress.address, JSON.parse(proofData));
|
||||
|
||||
@@ -97,6 +97,10 @@ export const getValueByType = (storageValue: string, typeLabel: string): bigint
|
||||
return utils.toUtf8String(storageValue);
|
||||
}
|
||||
|
||||
if (typeLabel.startsWith('address')) {
|
||||
return utils.getAddress(storageValue);
|
||||
}
|
||||
|
||||
return storageValue;
|
||||
};
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export const getStorageAt: GetStorageAt = async ({ blockHash, contract, slot })
|
||||
*/
|
||||
export const generateDummyAddresses = (length: number): Array<string> => {
|
||||
return Array.from({ length }, () => {
|
||||
return ethers.utils.hexlify(ethers.utils.randomBytes(20));
|
||||
return ethers.utils.getAddress(ethers.utils.hexlify(ethers.utils.randomBytes(20)));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user