MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / defaultTestPool

Function defaultTestPool

evidence/pool_test.go:432–445  ·  view source on GitHub ↗
(height int64)

Source from the content-addressed store, hash-verified

430}
431
432func defaultTestPool(height int64) (*evidence.Pool, types.MockPV) {
433 val := types.NewMockPV()
434 valAddress := val.PrivKey.PubKey().Address()
435 evidenceDB := dbm.NewMemDB()
436 stateStore := initializeValidatorState(val, height)
437 state, _ := stateStore.Load()
438 blockStore := initializeBlockStore(dbm.NewMemDB(), state, valAddress)
439 pool, err := evidence.NewPool(evidenceDB, stateStore, blockStore)
440 if err != nil {
441 panic("test evidence pool could not be created")
442 }
443 pool.SetLogger(log.TestingLogger())
444 return pool, val
445}
446
447func createState(height int64, valSet *types.ValidatorSet) sm.State {
448 return sm.State{

Calls 9

SetLoggerMethod · 0.95
NewMockPVFunction · 0.92
NewPoolFunction · 0.92
TestingLoggerFunction · 0.92
initializeValidatorStateFunction · 0.85
initializeBlockStoreFunction · 0.85
AddressMethod · 0.65
PubKeyMethod · 0.65
LoadMethod · 0.65

Tested by

no test coverage detected