Skip to content
Snippets Groups Projects
Commit 4375b34a authored by Josh Brooks's avatar Josh Brooks
Browse files

Remove GetRegistrationTimestampNano API call in storage/user

parent c20d53db
No related branches found
No related tags found
1 merge request!23Release
...@@ -60,7 +60,7 @@ func registerNodes(sender *gateway.Sender, session *storage.Session, rngGen *fas ...@@ -60,7 +60,7 @@ func registerNodes(sender *gateway.Sender, session *storage.Session, rngGen *fas
u := session.User() u := session.User()
regSignature := u.GetTransmissionRegistrationValidationSignature() regSignature := u.GetTransmissionRegistrationValidationSignature()
// Timestamp in which user has registered with permissioning // Timestamp in which user has registered with permissioning
regTimestamp := u.GetRegistrationTimestampNano() regTimestamp := u.GetRegistrationTimestamp().UnixNano()
uci := u.GetCryptographicIdentity() uci := u.GetCryptographicIdentity()
cmix := session.Cmix() cmix := session.Cmix()
......
...@@ -36,13 +36,6 @@ func (u *User) GetReceptionRegistrationValidationSignature() []byte { ...@@ -36,13 +36,6 @@ func (u *User) GetReceptionRegistrationValidationSignature() []byte {
return u.receptionRegValidationSig return u.receptionRegValidationSig
} }
// Returns the registration timestamp stored in RAM as int64
func (u *User) GetRegistrationTimestampNano() int64 {
u.rvsMux.RLock()
defer u.rvsMux.RUnlock()
return u.registrationTimestamp.UnixNano()
}
// Returns the registration timestamp stored in RAM as // Returns the registration timestamp stored in RAM as
func (u *User) GetRegistrationTimestamp() time.Time { func (u *User) GetRegistrationTimestamp() time.Time {
u.rvsMux.RLock() u.rvsMux.RLock()
......
...@@ -176,9 +176,9 @@ func TestUser_GetRegistrationTimestamp(t *testing.T) { ...@@ -176,9 +176,9 @@ func TestUser_GetRegistrationTimestamp(t *testing.T) {
"\n\tExpected: %d\n\tReceieved: %d", testTime.UnixNano(), unixNano) "\n\tExpected: %d\n\tReceieved: %d", testTime.UnixNano(), unixNano)
} }
if testTime.UnixNano() != u.GetRegistrationTimestampNano() { if testTime.UnixNano() != u.GetRegistrationTimestamp().UnixNano() {
t.Errorf("Timestamp from GetRegistrationTimestampNano was not expected."+ t.Errorf("Timestamp from GetRegistrationTimestampNano was not expected."+
"\n\tExpected: %d\n\tReceieved: %d", testTime.UnixNano(), u.GetRegistrationTimestampNano()) "\n\tExpected: %d\n\tReceieved: %d", testTime.UnixNano(), u.GetRegistrationTimestamp().UnixNano())
} }
if !testTime.Equal(u.GetRegistrationTimestamp()) { if !testTime.Equal(u.GetRegistrationTimestamp()) {
......
...@@ -49,7 +49,7 @@ func (m *Manager) register(username string, comm registerUserComms) error { ...@@ -49,7 +49,7 @@ func (m *Manager) register(username string, comm registerUserComms) error {
Salt: cryptoUser.GetReceptionSalt(), Salt: cryptoUser.GetReceptionSalt(),
}, },
UID: cryptoUser.GetReceptionID().Marshal(), UID: cryptoUser.GetReceptionID().Marshal(),
Timestamp: user.GetRegistrationTimestampNano(), Timestamp: user.GetRegistrationTimestamp().UnixNano(),
} }
// Sign the identity data and add to user registration message // Sign the identity data and add to user registration message
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment