go-ethereum/rlp
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
..
internal/rlpstruct all: fix docstrings 2022-10-04 09:18:02 +02:00
rlpgen refactor: generate internal Header.encodeRLP() for override (#86) 2024-12-11 10:20:58 +00:00
decode.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
decode_tail_test.go all: update license information 2016-04-15 09:48:05 +02:00
decode_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
doc.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00
encbuffer.go rlp: use identical receiver names for encBuffer methods (#27430) 2023-06-07 12:40:06 +02:00
encbuffer_example_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
encode.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
encode_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
encoder_example_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
iterator.go all: add whitespace linter (#25312) 2022-07-25 13:14:03 +03:00
iterator_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
raw.go p2p/discover: improve discv5 NODES response packing (#26033) 2022-11-07 19:19:02 +01:00
raw_test.go rlp: improve tests for Split functions (#26200) 2022-11-17 14:19:03 +01:00
safe.go rlp: minor optimizations for slice/array encoding (#23467) 2021-08-25 19:01:10 +02:00
typecache.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
unsafe.go rlp: minor optimizations for slice/array encoding (#23467) 2021-08-25 19:01:10 +02:00