Files
evm/sync/statesync/trie_sync_stats_test.go
2025-07-26 17:36:32 -05:00

26 lines
587 B
Go

// Copyright (C) 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.GetOrRegisterGauge("test_gauge", nil),
}
require.Positive(stats.updateETA(time.Minute, now))
}