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 typed methods via inheritance #12

Merged
merged 4 commits into from
Sep 10, 2019
Merged

Conversation

danfinlay
Copy link
Contributor

@danfinlay danfinlay commented Aug 30, 2019

Now uses inheritance to reuse method implementations from eth-simple-keyring, by merely exposing a getPrivateKeyFor(address) method.

Adds methods for all the types of signTypedData methods, with tests included, and confirms those signed results can be recovered with the latest eth-sig-util.

Includes the same breaking change as eth-simple-keyring has, because signTypedData now directs to the _v1 method instead of _v3, to match the MetaMask provider API.

@danfinlay
Copy link
Contributor Author

danfinlay commented Aug 30, 2019

Requires this PR to eth-simple-keyring be merged and published, and added to this PR's dependencies.

@danfinlay
Copy link
Contributor Author

I wanted to use my new signature output examples, but since this is an hd-wallet, there was no easy way for me to import those keys for reuse.

Since it's inheriting those implementations, it seems less critical to test the behavior, and sufficient to test that its signatures can be recovered.

@@ -1,6 +1,6 @@
{
"name": "eth-hd-keyring",
"version": "2.1.0",
"version": "3.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this needs to be updated to 3.1.0

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe package.json should be changed to 3.0.0? Not sure why it'd be 3.1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly to lock-step with simple-keyring: 3.x was adding app keys, and 3.1 is adding type defs.

Copy link
Member

Choose a reason for hiding this comment

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

There may have been a misunderstanding here - the lockfile is still out of sync with the manifest, so it'll be dirty whenever you install. This version should always match the manifest version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh! I'm sorry, I did misunderstand. fix in PR.

@danfinlay danfinlay merged commit 7ce51be into master Sep 10, 2019
@danfinlay
Copy link
Contributor Author

Published as eth-hd-keyring@3.1.0

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.

None yet

2 participants