You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getPastEvents should work correctly regardless of the event's location at the smart contract.
Actual behavior
Throws an error like this when the event which is producing this bug is right below the another event.
Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.0.0-beta.153)
Steps to reproduce the behavior
[This produces the error]
Here's my full code. LogRequest event which is the first located event works fine on getPastEvents. But, LogResponse event which is located below the LogRequest event produces this error.
Hi there, I've tested your example code via my test repo and it seems to be working in the latest release candidate. Can you confirm that your original issue is resolved using the release candidate?
FYI, I removed the indexed tags from your events LogRequest and LogResponse because Solidity returns the hash of an array in an event instead of the actual value. If you'd like the actual value to be emitted, you must remove the indexed tag
If you use arrays (including string and bytes) as indexed arguments, its Keccak-256 hash is stored as a topic instead, this is because a topic can only hold a single word (32 bytes).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.
Expected behavior
getPastEvents
should work correctly regardless of the event's location at the smart contract.Actual behavior
Throws an error like this when the event which is producing this bug is right below the another event.
Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.0.0-beta.153)
Steps to reproduce the behavior
Here's my full code.
LogRequest
event which is the first located event works fine ongetPastEvents
. But,LogResponse
event which is located below theLogRequest
event produces this error.When I put the
LogResponse
event between two functions, this works fine. Weird... It's structure looks like this below.Logs
The error log is at the
Actual behavior
corner.Environment
npm: 6.14.6
Node: 12.18.3
Truffle: 5.1.37
solc: 0.5.0
web3.js: 1.3.0
OS: macOS Catalina 10.15.6
The text was updated successfully, but these errors were encountered: