@@ -38,14 +38,14 @@ describe('Events', () => {
3838 address : receiptTest . contractAddress ,
3939 fromBlock : 3 ,
4040 toBlock : 'latest' ,
41- topics : [ '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' , '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
41+ topics : [ '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
4242 } )
4343
4444 let ownerLogs = await web3 . eth . getPastLogs ( {
4545 address : receiptOwner . contractAddress ,
4646 fromBlock : 3 ,
4747 toBlock : 'latest' ,
48- topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' , '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
48+ topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
4949 } )
5050
5151 // this should include the event triggered by the "set" transaction call.
@@ -56,7 +56,7 @@ describe('Events', () => {
5656 address : receiptOwner . contractAddress ,
5757 fromBlock : 2 ,
5858 toBlock : 'latest' ,
59- topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' , '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
59+ topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
6060 } )
6161 // this should include the event triggered from the ctor.
6262 assert . equal ( ownerLogs . length , 2 , '3) ownerLogs length should be equal to 2' )
@@ -65,10 +65,19 @@ describe('Events', () => {
6565 address : receiptOwner . contractAddress ,
6666 fromBlock : 1 ,
6767 toBlock : 2 ,
68- topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' , '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc' ]
68+ topics : [ '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735' ]
6969 } )
7070 // this should only include the event triggered from the ctor.
7171 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' )
7281 } )
7382 } )
7483} )
0 commit comments