Skip to content

Commit dbc7ce0

Browse files
committed
fix(rlp): Nillable() decoding into field pointer
1 parent 6e350cf commit dbc7ce0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

core/types/rlp_backwards_compat.libevm_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,14 @@ func TestBodyRLPCChainCompat(t *testing.T) {
248248
wantRLPHex string
249249
}{
250250
{
251+
name: "nil ExtData",
251252
extra: &cChainBodyExtras{
252253
Version: version,
253254
},
254255
wantRLPHex: `e5dedd2a80809400000000000000000000000000decafc0ffeebad8080808080c08304cb2f80`,
255256
},
256257
{
258+
name: "non-nil ExtData",
257259
extra: &cChainBodyExtras{
258260
Version: version,
259261
ExtData: &[]byte{1, 4, 2, 8, 5, 7},

rlp/list.libevm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func (n *nillable[T]) DecodeRLP(s *Stream) error {
183183
return err
184184
}
185185
if size > 0 {
186-
return s.Decode(*n.v)
186+
return s.Decode(n.v)
187187
}
188188
*n.v = nil
189189
_, err = s.Raw() // consume the item

0 commit comments

Comments
 (0)