Skip to content

Commit

Permalink
Rename to OptionalExecutionHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Mar 12, 2024
1 parent 5213ba8 commit ddf7e6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions relayer/relays/beacon/header/syncer/scale/beacon_scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@ type UpdatePayload struct {
FinalityBranch []types.H256
BlockRootsRoot types.H256
BlockRootsBranch []types.H256
ExecutionHeader OptionExecutionHeader
ExecutionBranch OptionExecutionBranch
ExecutionHeader OptionalExecutionHeader
ExecutionBranch OptionalExecutionBranch
}

type OptionExecutionHeader struct {
type OptionalExecutionHeader struct {
HasValue bool
Value VersionedExecutionPayloadHeader
}

func (o OptionExecutionHeader) Encode(encoder scale.Encoder) error {
func (o OptionalExecutionHeader) Encode(encoder scale.Encoder) error {
return encoder.EncodeOption(o.HasValue, o.Value)
}

type OptionExecutionBranch struct {
type OptionalExecutionBranch struct {
HasValue bool
Value []types.H256
}

func (o OptionExecutionBranch) Encode(encoder scale.Encoder) error {
func (o OptionalExecutionBranch) Encode(encoder scale.Encoder) error {
return encoder.EncodeOption(o.HasValue, o.Value)
}

Expand Down
8 changes: 4 additions & 4 deletions relayer/relays/beacon/header/syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ func (s *Syncer) GetSyncCommitteePeriodUpdate(from uint64) (scale.Update, error)
FinalityBranch: util.ProofBranchToScale(committeeUpdate.FinalityBranch),
BlockRootsRoot: blockRootsProof.Leaf,
BlockRootsBranch: blockRootsProof.Proof,
ExecutionHeader: scale.OptionExecutionHeader{
ExecutionHeader: scale.OptionalExecutionHeader{
HasValue: true,
Value: executionPayloadHeader,
},
ExecutionBranch: scale.OptionExecutionBranch{
ExecutionBranch: scale.OptionalExecutionBranch{
HasValue: true,
Value: executionBranch,
},
Expand Down Expand Up @@ -277,11 +277,11 @@ func (s *Syncer) GetFinalizedUpdate() (scale.Update, error) {
FinalityBranch: util.ProofBranchToScale(finalizedUpdate.Data.FinalityBranch),
BlockRootsRoot: blockRootsProof.Leaf,
BlockRootsBranch: blockRootsProof.Proof,
ExecutionHeader: scale.OptionExecutionHeader{
ExecutionHeader: scale.OptionalExecutionHeader{
HasValue: true,
Value: executionPayloadHeader,
},
ExecutionBranch: scale.OptionExecutionBranch{
ExecutionBranch: scale.OptionalExecutionBranch{
HasValue: true,
Value: executionBranch,
},
Expand Down

0 comments on commit ddf7e6a

Please sign in to comment.