Added db.BlocksBySlot and db.BlockRootsBySlot (#8184)

* Added blockBySlot and blockRootBySlot

* Changed to BlocksBySlot and BlockRootsBySlot

* Updated to use BlocksBySlot and BlockRootsBySlot

* Added missing passthrough to karfa exporter

* Return hasBlocks/hasBlockRoots in the new getters

* Fixed CI lint

* Replace call to bytes.Compare with bytes.Equal

* Reordered the returns of the new getters

Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
pinglamb
2021-01-13 02:31:15 +08:00
committed by GitHub
parent 015102c2d5
commit 9f423617cb
11 changed files with 156 additions and 19 deletions

View File

@@ -69,8 +69,7 @@ func main() {
// If the state is not available, roll back
for state == nil {
slot--
filter := filters.NewFilter().SetStartSlot(slot).SetEndSlot(slot)
rts, err := db.BlockRoots(context.Background(), filter)
_, rts, err := db.BlockRootsBySlot(context.Background(), slot)
if err != nil {
panic(err)
}