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

Function TestRollbackDifferentStateHeight

state/rollback_test.go:109–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

107}
108
109func TestRollbackDifferentStateHeight(t *testing.T) {
110 const height = int64(100)
111 stateStore := setupStateStore(t, height)
112 blockStore := &mocks.BlockStore{}
113 blockStore.On("Height").Return(height + 2)
114
115 _, _, err := state.Rollback(blockStore, stateStore)
116 require.Error(t, err)
117 require.Equal(t, err.Error(), "statestore height (100) is not one below or equal to blockstore height (102)")
118}
119
120func setupStateStore(t *testing.T, height int64) state.Store {
121 stateStore := state.NewStore(dbm.NewMemDB(), state.StoreOptions{DiscardABCIResponses: false})

Callers

nothing calls this directly

Calls 4

RollbackFunction · 0.92
setupStateStoreFunction · 0.85
ErrorMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected