Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NNS changes from C# #442

Merged
merged 5 commits into from
Nov 13, 2024
Merged

NNS changes from C# #442

merged 5 commits into from
Nov 13, 2024

Conversation

roman-khimov
Copy link
Member

This updates and replaces #267. Most of the changes are already merged via other PRs, but:

Otherwise they're OK to stay here for now (binaries/bindings not updated till we make decisions).

Copy link
Contributor

@cthulhu-rider cthulhu-rider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good overall

@@ -629,7 +629,8 @@ func Resolve(name string, typ recordtype.Type) []string {
}

ctx := storage.GetReadOnlyContext()
return resolve(ctx, nil, name, typ, 2)
res := []string{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the compiler understands inline nil but not empty slice?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, yes, why not just []string{} as an arg?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #420.

@@ -461,16 +463,30 @@ func saveDomain(ctx storage.Context, name, email string, refresh, retry, expire,
putSoaRecord(ctx, name, email, refresh, retry, expire, ttl)
}

// Renew increases domain expiration date.
func Renew(name string) int64 {
// RenewDefault increases domain expiration date for 1 year.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and returns what?

return Renew(name, 1)
}

// Renew increases domain expiration date up to the specified amount of years.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

// Renew increases domain expiration date up to the specified amount of years.
func Renew(name string, years int) int64 {
if years < 1 || years > 10 {
panic("invalid renewal period value")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

limit not mentioned in docs

carpawell
carpawell previously approved these changes Nov 12, 2024
@@ -629,7 +629,8 @@ func Resolve(name string, typ recordtype.Type) []string {
}

ctx := storage.GetReadOnlyContext()
return resolve(ctx, nil, name, typ, 2)
res := []string{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, yes, why not just []string{} as an arg?

@roman-khimov
Copy link
Member Author

Let's merge #420 then, some changes are present there and if we don't have any questions there it'd simplify things a bit.

@carpawell
Copy link
Member

@roman-khimov, done, can be rebased, also linter asks for attention.

@cthulhu-rider cthulhu-rider merged commit 69e9f73 into master Nov 13, 2024
8 checks passed
@cthulhu-rider cthulhu-rider deleted the nns-upd-breaking branch November 13, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants