From 02fcfa8bcb0995ce5e17f59a9911301cca7c23ba Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 14 Sep 2022 17:41:19 +0300 Subject: [PATCH] [#266] nns: Use millisecondsInSeconds constant where appropriate Signed-off-by: Anna Shaleva --- nns/nns_contract.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nns/nns_contract.go b/nns/nns_contract.go index 2f642834..09a50a88 100644 --- a/nns/nns_contract.go +++ b/nns/nns_contract.go @@ -65,9 +65,10 @@ const ( // Other constants. const ( // defaultRegisterPrice is the default price for new domain registration. - defaultRegisterPrice = 10_0000_0000 + defaultRegisterPrice = 10_0000_0000 + millisecondsInSeconds = 1000 // millisecondsInYear is amount of milliseconds per year. - millisecondsInYear = int64(365 * 24 * 3600 * 1000) + millisecondsInYear = int64(365 * 24 * 3600 * millisecondsInSeconds) ) // RecordState is a type that registered entities are saved to. @@ -339,7 +340,7 @@ func Register(name string, owner interop.Hash160, email string, refresh, retry, Owner: owner, Name: name, // NNS expiration is in milliseconds - Expiration: int64(runtime.GetTime() + expire*1000), + Expiration: int64(runtime.GetTime() + expire*millisecondsInSeconds), } putNameStateWithKey(ctx, tokenKey, ns) putSoaRecord(ctx, name, email, refresh, retry, expire, ttl)