mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
11b90e1f63
* fresh database checks * gaz * fix up tests * fix test * build * bellatrix pass tests * fix flags * gaz * fix up rpc test * gaz * building * refactor, remove boolean blindness * kv blocks * fix up ensure coverage * e2e default * add missing case * nishant feedback: * log --------- Co-authored-by: Nishant Das <nishdas93@gmail.com>
28 lines
476 B
Go
28 lines
476 B
Go
package kv
|
|
|
|
import (
|
|
"context"
|
|
|
|
bolt "go.etcd.io/bbolt"
|
|
)
|
|
|
|
var migrationCompleted = []byte("done")
|
|
|
|
type migration func(context.Context, *bolt.DB) error
|
|
|
|
var migrations = []migration{
|
|
migrateArchivedIndex,
|
|
migrateBlockSlotIndex,
|
|
migrateStateValidators,
|
|
}
|
|
|
|
// RunMigrations defined in the migrations array.
|
|
func (s *Store) RunMigrations(ctx context.Context) error {
|
|
for _, m := range migrations {
|
|
if err := m(ctx, s.db); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|