Skip to content

Add tests from smoketest PR (shutter-api/pull/107)#689

Draft
konradkonrad wants to merge 4 commits intomainfrom
etd_arraydecoding
Draft

Add tests from smoketest PR (shutter-api/pull/107)#689
konradkonrad wants to merge 4 commits intomainfrom
etd_arraydecoding

Conversation

@konradkonrad
Copy link
Copy Markdown
Contributor

@konradkonrad konradkonrad commented Mar 31, 2026

This PR adds a test that documents a shortcoming in event trigger definitions: currently we do not have expressions to match on array types other than []byte (i.e. uint256[], ...) in event data. Output from the failing test:

go test -run Smoke                                        
--- FAIL: TestDynamicEventFromSmokeTests (0.04s)
    eventtrigger_test.go:2342: assertion failed: expression is false: match: we could not match uint256[] as []byte.
        event data is [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 96 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 160 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 224 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 5 104 101 108 108 111 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 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 2 190 239 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 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 2 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 1 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 2]
        extracted value `GetValue(…)` at offset 224 is [0 0]
FAIL
exit status 1

It adds other test cases from shutter-network/shutter-api#107 that are passing.

Note: from my understanding the current implementation can not support arrays and probably no struct types either, because we're missing the necessary type hints in the serialized event trigger definition for decoding these from event log data. If we find use cases with events that need support for these, we will need to add information to LogValueRef beyond the bool Dynamic flag.

@konradkonrad konradkonrad changed the title Add test for failed matches on array types Add tests from smoketest PR (shutter-api/pulls/107) Mar 31, 2026
@konradkonrad konradkonrad changed the title Add tests from smoketest PR (shutter-api/pulls/107) Add tests from smoketest PR (shutter-api/pull/107) Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant