watcher-ts/packages/solidity-mapper/src/logs.test.ts
Ashwin Phatak a7ec3d8da8
Add APGL license and copyright notices (#212)
* Add license & copyright declarations for add-watcher.

* Add copyright declarations for cache.

* Add copyright declarations for erc20-watcher.

* Add copyright declarations for ipld-eth-client.

* Add copyright declarations for tracing-client.

* Add copyright declarations for uni-watcher.

* Add copyright declarations for solidity-mapper.

* Add copyright declarations for uni-info-watcher.

* Add copyright declarations for util.

* Add copyright declarations for lighthouse-watcher.

* Change license identifier in .sol files.

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2021-08-12 15:28:13 +05:30

36 lines
842 B
TypeScript

//
// Copyright 2021 Vulcanize, Inc.
//
import { expect } from 'chai';
import '@nomiclabs/hardhat-ethers';
import { artifacts } from 'hardhat';
import { getEventNameTopics } from './logs';
const TEST_DATA = [
{
name: 'TestIntegers',
output: {}
},
{
name: 'TestEvents',
output: {
// Signature of event is a keccak256 hash of event name and input argument types.
// keccak256('Event1(string,string)')
Event1: '0xead5fc99a8133dbf3f4e87d1ada4e5a4cf65170fad6445d34042e643f6a30b79'
}
}
];
it('get event name topics', async () => {
const testPromises = TEST_DATA.map(async ({ name, output }) => {
const { abi } = await artifacts.readArtifact(name);
const eventNameTopics = getEventNameTopics(abi);
expect(eventNameTopics).to.eql(output);
});
await Promise.all(testPromises);
});