Skip to content

Commit 5c72beb

Browse files
committed
Rename hasOptionalField -> hasAnyOptionalFieldSet
1 parent 4566b28 commit 5c72beb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

core/types/block.internal.libevm_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
"github.com/stretchr/testify/assert"
1010
)
1111

12-
func Test_Body_hasOptionalFields(t *testing.T) {
12+
func Test_Body_hasAnyOptionalFieldSet(t *testing.T) {
1313
t.Parallel()
1414

1515
var body Body
1616

17-
assert.False(t, body.hasOptionalFields(), "body has no optional field set")
17+
assert.False(t, body.hasAnyOptionalFieldSet(), "body has no optional field set")
1818

1919
v := reflect.ValueOf(&body).Elem()
2020
typ := reflect.TypeOf(body)
@@ -35,7 +35,7 @@ func Test_Body_hasOptionalFields(t *testing.T) {
3535
t.Errorf("unexpected field kind %q for field %q", field.Kind(), fieldType.Name)
3636
}
3737

38-
assert.Truef(t, body.hasOptionalFields(), "body has the optional field %q set", fieldType.Name)
38+
assert.Truef(t, body.hasAnyOptionalFieldSet(), "body has the optional field %q set", fieldType.Name)
3939
field.Set(reflect.ValueOf(before)) // reset the field
4040
}
4141
}

core/types/block.libevm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (b *Body) EncodeRLP(dst io.Writer) error {
135135
return err
136136
}
137137

138-
hasLaterOptionalField := b.hasOptionalFields()
138+
hasLaterOptionalField := b.hasAnyOptionalFieldSet()
139139
if err := b.hooks().AppendRLPFields(w, hasLaterOptionalField); err != nil {
140140
return err
141141
}
@@ -146,7 +146,7 @@ func (b *Body) EncodeRLP(dst io.Writer) error {
146146
})
147147
}
148148

149-
func (b *Body) hasOptionalFields() bool {
149+
func (b *Body) hasAnyOptionalFieldSet() bool {
150150
return b.Withdrawals != nil
151151
}
152152

0 commit comments

Comments
 (0)