fix: fix wallet.history.TestServiceAtEnd

First check was relying on sorting result of two items that had the same
weight and is not guaranteed to be deterministic.
This commit is contained in:
Stefan 2023-01-30 19:40:44 +04:00 committed by Stefan Dunca
parent 5d80c5cc42
commit d024d36718
1 changed files with 2 additions and 2 deletions

View File

@ -204,8 +204,8 @@ func TestServiceSortTimeAsc(t *testing.T) {
func TestServiceAtEnd(t *testing.T) { func TestServiceAtEnd(t *testing.T) {
testData := prepareTestData([]TestDataPoint{ testData := prepareTestData([]TestDataPoint{
{value: 1, timestamp: 101, blockNumber: 101, chainID: 1}, {value: 1, timestamp: 101, blockNumber: 101, chainID: 1},
{value: 1, timestamp: 101, blockNumber: 101, chainID: 2}, {value: 1, timestamp: 103, blockNumber: 103, chainID: 2},
{value: 1, timestamp: 102, blockNumber: 102, chainID: 1}, {value: 1, timestamp: 105, blockNumber: 105, chainID: 1},
}) })
sorted := sortTimeAsc(testData, map[chainIdentity]int{1: 0, 2: 0}) sorted := sortTimeAsc(testData, map[chainIdentity]int{1: 0, 2: 0})