Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.allEvents throws #354

Closed
simov opened this issue Dec 14, 2015 · 0 comments
Closed

.allEvents throws #354

simov opened this issue Dec 14, 2015 · 0 comments
Labels
Bug Addressing a bug

Comments

@simov
Copy link
Contributor

simov commented Dec 14, 2015

web3 0.15.1

var contract = initContract()

var event = contract.allEvents({}, {fromBlock: 0, toBlock: 'latest'})

event.watch(function (err, result) {
  if (err) console.log(err)
  console.log(result)
})
{ address: '0x7318ffe0cec891cdba72db4f8f1b48ae5116c281',
  blockNumber: 1731,
  logIndex: 0,
  blockHash: '0x64c37edb40aeeea4c84ef8b033bbb47e3f78b526ed782d7057c6a6eb1826895e',
  transactionHash: '0x384e885f0cf4e9632d55195e0b66429c565d0a60af52b14e73211320004ddd5f',
  transactionIndex: 0,
  event: 'commissioningAddEvent',
  args: 
   { sender: '0x2595d94981fbf2abab6fb999c810ab47878fc645',
     epc: 'urn:epc:id:sgtin:0614141.112345.654321',
     disposition: 'urn:epcglobal:hls:disp:active' } }
{ address: '0x7318ffe0cec891cdba72db4f8f1b48ae5116c281',
  blockNumber: 1731,
  logIndex: 1,
  blockHash: '0x64c37edb40aeeea4c84ef8b033bbb47e3f78b526ed782d7057c6a6eb1826895e',
  transactionHash: '0x384e885f0cf4e9632d55195e0b66429c565d0a60af52b14e73211320004ddd5f',
  transactionIndex: 0,
  event: 'locationLog',
  args: 
   { epc: 'urn:epc:id:sgtin:0614141.112345.654321',
     readPoint: 'urn:epc:id:sgln:0614141.00729.rp97',
     bizLocation: 'urn:epc:id:sgln:0614141.00729.loc5' } }
{ address: '0x7318ffe0cec891cdba72db4f8f1b48ae5116c281',
  blockNumber: 1731,
  logIndex: 2,
  blockHash: '0x64c37edb40aeeea4c84ef8b033bbb47e3f78b526ed782d7057c6a6eb1826895e',
  transactionHash: '0x384e885f0cf4e9632d55195e0b66429c565d0a60af52b14e73211320004ddd5f',
  transactionIndex: 0,
  event: 'timeLog',
  args: 
   { epc: 'urn:epc:id:sgtin:0614141.112345.654321',
     eventTime: '2006-06-25T00:01:00Z',
     eventTimeZoneOffset: '-06:00' } }
/media/SSD/node_modules/web3/lib/web3/filter.js:94
                    callback(null, message);
                    ^

TypeError: callback is not a function
    at /media/SSD/node_modules/web3/lib/web3/filter.js:94:21
    at Array.forEach (native)
    at /media/SSD/node_modules/web3/lib/web3/filter.js:93:26
    at Object.callback (/media/SSD/node_modules/web3/lib/web3/filter.js:210:21)
    at /media/SSD/node_modules/web3/lib/web3/method.js:142:25
    at /media/SSD/node_modules/web3/lib/web3/requestmanager.js:89:9
    at request.onreadystatechange (/media/SSD/node_modules/web3/lib/web3/httpprovider.js:114:13)
    at dispatchEvent (/media/SSD/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
    at setState (/media/SSD/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
    at IncomingMessage.<anonymous> (/media/SSD/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)
@frozeman frozeman added the Bug Addressing a bug label Dec 14, 2015
simov added a commit to simov/web3.js that referenced this issue Dec 16, 2015
For some reason when the callback is added through the watch method for allEvents,
the Filter ctor receives the options object in place of the callback.
Fixes web3#354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

2 participants