Skip to content
Snippets Groups Projects
Commit 384f8a6a authored by David Stainton's avatar David Stainton
Browse files

Fix storage of time in kv

parent 985acb56
Branches
Tags
6 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!371[Channel RSAtoPrivate] Implement Reverse Asymmetric in Client/Broadcast,!354Channels impl,!340Project/channels,!338Xx 4055/channel identity tracking
......@@ -90,7 +90,7 @@ type registrationDisk struct {
func newRegistrationDisk(publicKey ed25519.PublicKey, privateKey ed25519.PrivateKey,
lease time.Time, signature []byte) registrationDisk {
return registrationDisk{
Lease: lease.Unix(),
Lease: lease.UnixNano(),
PublicKey: publicKey,
PrivateKey: privateKey,
Signature: signature,
......
......@@ -43,12 +43,14 @@ func TestSignChannelMessage(t *testing.T) {
func TestNewRegistrationDisk(t *testing.T) {
publicKey, privateKey, err := ed25519.GenerateKey(rand.Reader)
require.NoError(t, err)
lease := time.Now()
lease := time.Now().UnixNano()
signature := make([]byte, 64)
reg := newRegistrationDisk(publicKey, privateKey, lease, signature)
reg := newRegistrationDisk(publicKey, privateKey, time.Unix(0, lease), signature)
require.Equal(t, reg.PublicKey, publicKey)
require.Equal(t, reg.PrivateKey, privateKey)
require.Equal(t, reg.Signature, signature)
require.Equal(t, reg.Lease, lease)
}
func TestLoadSaveRegistration(t *testing.T) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment