mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-06 01:32:18 +00:00
sharding: fix return vals
Former-commit-id: a2f65331fc92769379c1ccedd6627b60fe9d2f09 [formerly 09821d41c9080b71c58fc875af58db8865b2790c] Former-commit-id: 451cc1b39255039700a92b6f4c0bd6c7b5966b1f
This commit is contained in:
parent
3a94b098aa
commit
564ba9289b
@ -115,11 +115,7 @@ func (s *Shard) CanonicalCollation(shardID *big.Int, period *big.Int) (*Collatio
|
|||||||
return nil, fmt.Errorf("error while getting canonical header hash: %v", err)
|
return nil, fmt.Errorf("error while getting canonical header hash: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
collation, err := s.CollationByHash(h)
|
return s.CollationByHash(h)
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("no canonical collation found for hash: %v", err)
|
|
||||||
}
|
|
||||||
return collation, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// BodyByChunkRoot fetches a collation body.
|
// BodyByChunkRoot fetches a collation body.
|
||||||
@ -184,12 +180,8 @@ func (s *Shard) SaveBody(body []byte) error {
|
|||||||
// chunkRoot := getChunkRoot(body) using the blob algorithm utils.
|
// chunkRoot := getChunkRoot(body) using the blob algorithm utils.
|
||||||
// right now we will just take the raw keccak256 of the body until #92 is merged.
|
// right now we will just take the raw keccak256 of the body until #92 is merged.
|
||||||
chunkRoot := common.BytesToHash(body)
|
chunkRoot := common.BytesToHash(body)
|
||||||
|
|
||||||
if err := s.shardDB.Put(chunkRoot, body); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
s.SetAvailability(&chunkRoot, true)
|
s.SetAvailability(&chunkRoot, true)
|
||||||
return nil
|
return s.shardDB.Put(chunkRoot, body)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveCollation adds the collation's header and body to shardDB.
|
// SaveCollation adds the collation's header and body to shardDB.
|
||||||
|
Loading…
Reference in New Issue
Block a user