Files
coreth/sync/statesync/trie_sync_stats_test.go

27 lines
567 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package statesync
import (
"testing"
"time"
"github.com/luxfi/geth/metrics"
"github.com/stretchr/testify/require"
)
func TestETAShouldNotOverflow(t *testing.T) {
require := require.New(t)
now := time.Now()
start := now.Add(-6 * time.Hour)
stats := &trieSyncStats{
triesStartTime: start,
triesSynced: 100_000,
triesRemaining: 450_000,
leafsRateGauge: metrics.NewGauge(),
}
require.Positive(stats.updateETA(time.Minute, now))
}