mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
beacon/types: rename Hash() -> Root()
This commit is contained in:
parent
da73defa70
commit
91e60d8d56
3 changed files with 4 additions and 4 deletions
|
|
@ -107,7 +107,7 @@ func blockHeadInfo(block *types.BeaconBlock) types.HeadInfo {
|
|||
if block == nil {
|
||||
return types.HeadInfo{}
|
||||
}
|
||||
return types.HeadInfo{Slot: block.Slot(), BlockRoot: block.Hash()}
|
||||
return types.HeadInfo{Slot: block.Slot(), BlockRoot: block.Root()}
|
||||
}
|
||||
|
||||
func (s *beaconBlockSync) updateEventFeed() {
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ func (api *BeaconLightApi) GetBeaconBlock(blockRoot common.Hash) (*types.BeaconB
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
computedRoot := block.Hash()
|
||||
computedRoot := block.Root()
|
||||
if computedRoot != blockRoot {
|
||||
return nil, fmt.Errorf("Beacon block root hash mismatch (expected: %x, got: %x)", blockRoot, computedRoot)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ func (b *BeaconBlock) Header() Header {
|
|||
}
|
||||
}
|
||||
|
||||
// Hash computes the hash of the block.
|
||||
func (b *BeaconBlock) Hash() common.Hash {
|
||||
// Root computes the SSZ root hash of the block.
|
||||
func (b *BeaconBlock) Root() common.Hash {
|
||||
return common.Hash(b.blockObj.HashTreeRoot(configs.Mainnet, tree.GetHashFn()))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue