From 5083234eea7651179a378a8dfac0c551e7eaea0e Mon Sep 17 00:00:00 2001 From: EclesioMeloJunior Date: Thu, 31 Mar 2022 14:57:59 -0400 Subject: [PATCH] chore: fix integration tests --- dot/state/block_finalisation.go | 1 + lib/babe/verify_integration_test.go | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dot/state/block_finalisation.go b/dot/state/block_finalisation.go index e5adbc049e..d7677bebc4 100644 --- a/dot/state/block_finalisation.go +++ b/dot/state/block_finalisation.go @@ -117,6 +117,7 @@ func (bs *BlockState) GetHighestFinalisedHeader() (*types.Header, error) { func (bs *BlockState) SetFinalisedHash(hash common.Hash, round, setID uint64) error { bs.Lock() defer bs.Unlock() + has, _ := bs.HasHeader(hash) if !has { return fmt.Errorf("cannot finalise unknown block %s", hash) diff --git a/lib/babe/verify_integration_test.go b/lib/babe/verify_integration_test.go index a35cc399d4..48cdd864da 100644 --- a/lib/babe/verify_integration_test.go +++ b/lib/babe/verify_integration_test.go @@ -610,13 +610,6 @@ func TestVerifyForkBlocksWithRespectiveEpochData(t *testing.T) { // block, clean up the in memory data and store the finalized digest in db time.Sleep(time.Second * 2) - // should not exists in memory data as a chain was finalized - _, err = epochState.GetEpochData(epochToTest, forkBobLastHeader) - require.EqualError(t, err, fmt.Sprintf("epoch not found in memory map: %d", epochToTest)) - - _, err = epochState.GetConfigData(epochToTest, forkBobLastHeader) - require.EqualError(t, err, fmt.Sprintf("epoch not found in memory map: %d", epochToTest)) - // as a chain was finalized any block built upon it should use the database stored data blockUponFinalizedHeader := issueNewBlockFrom(t, forkBobLastHeader, keyring.KeyBob, stateService)