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

add functions in support of new ndaujs package for exchange integrators #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jsgjnr
Copy link
Contributor

@jsgjnr jsgjnr commented Apr 2, 2021

No description provided.

@jsgjnr jsgjnr requested a review from edmcnierney April 2, 2021 16:52
jsLogReject(callback, "error decoding data from hex: %s", err)
return
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check for correct seed length here? I don't think it's necessary, since a bad key length will just cause GenerateFromSeed to return an error.

return
}

addr, err := address.Generate(address.KindExchange, key.KeyBytes())
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is for general ndaujs usage we shouldn't hard-code this as an Exchange-type key.


// Generate a high-level keypair from a given seed
func GenerateFromSeed(al Algorithm, seed []byte) (public PublicKey, private PrivateKey, err error) {
pubBytes, privBytes, err := al.GenerateFromSeed(seed)
Copy link
Contributor

@edmcnierney edmcnierney Apr 5, 2021

Choose a reason for hiding this comment

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

Same question as earlier - is it worth it to do any kind of checking on the seed here (as in ed25519 below)? It won't any difference in the outcome, just in the error logged.

Copy link
Contributor

@edmcnierney edmcnierney left a comment

Choose a reason for hiding this comment

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

Added a few notes about error-checking for seed properties.

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.

2 participants