Skip to content

Commit

Permalink
Uncomment out cold state tests (#5252)
Browse files Browse the repository at this point in the history
* Fixed most of the tests

* All tests passing

* All tests passing

* Fix merge conflict

* Fixed error test

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
terencechain and prylabs-bulldozer[bot] committed Mar 31, 2020
1 parent c8f8e3f commit e22365c
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 277 deletions.
3 changes: 3 additions & 0 deletions beacon-chain/db/kv/blocks.go
Expand Up @@ -338,6 +338,9 @@ func (k *Store) HighestSlotBlocksBelow(ctx context.Context, slot uint64) ([]*eth
err := k.db.View(func(tx *bolt.Tx) error {
sBkt := tx.Bucket(slotsHasObjectBucket)
savedSlots := sBkt.Get(savedBlockSlotsKey)
if len(savedSlots) == 0 {
savedSlots = bytesutil.MakeEmptyBitlists(int(slot))
}
highestIndex, err := bytesutil.HighestBitIndexAt(savedSlots, int(slot))
if err != nil {
return err
Expand Down
3 changes: 3 additions & 0 deletions beacon-chain/db/kv/state.go
Expand Up @@ -379,6 +379,9 @@ func (k *Store) HighestSlotStatesBelow(ctx context.Context, slot uint64) ([]*sta
err := k.db.View(func(tx *bolt.Tx) error {
slotBkt := tx.Bucket(slotsHasObjectBucket)
savedSlots := slotBkt.Get(savedStateSlotsKey)
if len(savedSlots) == 0 {
savedSlots = bytesutil.MakeEmptyBitlists(int(slot))
}
highestIndex, err := bytesutil.HighestBitIndexAt(savedSlots, int(slot))
if err != nil {
return err
Expand Down

0 comments on commit e22365c

Please sign in to comment.