-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow additional/override of non-spec fields, including "address" #70
Conversation
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
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.
LGTM, approved with a suggestion that can be pushed off to a followup PR.
pkg/keystorev3/walletfile.go
Outdated
|
||
type walletFileBase struct { | ||
walletFileCoreFields | ||
walletFileMetadata | ||
privateKey []byte | ||
keypair *secp256k1.KeyPair |
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.
would be great to have this removed as well, to make the walletFile object agnostic to the public key algorithms. this was done in #69. but no need to hold the merge for this.
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.
Yes - agreed... I wonder if I can make it calculate-on-demand as a way to keep the interface identical 🤔
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.
great suggestion @jimthematrix - I've managed to do that I think completely removing the field, and even actually removing the Address
struct field.
I realized we don't expose the field directly anyway.
Mind taking another look?
…nctions Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
thanks @peterbroadhurst , think this is the best we can do given that |
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
As discussed in #69:
address
field is not part of the Version 3 spec - was removed here justification:address
field is a very Ethereum specific way to store a piece of metadata that is intended to identify the private key publicly0x
prefixed 20 hex-byte compressed identifier of the SECP256K1 derivied public key, for the private keySo...
This PR allows
WalletFile.Metadata()
to be called get amap[string]any
that you can used to:bjjIdentifer
orbtcIdentifier
that are different public key representations of the private keyaddress
field from the serialization by setting it tonil