Skip to content
New issue

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

accounts/abi/bind Handle structs used only as constructor params #23940

Merged
merged 1 commit into from Dec 2, 2021

Conversation

divergencetech
Copy link
Contributor

Fixes issue #23939

The structs map is populated by iterating over all methods except the constructor,
which results in a nil-pointer dereference.

I've first reproduced the problem with a new test and then implemented the fix.

…arams

Fixes issue ethereum#23939

The `structs` map is populated by iterating over all methods except the constructor,
which results in a nil-pointer dereference.

I've first reproduced the problem with a new test and then implemented the fix.
}
// Generate the test file with the injected test code
code := fmt.Sprintf(`
t.Run(tt.name, func(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff here suggests more substantial changes than I've actually performed. I've merely run each test as a sub-test for improved reporting as they're easier to read than test %d.

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@divergencetech
Copy link
Contributor Author

divergencetech commented Nov 23, 2021

Thanks for the quick review.

Is it possible to rerun the checks? The failing test looks spurious and unrelated. I've run make test on my branch without issue.

@holiman
Copy link
Contributor

holiman commented Nov 25, 2021

Is it possible to rerun the checks?

Doing that now

@rjl493456442 rjl493456442 added this to the 1.10.14 milestone Nov 29, 2021
@holiman holiman merged commit b45931c into ethereum:master Dec 2, 2021
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
…params (ethereum#23940)

The `structs` map is populated by iterating over all methods except the constructor, which results in a nil-pointer dereference.

I've first reproduced the problem with a new test and then implemented the fix.

Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
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.

None yet

5 participants