初学者的坚固性:getPastEvents不是函数

时间:2019-05-15 22:45:17

标签: ethereum solidity truffle

这是我对Etherum的第一个实验,当我尝试检索过去的事件时遇到此错误。 Web3版本:^ 1.0.0-beta.55

App.todoList.getPastEvents is not a function

这是我的js文件

getEvents: async () => {
      const todoList = await $.getJSON('TodoList.json')
      todoList.getPastEvents('TaskCreated', {
        filter: {myIndexedParam: [20,23], myOtherIndexedParam: '0x123456789...'}, 
        fromBlock: 0,
        toBlock: 'latest'
      }, (error, events) => { console.log(events); })
      .then((events) => {
          console.log(events) // same results as the optional callback above
      });

    }

预先感谢 安德里亚

0 个答案:

没有答案