@@ -38,14 +38,14 @@ describe('Events', () => {
38
38
address : receiptTest . contractAddress ,
39
39
fromBlock : 3 ,
40
40
toBlock : 'latest' ,
41
- topics : [ '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' , '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
41
+ topics : [ '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
42
42
} )
43
43
44
44
let ownerLogs = await web3 . eth . getPastLogs ( {
45
45
address : receiptOwner . contractAddress ,
46
46
fromBlock : 3 ,
47
47
toBlock : 'latest' ,
48
- topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' , '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
48
+ topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
49
49
} )
50
50
51
51
// this should include the event triggered by the "set" transaction call.
@@ -56,7 +56,7 @@ describe('Events', () => {
56
56
address : receiptOwner . contractAddress ,
57
57
fromBlock : 2 ,
58
58
toBlock : 'latest' ,
59
- topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' , '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
59
+ topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
60
60
} )
61
61
// this should include the event triggered from the ctor.
62
62
assert . equal ( ownerLogs . length , 2 , '3) ownerLogs length should be equal to 2' )
@@ -65,10 +65,19 @@ describe('Events', () => {
65
65
address : receiptOwner . contractAddress ,
66
66
fromBlock : 1 ,
67
67
toBlock : 2 ,
68
- topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' , '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
68
+ topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
69
69
} )
70
70
// this should only include the event triggered from the ctor.
71
71
assert . equal ( ownerLogs . length , 1 , '4) ownerLogs length should be equal to 1' )
72
+
73
+ ownerLogs = await web3 . eth . getPastLogs ( {
74
+ address : receiptOwner . contractAddress ,
75
+ fromBlock : 1 ,
76
+ toBlock : 2 ,
77
+ topics : [ [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' , '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ] ]
78
+ } )
79
+ // 0xdcd9c7fa0342f01013b is a topic from a event emitted by the other contract and should not be take into account.
80
+ assert . equal ( ownerLogs . length , 1 , '5) ownerLogs length should be equal to 1' )
72
81
} )
73
82
} )
74
83
} )
0 commit comments