Embed Config Pattern For Blockchain Service and Update Dependency Names Accordingly (#8618)

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
kevlu93
2021-03-17 19:36:56 +01:00
committed by GitHub
parent 0a73be7389
commit ecf25d1284
22 changed files with 241 additions and 276 deletions

View File

@@ -13,7 +13,7 @@ import (
func TestHeadSlot_DataRace(t *testing.T) {
beaconDB := testDB.SetupDB(t)
s := &Service{
beaconDB: beaconDB,
cfg: &Config{BeaconDB: beaconDB},
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))
@@ -24,9 +24,8 @@ func TestHeadSlot_DataRace(t *testing.T) {
func TestHeadRoot_DataRace(t *testing.T) {
beaconDB := testDB.SetupDB(t)
s := &Service{
beaconDB: beaconDB,
head: &head{root: [32]byte{'A'}},
stateGen: stategen.New(beaconDB),
cfg: &Config{BeaconDB: beaconDB, StateGen: stategen.New(beaconDB)},
head: &head{root: [32]byte{'A'}},
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))
@@ -38,9 +37,8 @@ func TestHeadRoot_DataRace(t *testing.T) {
func TestHeadBlock_DataRace(t *testing.T) {
beaconDB := testDB.SetupDB(t)
s := &Service{
beaconDB: beaconDB,
head: &head{block: &ethpb.SignedBeaconBlock{}},
stateGen: stategen.New(beaconDB),
cfg: &Config{BeaconDB: beaconDB, StateGen: stategen.New(beaconDB)},
head: &head{block: &ethpb.SignedBeaconBlock{}},
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))
@@ -52,8 +50,7 @@ func TestHeadBlock_DataRace(t *testing.T) {
func TestHeadState_DataRace(t *testing.T) {
beaconDB := testDB.SetupDB(t)
s := &Service{
beaconDB: beaconDB,
stateGen: stategen.New(beaconDB),
cfg: &Config{BeaconDB: beaconDB, StateGen: stategen.New(beaconDB)},
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))