Skip to content

Commit

Permalink
FIX: Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Oct 28, 2024
1 parent b1f754b commit 5caafce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
18 changes: 9 additions & 9 deletions process/track/sovereignChainBlockProcessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,15 @@ func TestSovereignChainBlockProcessor_RequestHeadersShouldAddAndRequestForExtend
})
mutRequest.Unlock()

require.Equal(t, 2, len(shardIDAddCalled))
require.Equal(t, 2, len(nonceAddCalled))
require.Equal(t, 2, len(shardIDRequestCalled))
require.Equal(t, 2, len(nonceRequestCalled))

assert.Equal(t, []uint32{shardID, shardID}, shardIDAddCalled)
assert.Equal(t, []uint64{fromNonce, fromNonce + 1}, nonceAddCalled)
assert.Equal(t, []uint32{shardID, shardID}, shardIDRequestCalled)
assert.Equal(t, []uint64{fromNonce, fromNonce + 1}, nonceRequestCalled)
require.Equal(t, 1, len(shardIDAddCalled))
require.Equal(t, 1, len(nonceAddCalled))
require.Equal(t, 1, len(shardIDRequestCalled))
require.Equal(t, 1, len(nonceRequestCalled))

assert.Equal(t, []uint32{shardID}, shardIDAddCalled)
assert.Equal(t, []uint64{fromNonce}, nonceAddCalled)
assert.Equal(t, []uint32{shardID}, shardIDRequestCalled)
assert.Equal(t, []uint64{fromNonce}, nonceRequestCalled)
}

func TestSovereignChainShardBlockTrack_getBlockFinality(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion process/track/sovereignChainShardBlockTrack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,10 @@ func TestSovereignChainShardBlockTrack_ComputeLongestExtendedShardChainFromLastN

headers, _, _ := scsbt.ComputeLongestExtendedShardChainFromLastNotarized()

require.Equal(t, 2, len(headers))
require.Equal(t, 3, len(headers))
assert.Equal(t, shardHeaderExtended1, headers[0])
assert.Equal(t, shardHeaderExtended2, headers[1])
assert.Equal(t, shardHeaderExtended3, headers[2])
})
}

Expand Down

0 comments on commit 5caafce

Please sign in to comment.