From 564ba9289b4eb9decfdf50426686275cbeddc2ea Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Wed, 16 May 2018 13:19:07 -0400 Subject: [PATCH] sharding: fix return vals Former-commit-id: a2f65331fc92769379c1ccedd6627b60fe9d2f09 [formerly 09821d41c9080b71c58fc875af58db8865b2790c] Former-commit-id: 451cc1b39255039700a92b6f4c0bd6c7b5966b1f --- sharding/shard.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sharding/shard.go b/sharding/shard.go index 91ef580eb..76f31cb60 100644 --- a/sharding/shard.go +++ b/sharding/shard.go @@ -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) } - collation, err := s.CollationByHash(h) - if err != nil { - return nil, fmt.Errorf("no canonical collation found for hash: %v", err) - } - return collation, nil + return s.CollationByHash(h) } // BodyByChunkRoot fetches a collation body. @@ -184,12 +180,8 @@ func (s *Shard) SaveBody(body []byte) error { // chunkRoot := getChunkRoot(body) using the blob algorithm utils. // right now we will just take the raw keccak256 of the body until #92 is merged. chunkRoot := common.BytesToHash(body) - - if err := s.shardDB.Put(chunkRoot, body); err != nil { - return err - } s.SetAvailability(&chunkRoot, true) - return nil + return s.shardDB.Put(chunkRoot, body) } // SaveCollation adds the collation's header and body to shardDB.