go-ethereum/rlp
Ceyhun Onur 9ed36b613a
feat: Add support for named types with underlying basic types (#236)
## Why this should be merged

The current rlpgen partially supports named types with basic underlying,
and it generates the rlp without correct conversion i.e:
`w.WriteUint64(obj.Uint64NewT)`

This PR adds the full support it

## How this works

Adds check for `isNamedWithBasicUnderlying` and then returns a `op` with
`makeNamedBasicOp` which is basically a `basicOp` but with the `typ`
refers to the named type so that it can correctly encode decode with the
named type.

## How this was tested

Added UT tests

---------

Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
2025-10-08 08:07:57 +01:00
..
internal/rlpstruct all: fix docstrings 2022-10-04 09:18:02 +02:00
rlpgen feat: Add support for named types with underlying basic types (#236) 2025-10-08 08:07:57 +01: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
fields.libevm.go refactor(core/types): simplify Body RLP override (#120) 2025-02-07 15:42:25 +00:00
fields.libevm_test.go refactor(core/types): simplify Body RLP override (#120) 2025-02-07 15:42:25 +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
list.libevm.go feat(core/types): fine-grained Body RLP override (#109) 2025-02-05 10:52:28 +00:00
list.libevm_test.go feat(core/types): fine-grained Body RLP override (#109) 2025-02-05 10:52:28 +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