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

Function TestClient_Cleanup

light/client_test.go:437–458  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

435}
436
437func TestClient_Cleanup(t *testing.T) {
438 c, err := light.NewClient(
439 ctx,
440 chainID,
441 trustOptions,
442 fullNode,
443 []provider.Provider{fullNode},
444 dbs.New(dbm.NewMemDB(), chainID),
445 light.Logger(log.TestingLogger()),
446 )
447 require.NoError(t, err)
448 _, err = c.TrustedLightBlock(1)
449 require.NoError(t, err)
450
451 err = c.Cleanup()
452 require.NoError(t, err)
453
454 // Check no light blocks exist after Cleanup.
455 l, err := c.TrustedLightBlock(1)
456 assert.Error(t, err)
457 assert.Nil(t, l)
458}
459
460// trustedHeader.Height == options.Height
461func TestClientRestoresTrustedHeaderAfterStartup1(t *testing.T) {

Callers

nothing calls this directly

Calls 6

TrustedLightBlockMethod · 0.95
CleanupMethod · 0.95
NewClientFunction · 0.92
LoggerFunction · 0.92
TestingLoggerFunction · 0.92
ErrorMethod · 0.65

Tested by

no test coverage detected