go-waku/waku/v2/utils/time_test.go
Richard Ramos 58f739765e
refactor: use int64 timestamps (#189)
* refactor: use int64 timestamps
* fix: changed PB Timestamp index to 10
2022-02-23 11:01:53 -04:00

18 lines
337 B
Go

package utils
import (
"testing"
"time"
"github.com/stretchr/testify/require"
)
func TestGetUnixEpochFrom(t *testing.T) {
loc := time.UTC
timestamp := GetUnixEpochFrom(time.Date(2019, 1, 1, 0, 0, 0, 0, loc))
require.Equal(t, int64(1546300800*time.Second), timestamp)
timestamp = GetUnixEpoch()
require.NotNil(t, timestamp)
}