Skip to content

Commit 0d60e8e

Browse files
committed
refactor and add comments
1 parent 862645b commit 0d60e8e

File tree

3 files changed

+180
-73
lines changed

3 files changed

+180
-73
lines changed

op-service/eth/types.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,13 @@ type ExecutionPayload struct {
270270
WithdrawalsRoot *common.Hash `json:"withdrawalsRoot,omitempty"`
271271
}
272272

273-
func (p *ExecutionPayload) Compare(o *ExecutionPayload) error {
273+
func (p *ExecutionPayload) CheckEqual(o *ExecutionPayload) error {
274274
if p == nil || o == nil {
275275
if p == o {
276276
return nil
277277
}
278278
return fmt.Errorf("one of the payloads is nil: p=%v, o=%v", p, o)
279279
}
280-
281280
if p.ParentHash != o.ParentHash {
282281
return fmt.Errorf("ParentHash mismatch: %v != %v", p.ParentHash, o.ParentHash)
283282
}
@@ -359,7 +358,6 @@ func (p *ExecutionPayload) Compare(o *ExecutionPayload) error {
359358
if p.WithdrawalsRoot != nil && *p.WithdrawalsRoot != *o.WithdrawalsRoot {
360359
return fmt.Errorf("WithdrawalsRoot mismatch: %v != %v", *p.WithdrawalsRoot, *o.WithdrawalsRoot)
361360
}
362-
363361
return nil
364362
}
365363

op-sync-tester/synctester/backend/backend.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ type Session struct {
4646
InitialState FCUState
4747
}
4848

49+
func (s *Session) UpdateFCUState(latest, safe, finalized uint64) {
50+
s.CurrentState.Latest = latest
51+
s.CurrentState.Safe = safe
52+
s.CurrentState.Finalized = finalized
53+
}
54+
4955
type FCUState struct {
5056
Latest uint64
5157
Safe uint64

0 commit comments

Comments
 (0)