Skip to content

Commit

Permalink
[nspcc-dev#266] nns: Use millisecondsInSeconds constant where appropr…
Browse files Browse the repository at this point in the history
…iate

Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Sep 14, 2022
1 parent 6f49a54 commit 02fcfa8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nns/nns_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 02fcfa8

Please sign in to comment.