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

Function TestRollbackNoBlocks

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

Source from the content-addressed store, hash-verified

94}
95
96func TestRollbackNoBlocks(t *testing.T) {
97 const height = int64(100)
98 stateStore := setupStateStore(t, height)
99 blockStore := &mocks.BlockStore{}
100 blockStore.On("Height").Return(height)
101 blockStore.On("LoadBlockMeta", height).Return(nil)
102 blockStore.On("LoadBlockMeta", height-1).Return(nil)
103
104 _, _, err := state.Rollback(blockStore, stateStore)
105 require.Error(t, err)
106 require.Contains(t, err.Error(), "block at height 99 not found")
107}
108
109func TestRollbackDifferentStateHeight(t *testing.T) {
110 const height = int64(100)

Callers

nothing calls this directly

Calls 3

RollbackFunction · 0.92
setupStateStoreFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected