@@ -379,53 +379,6 @@ func TestHeaderStoreAdapter_OnDelete(t *testing.T) {
379379 assert .Equal (t , []uint64 {1 , 2 }, deletedHeights )
380380}
381381
382- func TestHeaderStoreAdapter_RefreshHeight (t * testing.T ) {
383- t .Parallel ()
384- ctx := context .Background ()
385-
386- ds , err := NewTestInMemoryKVStore ()
387- require .NoError (t , err )
388- store := New (ds )
389- adapter := NewHeaderStoreAdapter (store )
390-
391- // Save a block directly to the underlying store
392- h1 , d1 := types .GetRandomBlock (1 , 1 , "test-chain" )
393- batch , err := store .NewBatch (ctx )
394- require .NoError (t , err )
395- require .NoError (t , batch .SaveBlockData (h1 , d1 , & types.Signature {}))
396- require .NoError (t , batch .SetHeight (1 ))
397- require .NoError (t , batch .Commit ())
398-
399- // RefreshHeight should update from store and clean pending
400- err = adapter .RefreshHeight (ctx )
401- require .NoError (t , err )
402- assert .Equal (t , uint64 (1 ), adapter .Height ())
403- }
404-
405- func TestHeaderStoreAdapter_SetHeight (t * testing.T ) {
406- t .Parallel ()
407- ctx := context .Background ()
408-
409- ds , err := NewTestInMemoryKVStore ()
410- require .NoError (t , err )
411- store := New (ds )
412- adapter := NewHeaderStoreAdapter (store )
413-
414- // Add some pending headers
415- h1 , _ := types .GetRandomBlock (1 , 1 , "test-chain" )
416- h2 , _ := types .GetRandomBlock (2 , 1 , "test-chain" )
417- require .NoError (t , adapter .Append (ctx , h1 , h2 ))
418-
419- // SetHeight should update height and clean pending at or below
420- adapter .SetHeight (1 )
421- assert .Equal (t , uint64 (1 ), adapter .Height ())
422-
423- // Height 1 should be cleaned from pending
424- // (but since we don't have store data, HasAt returns false now for pending)
425- // Height 2 should still be in pending
426- assert .True (t , adapter .HasAt (ctx , 2 ))
427- }
428-
429382func TestHeaderStoreAdapter_AppendSkipsExisting (t * testing.T ) {
430383 t .Parallel ()
431384 ctx := context .Background ()
0 commit comments