Skip to content

Commit

Permalink
nns: use MillisecondsInSecond constant where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaShaleva committed Sep 16, 2022
1 parent d8e0a02 commit 14c9858
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/nft-nd-nns/nns.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ const (
const (
// defaultRegisterPrice is the default price for new domain registration.
defaultRegisterPrice = 10_0000_0000
// millisecondsInSecond is the amount of milliseconds per second.
millisecondsInSecond = 1000
// millisecondsInYear is amount of milliseconds per year.
millisecondsInYear = 365 * 24 * 3600 * 1000
millisecondsInYear = 365 * 24 * 3600 * millisecondsInSecond
)

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

0 comments on commit 14c9858

Please sign in to comment.