Skip to content

Commit

Permalink
fix: FixedLength method err
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhen authored and fearlessfe committed Apr 8, 2024
1 parent 04d1d44 commit 89802fe
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions eth2/beacon/capella/lightclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewLightClientBootstrapType(spec *common.Spec) *view.ContainerTypeDef {
}

func (lcb *LightClientBootstrap) FixedLength(spec *common.Spec) uint64 {
return codec.ContainerLength(&lcb.Header, spec.Wrap(&lcb.CurrentSyncCommittee), &lcb.CurrentSyncCommitteeBranch)
return 0
}

func (lcb *LightClientBootstrap) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error {
Expand Down Expand Up @@ -175,15 +175,7 @@ func (lcu *LightClientUpdate) ByteLength(spec *common.Spec) uint64 {
}

func (lcu *LightClientUpdate) FixedLength(spec *common.Spec) uint64 {
return codec.ContainerLength(
&lcu.AttestedHeader,
spec.Wrap(&lcu.NextSyncCommittee),
&lcu.NextSyncCommitteeBranch,
&lcu.FinalizedHeader,
&lcu.FinalityBranch,
spec.Wrap(&lcu.SyncAggregate),
&lcu.SignatureSlot,
)
return 0
}

func (lcu *LightClientUpdate) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root {
Expand Down Expand Up @@ -217,7 +209,7 @@ func LightClientFinalityUpdateType(spec *common.Spec) *view.ContainerTypeDef {
}

func (lcfu *LightClientFinalityUpdate) FixedLength(spec *common.Spec) uint64 {
return codec.ContainerLength(&lcfu.AttestedHeader, &lcfu.FinalizedHeader, &lcfu.FinalityBranch, spec.Wrap(&lcfu.SyncAggregate), &lcfu.SignatureSlot)
return 0
}

func (lcfu *LightClientFinalityUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error {
Expand Down Expand Up @@ -259,7 +251,7 @@ func LightClientOptimisticUpdateType(spec *common.Spec) *view.ContainerTypeDef {
}

func (lcou *LightClientOptimisticUpdate) FixedLength(spec *common.Spec) uint64 {
return codec.ContainerLength(&lcou.AttestedHeader, spec.Wrap(&lcou.SyncAggregate), &lcou.SignatureSlot)
return 0
}

func (lcou *LightClientOptimisticUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error {
Expand Down

0 comments on commit 89802fe

Please sign in to comment.