clean up: godoc comments, redundant castings and more (#11428)

* clean up: Godoc comments, redundant castings and more

* Fix assertion check

* Update beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>

* Update beacon-chain/forkchoice/protoarray/store.go

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
This commit is contained in:
terencechain
2022-09-12 16:03:20 +02:00
committed by GitHub
parent 6cf4f3c260
commit d860daff75
13 changed files with 18 additions and 28 deletions

View File

@@ -275,7 +275,7 @@ func (p *PayloadStatus) MarshalJSON() ([]byte, error) {
var latestHash *common.Hash
if p.LatestValidHash != nil {
hash := common.Hash(bytesutil.ToBytes32(p.LatestValidHash))
latestHash = (*common.Hash)(&hash)
latestHash = &hash
}
return json.Marshal(payloadStatusJSON{
LatestValidHash: latestHash,
@@ -324,7 +324,7 @@ func (t *TransitionConfiguration) MarshalJSON() ([]byte, error) {
}
return json.Marshal(transitionConfigurationJSON{
TerminalTotalDifficulty: hexNum,
TerminalBlockHash: common.Hash(*(*[32]byte)(t.TerminalBlockHash)),
TerminalBlockHash: *(*[32]byte)(t.TerminalBlockHash),
TerminalBlockNumber: hexutil.Uint64(num.Uint64()),
})
}