-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathlogs.js
35 lines (32 loc) · 863 Bytes
/
logs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const EtherscanAPI = require('../src')
describe('Etherscan logs methods', () => {
const e = new EtherscanAPI()
test('getEventsLogs', async () => {
const logs = await e.getEventsLogs(
'0x33990122638b9132ca29c723bdf037f1a891a70c',
{
fromBlock: 379224,
toBlock: 400000,
topic0:
'0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545',
topic01operator: 'and',
topic1:
'0x72657075746174696f6e00000000000000000000000000000000000000000000'
}
)
expect(Array.isArray(logs)).toBe(true)
expect(logs.length).not.toBe(0)
expect(logs[0]).not.toEqual([
'address',
'topics',
'data',
'blockNumber',
'timeStamp',
'gasPrice',
'gasUsed',
'logIndex',
'transactionHash',
'transactionIndex'
])
})
})