-
Notifications
You must be signed in to change notification settings - Fork 54
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
Rebuild comm package #60
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.
Only a few nits!
common.go
Outdated
// Validate HRP: Max length = 83 | ||
// All characters must be in range [33, 126], displayable chars in Ledger devices | ||
func serializeHRP(hrp string) (hrpBytes []byte, err error) { | ||
if len(hrp) > 83 { |
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.
Avoid using magic numbers if possible, for example here you could create a constants.go
file and add something like:
const (
HRP_MAX_LENGTH = 83
// all other constant values
)
common.go
Outdated
return nil | ||
hrpBytes = []byte(hrp) | ||
for _, b := range hrpBytes { | ||
if b < 33 || b > 126 { |
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.
samething here
5f873cd
to
282f630
Compare
HDPath changed to string
The user can select which elements are hardened. The previous implementation used an array and the hardening was hidden from the user.
path := []uint32{44, 118, 0, 0, 21}
path := "m/44'/118'/0'/0/21"
Removed all legacy v1 and v2 functions
Sign function will require
Encapsulation from responses in structures
Fixed issues
#52
#53
#54