go-ethereum/rlp/rlpgen
Arran Schlosberg aa183c52be
refactor: generate internal Header.encodeRLP() for override (#86)
## Why this should be merged

This is a precursor to being able to override `types.Header` RLP
{en,de}coding. As there is already a `Header.EncodeRLP()` method we
either have to modify the generated code or rename the generated
method—this PR does the latter.

## How this works

The `rlpgen -internal_methods` flag changes the generated methods from
`EncodeRLP()` and `DecodeRLP()` to `encodeRLP()` and `decodeRLP()`,
respectively. A new CI job checks that generated code is up to date. We
can then implement our own `Header.EncodeRLP()` that either overrides or
falls back on the original.

It appears that `core/gen_genesis.go` was out of date but only because
of formatting.

## How this was tested

I deliberately excluded the change to `core/types/gen_header_rlp.go` to
confirm that the new workflow
[detects](https://github.com/ava-labs/libevm/actions/runs/12259667481/job/34202386378?pr=86#step:5:92)
the change and fails. The actual change can be inspected via the code
diff.
2024-12-11 10:20:58 +00:00
..
testdata [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
gen.go refactor: generate internal Header.encodeRLP() for override (#86) 2024-12-11 10:20:58 +00:00
gen.libevm.go refactor: generate internal Header.encodeRLP() for override (#86) 2024-12-11 10:20:58 +00:00
gen_test.go rlp/rlpgen: print want/expect output string if mismatch (#26932) 2023-03-24 14:17:39 +01:00
main.go refactor: generate internal Header.encodeRLP() for override (#86) 2024-12-11 10:20:58 +00:00
types.go rlp: support for uint256 (#26898) 2023-03-17 06:51:55 -04:00