Skip to content

Commit 37d5f56

Browse files
committed
[#266] nns: Use millisecondsInSeconds constant where appropriate
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
1 parent 6f49a54 commit 37d5f56

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nns/nns_contract.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ const (
6666
const (
6767
// defaultRegisterPrice is the default price for new domain registration.
6868
defaultRegisterPrice = 10_0000_0000
69+
// millisecondsInSecond is the amount of milliseconds per second.
70+
millisecondsInSecond = 1000
6971
// millisecondsInYear is amount of milliseconds per year.
70-
millisecondsInYear = int64(365 * 24 * 3600 * 1000)
72+
millisecondsInYear = int64(365 * 24 * 3600 * millisecondsInSecond)
7173
)
7274

7375
// RecordState is a type that registered entities are saved to.
@@ -339,7 +341,7 @@ func Register(name string, owner interop.Hash160, email string, refresh, retry,
339341
Owner: owner,
340342
Name: name,
341343
// NNS expiration is in milliseconds
342-
Expiration: int64(runtime.GetTime() + expire*1000),
344+
Expiration: int64(runtime.GetTime() + expire*millisecondsInSecond),
343345
}
344346
putNameStateWithKey(ctx, tokenKey, ns)
345347
putSoaRecord(ctx, name, email, refresh, retry, expire, ttl)

0 commit comments

Comments
 (0)