Skip to content

Commit

Permalink
nns: Use millisecondsInSeconds constant where appropriate
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva authored and roman-khimov committed Jul 29, 2024
1 parent 1bb8b1c commit 8f751bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contracts/nns/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ const (
// defaultRegisterPrice is the default price for new domain registration.
// nolint:unused
defaultRegisterPrice = 10_0000_0000
// millisecondsInSecond is the amount of milliseconds per second.
millisecondsInSecond = 1000
// millisecondsInYear is amount of milliseconds per year.
millisecondsInYear = int64(365 * 24 * 3600 * 1000)
millisecondsInYear = int64(365 * 24 * 3600 * millisecondsInSecond)
)

// RecordState is a type that registered entities are saved to.
Expand Down Expand Up @@ -460,7 +462,7 @@ func saveDomain(ctx storage.Context, name, email string, refresh, retry, expire,
Owner: owner,
Name: name,
// NNS expiration is in milliseconds
Expiration: int64(runtime.GetTime() + expire*1000),
Expiration: int64(runtime.GetTime() + expire*millisecondsInSecond),
})
putSoaRecord(ctx, name, email, refresh, retry, expire, ttl)
}
Expand Down

0 comments on commit 8f751bc

Please sign in to comment.