在Web3上使用字符串作为参数进行搜索

问题描述

我正在尝试使用字符串值作为事件中的参数进行搜索,但没有得到任何结果。这是我尝试过的web3:

const result = contract.getPastEvents(
    'Event',{
        filter: {
            Name:  web3.utils.sha3('Smith')
        },fromBlock: 0,toBlock: 'latest'
    },function(error,event){
        console.log(error);
    }
)
.then(function(event){
    $("#result").html(event[0].returnValues.Name);
});

我该怎么办?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)