We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Forge
forge 0.1.0 (bea3ddc 2022-02-05T13:11:27.746438742+00:00)
forge test -vvvv
Linux
Write the following test
pragma solidity >=0.8.10; import "ds-test/test.sol"; contract Test is DSTest { event A(uint, uint); function setUp() public {} function test_event() public { uint a = 42; uint t = 9723; emit A(a, a); emit A(a, t); emit A(t, a); emit A(t, t); } }
Run forge test -vvvv. On my machine I get the output
[PASS] test_event() (gas: 5623) Traces: [5623] Test::test_event() ├─ emit A(: 42, : 42) ├─ emit A(: 9723, : 9723) ├─ emit A(: 42, : 42) ├─ emit A(: 9723, : 9723) └─ ← ()
The text was updated successfully, but these errors were encountered:
unfortunately this is upstream in ethabi.
ethabi
RawLog { topics: [0x83f86eb20c894914ecf65cefc94682009cdb5066a609e8428699fa87b19b5c57], data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42] } parsed: Log { params: [LogParam { name: "", value: Uint(42) }, LogParam { name: "", value: Uint(42) }] }
using just an ethabi::Event, unnamed parameters in events break log parsing.
Naming them fixes ethabi bug:
RawLog { topics: [0x83f86eb20c894914ecf65cefc94682009cdb5066a609e8428699fa87b19b5c57], data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42] } parsed: Log { params: [LogParam { name: "a", value: Uint(9723) }, LogParam { name: "b", value: Uint(42) }] }
edit: there is an open issue upstream: rust-ethereum/ethabi#206
Sorry, something went wrong.
Closing as Brock's workaround works and this is tracked in ethabi
No branches or pull requests
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.1.0 (bea3ddc 2022-02-05T13:11:27.746438742+00:00)
What command(s) is the bug in?
forge test -vvvv
Operating System
Linux
Describe the bug
Write the following test
Run
forge test -vvvv
. On my machine I get the outputThe text was updated successfully, but these errors were encountered: