-
Notifications
You must be signed in to change notification settings - Fork 17
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
NNS changes from C# #442
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good overall
contracts/nns/contract.go
Outdated
@@ -629,7 +629,8 @@ func Resolve(name string, typ recordtype.Type) []string { | |||
} | |||
|
|||
ctx := storage.GetReadOnlyContext() | |||
return resolve(ctx, nil, name, typ, 2) | |||
res := []string{} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #420.
contracts/nns/contract.go
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and returns what?
contracts/nns/contract.go
Outdated
return Renew(name, 1) | ||
} | ||
|
||
// Renew increases domain expiration date up to the specified amount of years. |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
contracts/nns/contract.go
Outdated
@@ -629,7 +629,8 @@ func Resolve(name string, typ recordtype.Type) []string { | |||
} | |||
|
|||
ctx := storage.GetReadOnlyContext() | |||
return resolve(ctx, nil, name, typ, 2) | |||
res := []string{} |
There was a problem hiding this comment.
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?
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. |
@roman-khimov, done, can be rebased, also linter asks for attention. |
Signed-off-by: Anna Shaleva <[email protected]>
ddf8767
to
70d910f
Compare
Port neo-project/non-native-contracts#13. Signed-off-by: Anna Shaleva <[email protected]>
70d910f
to
507a41a
Compare
Port neo-project/non-native-contracts#11. Signed-off-by: Anna Shaleva <[email protected]>
Port neo-project/non-native-contracts#31. Signed-off-by: Anna Shaleva <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
507a41a
to
87a9e16
Compare
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).