mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-02-09 03:22:50 +00:00
a7ec3d8da8
* 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>
36 lines
842 B
TypeScript
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);
|
|
});
|