Open olegshmuelov opened 1 year ago
ConsensusData GetBlockData should return versioned block only
// TODO func (ci *ConsensusData) GetBlockData() (*spec.VersionedBeaconBlock, error) { func (ci *ConsensusData) GetBlockData() (*spec.VersionedBeaconBlock, ssz.HashRoot, error) { switch ci.Version { case spec.DataVersionBellatrix: ret := &bellatrix.BeaconBlock{} if err := ret.UnmarshalSSZ(ci.DataSSZ); err != nil { return nil, nil, errors.Wrap(err, "could not unmarshal ssz") } return &spec.VersionedBeaconBlock{Bellatrix: ret, Version: spec.DataVersionBellatrix}, ret, nil default: return nil, nil, errors.Errorf("unknown block version %s", ci.Version.String()) } }
We currently return both versioned block and root because we do not utilize the internal Root() function versioned block has
ConsensusData GetBlockData should return versioned block only