-
Notifications
You must be signed in to change notification settings - Fork 0
add node registrar client #7
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
add node registrar client #7
Conversation
45455c2
to
7ceeea7
Compare
c27651f
to
c74f8eb
Compare
return errors.Wrap(err, "failed to parse request body") | ||
} | ||
|
||
req, err := http.NewRequest("PATCH", url, &body) |
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.
why using patch here? we r updating one account
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.
patch method in http request is used for making partial changes to an existing resource.
} | ||
|
||
func (c *RegistrarClient) updateAccount(opts []UpdateAccountOpts) (err error) { | ||
err = c.ensureTwinID() |
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.
ensure account creates account if it doesn't exist, while i believe update on none existing account should fail
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.
this function call here is ensureTwin not ensureAccount, it ensures that the registrar client is set up probably with a valid account, it doesn't create account if not exist.
* support mnemonics in registrar client * fix drive keys from seed * update registrar client readme file * remove extra print lines * remove extra comments * lower case error messages
9d8b469
to
7908c98
Compare
513a105
to
3eb0fb7
Compare
node-registrar/client/account.go
Outdated
|
||
data := map[string]any{ | ||
"public_key": c.keyPair.Public(), | ||
"signature": signature, |
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.
shouldn't signature be encoded in base64?
Description
add node registrar client
Changes
List of changes this PR includes
Related Issues
Checklist