mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
27 lines
567 B
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))
|
|
}
|