I have this event:

event onSubmissionBoth(bytes32[] indexed docHash, string[] indexed doc4DHash);

Now I log into the event like this:

function submitHash(bytes32[] calldata docHash,string[] calldata doc4DHash) external onlyOwner() {
       emit onSubmissionBoth(docHash,doc4DHash);

But when I try to search it through web3.js I am a bit confused:

  • Can I search for docHash only? i.e only with one field.

  • Also trying this I get null:

    contract.events.onSubmissionBoth({ filters: {docHash:["hashValue"], doc4DHash:web3.utils.sha3(["stringValue"])}},(s,events)=>{ console.log(events) })

Is there a way to filter the two array fields? Because I only get null everytime I do it in this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.