mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
031b51e294
* head.go * Tests * Tests * Merge branch 'master' into call-head * Merge refs/heads/master into call-head * Merge refs/heads/master into call-head * Merge refs/heads/master into call-head * Merge branch 'master' into call-head * Merge branch 'master' of git+ssh://github.com/prysmaticlabs/prysm into call-head * Conflict
35 lines
579 B
Go
35 lines
579 B
Go
package blockchain
|
|
|
|
import (
|
|
"context"
|
|
"io/ioutil"
|
|
"testing"
|
|
|
|
testDB "github.com/prysmaticlabs/prysm/beacon-chain/db/testing"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func init() {
|
|
logrus.SetLevel(logrus.DebugLevel)
|
|
logrus.SetOutput(ioutil.Discard)
|
|
}
|
|
|
|
func TestChainService_SaveHead_DataRace(t *testing.T) {
|
|
db := testDB.SetupDB(t)
|
|
defer testDB.TeardownDB(t, db)
|
|
s := &Service{
|
|
beaconDB: db,
|
|
canonicalRoots: make(map[uint64][]byte),
|
|
}
|
|
go func() {
|
|
s.saveHead(
|
|
context.Background(),
|
|
[32]byte{},
|
|
)
|
|
}()
|
|
s.saveHead(
|
|
context.Background(),
|
|
[32]byte{},
|
|
)
|
|
}
|