mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
c7f0a94b19
* Remove state balance cache * remove unused metrics * add missing balance update * add comment about locks * update balance only when updataing the justified checkpoint on unrealization * update checkpoint balances at launch * fix unit tests * fix remaining test * review * fix build file * fix test --------- Co-authored-by: terencechain <terence@prysmaticlabs.com> Co-authored-by: Radosław Kapka <rkapka@wp.pl>
27 lines
786 B
Go
27 lines
786 B
Go
package blockchain
|
|
|
|
import (
|
|
"testing"
|
|
|
|
testDB "github.com/prysmaticlabs/prysm/v3/beacon-chain/db/testing"
|
|
doublylinkedtree "github.com/prysmaticlabs/prysm/v3/beacon-chain/forkchoice/doubly-linked-tree"
|
|
"github.com/prysmaticlabs/prysm/v3/beacon-chain/state/stategen"
|
|
)
|
|
|
|
func testServiceOptsWithDB(t *testing.T) []Option {
|
|
beaconDB := testDB.SetupDB(t)
|
|
fcs := doublylinkedtree.New()
|
|
return []Option{
|
|
WithDatabase(beaconDB),
|
|
WithStateGen(stategen.New(beaconDB, fcs)),
|
|
WithForkChoiceStore(fcs),
|
|
}
|
|
}
|
|
|
|
// WARNING: only use these opts when you are certain there are no db calls
|
|
// in your code path. this is a lightweight way to satisfy the stategen/beacondb
|
|
// initialization requirements w/o the overhead of db init.
|
|
func testServiceOptsNoDB() []Option {
|
|
return []Option{}
|
|
}
|