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

feat(core/types): body RLP hooks registration #130

Merged
merged 8 commits into from
Feb 12, 2025

Conversation

qdm12
Copy link
Collaborator

@qdm12 qdm12 commented Feb 11, 2025

Why this should be merged

Allow to register body extras in consumers of libevm.

How this works

How this was tested

Existing tests modified.

@qdm12 qdm12 force-pushed the qdm12/core/types/body-hooks-rlp branch from f037b1a to 9fe07d4 Compare February 11, 2025 15:05
core/types/block.go Outdated Show resolved Hide resolved
core/types/block.libevm.go Outdated Show resolved Hide resolved
core/types/block.libevm.go Show resolved Hide resolved
core/types/block.libevm_test.go Outdated Show resolved Hide resolved
core/types/rlp_backwards_compat.libevm_test.go Outdated Show resolved Hide resolved
core/types/rlp_backwards_compat.libevm_test.go Outdated Show resolved Hide resolved
core/types/rlp_backwards_compat.libevm_test.go Outdated Show resolved Hide resolved
core/types/rlp_backwards_compat.libevm_test.go Outdated Show resolved Hide resolved
core/types/rlp_payload.libevm.go Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/core/types/body-hooks-rlp branch 2 times, most recently from 30145a2 to 5cc4a70 Compare February 11, 2025 15:41
@qdm12 qdm12 force-pushed the qdm12/core/types/body-hooks-rlp branch from de572a1 to 99c0b34 Compare February 11, 2025 17:08
@qdm12 qdm12 force-pushed the qdm12/core/types/body-hooks-rlp branch 3 times, most recently from 3ff6b2c to 0f2b8ee Compare February 11, 2025 17:56
@qdm12 qdm12 marked this pull request as ready for review February 11, 2025 17:58
core/state/state.libevm_test.go Outdated Show resolved Hide resolved
core/state/state_object.libevm_test.go Outdated Show resolved Hide resolved
core/state/state_object.libevm_test.go Outdated Show resolved Hide resolved
core/state/state_object.libevm_test.go Outdated Show resolved Hide resolved
core/types/block.libevm.go Outdated Show resolved Hide resolved
core/types/state_account.libevm_test.go Outdated Show resolved Hide resolved
core/types/state_account_storage.libevm_test.go Outdated Show resolved Hide resolved
core/types/state_account_storage.libevm_test.go Outdated Show resolved Hide resolved
core/types/state_account_storage.libevm_test.go Outdated Show resolved Hide resolved
core/types/state_account_storage.libevm_test.go Outdated Show resolved Hide resolved
@qdm12 qdm12 force-pushed the qdm12/core/types/body-hooks-rlp branch from d3fc726 to 2c46b58 Compare February 12, 2025 08:27
@qdm12 qdm12 requested a review from ARR4N February 12, 2025 08:35
ARR4N added a commit that referenced this pull request Feb 12, 2025
…types_test` (#131)

## Why this should be merged

Simplify testing in #130.

## How this works

Backwards-compatibility tests were originally created in `package
types_test` because the first one uses `ethtest` and would have caused a
circular dependency. None of the later tests have this issue so they
were moved into `package types`. The `cmpeth` test utility isn't
currently needed anywhere else so its functionality is collapsed inside
this new file.

## How this was tested

N/A as simply moving existing tests to different files.
@qdm12 qdm12 enabled auto-merge (squash) February 12, 2025 11:21
@qdm12 qdm12 requested a review from ARR4N February 12, 2025 11:21
Copy link
Collaborator

@ARR4N ARR4N left a comment

Choose a reason for hiding this comment

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

LFG 🚀

Comment on lines +89 to +90
require.NoErrorf(t, err, "rlp.DecodeBytes(rlp.EncodeToBytes(%T), %T) resulted in %s",
(*withoutMethods)(body), got, pretty.Sprint(got))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
require.NoErrorf(t, err, "rlp.DecodeBytes(rlp.EncodeToBytes(%T), %T) resulted in %s",
(*withoutMethods)(body), got, pretty.Sprint(got))
require.NoErrorf(
t, err, "rlp.DecodeBytes(rlp.EncodeToBytes(%T), %T) resulted in %s",
(*withoutMethods)(body), got, pretty.Sprint(got),
)

This isn't 🐍 Python 😛

Copy link
Collaborator

Choose a reason for hiding this comment

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

Didn't see the auto merge. I'll do it in my PR.

@qdm12 qdm12 merged commit b2c38ce into main Feb 12, 2025
5 checks passed
@qdm12 qdm12 deleted the qdm12/core/types/body-hooks-rlp branch February 12, 2025 11:38
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.

2 participants