Skip to content

Commit 1e24838

Browse files
committed
nns: use MillisecondsInSecond constant where appropriate
1 parent 03f4402 commit 1e24838

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/nft-nd-nns/nns.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ const (
6464
const (
6565
// defaultRegisterPrice is the default price for new domain registration.
6666
defaultRegisterPrice = 10_0000_0000
67+
// millisecondsInSecond is the amount of milliseconds per second.
68+
millisecondsInSecond = 1000
6769
// millisecondsInYear is amount of milliseconds per year.
68-
millisecondsInYear = 365 * 24 * 3600 * 1000
70+
millisecondsInYear = 365 * 24 * 3600 * millisecondsInSecond
6971
)
7072

7173
// RecordState is a type that registered entities are saved to.
@@ -327,7 +329,7 @@ func Register(name string, owner interop.Hash160, email string, refresh, retry,
327329
ns := NameState{
328330
Owner: owner,
329331
Name: name,
330-
Expiration: runtime.GetTime() + expire*1000,
332+
Expiration: runtime.GetTime() + expire*millisecondsInSecond,
331333
}
332334
putNameStateWithKey(ctx, tokenKey, ns)
333335
putSoaRecord(ctx, name, email, refresh, retry, expire, ttl)

0 commit comments

Comments
 (0)