@@ -231,12 +231,47 @@ it('validates max number of allowed topics', async () => {
231231 assert . equal ( response . body . error . message , 'invalid argument 0: exceed max topics' )
232232} )
233233
234+ it ( 'validates max number of allowed addresses' , async ( ) => {
235+ let latestBlockNumber = await web3 . eth . getBlockNumber ( )
236+ let latestBlock = await web3 . eth . getBlock ( latestBlockNumber )
237+
238+ let addresses = [ ]
239+ for ( let i = 0 ; i <= 1000 ; i ++ ) {
240+ addresses . push (
241+ '0x0000000071727de22e5e9d8baf0edac6f37da032'
242+ )
243+ }
244+
245+ let blockRangeFilter = {
246+ fromBlock : web3 . utils . numberToHex ( latestBlock . number ) ,
247+ toBlock : web3 . utils . numberToHex ( latestBlock . number ) ,
248+ address : addresses ,
249+ topics : [ ]
250+ }
251+
252+ let response = await helpers . callRPCMethod ( 'eth_getLogs' , [ blockRangeFilter ] )
253+ assert . equal ( response . status , 200 )
254+ assert . isDefined ( response . body . error )
255+ assert . equal ( response . body . error . message , 'invalid argument 0: exceed max addresses' )
256+
257+ let blockHashFilter = {
258+ blockHash : latestBlock . hash ,
259+ address : addresses ,
260+ topics : [ ]
261+ }
262+
263+ response = await helpers . callRPCMethod ( 'eth_getLogs' , [ blockHashFilter ] )
264+ assert . equal ( response . status , 200 )
265+ assert . isDefined ( response . body . error )
266+ assert . equal ( response . body . error . message , 'invalid argument 0: exceed max addresses' )
267+ } )
268+
234269it ( 'validates max number of allowed sub-topics' , async ( ) => {
235270 let latestBlockNumber = await web3 . eth . getBlockNumber ( )
236271 let latestBlock = await web3 . eth . getBlock ( latestBlockNumber )
237272
238273 let subTopics = [ ]
239- for ( i = 0 ; i <= 1000 ; i ++ ) {
274+ for ( let i = 0 ; i <= 1000 ; i ++ ) {
240275 subTopics . push (
241276 '0x76efea95e5da1fa661f235b2921ae1d89b99e457ec73fb88e34a1d150f95c64b'
242277 )
0 commit comments