MCPcopy Create free account
hub / github.com/tendermint/tendermint / loadStatefromGenesis

Function loadStatefromGenesis

node/node_test.go:647–669  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

645}
646
647func loadStatefromGenesis(t *testing.T) sm.State {
648 t.Helper()
649
650 stateDB := dbm.NewMemDB()
651 stateStore := sm.NewStore(stateDB)
652 cfg, err := config.ResetTestRoot("load_state_from_genesis")
653 require.NoError(t, err)
654
655 loadedState, err := stateStore.Load()
656 require.NoError(t, err)
657 require.True(t, loadedState.IsEmpty())
658
659 genDoc, _ := factory.RandGenesisDoc(cfg, 0, false, 10)
660
661 state, err := loadStateFromDBOrGenesisDocProvider(
662 stateStore,
663 genDoc,
664 )
665 require.NoError(t, err)
666 require.NotNil(t, state)
667
668 return state
669}

Callers 1

TestLoadStateFromGenesisFunction · 0.85

Calls 5

LoadMethod · 0.95
ResetTestRootFunction · 0.92
RandGenesisDocFunction · 0.92
IsEmptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…