diff --git a/pruner/full/window_test.go b/pruner/full/window_test.go new file mode 100644 index 0000000000..627c76abe2 --- /dev/null +++ b/pruner/full/window_test.go @@ -0,0 +1,14 @@ +package full + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +// TestFullWindowConst exists to ensure that any changes to the sampling window +// are deliberate. +func TestFullWindowConst(t *testing.T) { + assert.Equal(t, time.Duration(Window), (30*24*time.Hour)+time.Hour) +} diff --git a/pruner/light/window.go b/pruner/light/window.go index 2241ecb063..eeabb0fda7 100644 --- a/pruner/light/window.go +++ b/pruner/light/window.go @@ -1,9 +1,11 @@ package light import ( + "time" + "github.com/celestiaorg/celestia-node/pruner" ) // Window is the availability window for light nodes in the Celestia // network (30 days). -const Window = pruner.AvailabilityWindow(30 * 24 * 60 * 60) +const Window = pruner.AvailabilityWindow(30 * 24 * time.Hour) diff --git a/pruner/light/window_test.go b/pruner/light/window_test.go new file mode 100644 index 0000000000..d74d594f70 --- /dev/null +++ b/pruner/light/window_test.go @@ -0,0 +1,14 @@ +package light + +import ( + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +// TestLightWindowConst exists to ensure that any changes to the sampling window +// are deliberate. +func TestLightWindowConst(t *testing.T) { + assert.Equal(t, time.Duration(Window), 30*24*time.Hour) +}