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

Make compatible with EIP 1193, EIP 1102, and EIP 2255 (i.e. LoginPerSite) #11

Merged
merged 9 commits into from
Nov 22, 2019

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Nov 14, 2019

This makes the inpage provider compatible with EIP 1193, EIP 1102, and EIP 2255 (i.e., this branch of the extension). It also sets us up for the December 16 API changes (basically, delete everything marked with TODO:deprecate:2019-12-16).

Some noteworthy changes:

  • use yarn
  • metadata handling moved from extension to here
  • ethereum._metamask proxy moved from extension to here
  • ethereum.send fully implemented per EIP 1193
  • major version bump to 4.0.0
    • changes are breaking if the background does not use EIP 2255

We probably shouldn't merge this and publish the package until the extension's LoginPerSite PR is approved, but we definitely review it now.

@rekmarks rekmarks changed the title Make compatible with EIP 1193, EIP 1102, and permissions system Make compatible with EIP 1193, EIP 1102, and EIP 2255 Nov 14, 2019
Copy link
Contributor

@danfinlay danfinlay left a comment

Choose a reason for hiding this comment

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

Looks good! A few things you might want to tighten up or discuss, but I don’t see anything worth blocking. Very clean, pleasant to read!

index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@rekmarks rekmarks changed the title Make compatible with EIP 1193, EIP 1102, and EIP 2255 Make compatible with EIP 1193, EIP 1102, and EIP 2255 (i.e. LoginPerSite) Nov 14, 2019
@Gudahtt
Copy link
Member

Gudahtt commented Nov 15, 2019

It looks like this needs to be rebased; there are conflicts.

use yarn
update ethereum.send and related methods for EIP 1102 and 1193 compatibility
add metadata retrieval
refactor utils; use eth-json-rpc-errors
implement EIP 1193 events
receive accountsChanged notification from background
add _metamask.sendBatch, eslint
4.0.0
@rekmarks
Copy link
Member Author

@Gudahtt fixed!

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

Here's the first part of my review - I'm still only part-way through.

.nvmrc Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
src/utils.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@rekmarks
Copy link
Member Author

@Gudahtt, just pushed stuff, mostly related to things I marked resolved. Only significant changes worth looking over ought to be the send method. I kind of hate it, but it will remain something of a mess until we've stopped supporting the send(requestObject, callback) signature.

index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
src/siteMetadata.js Show resolved Hide resolved
src/siteMetadata.js Show resolved Hide resolved
src/utils.js Outdated Show resolved Hide resolved
test/utils.js Outdated Show resolved Hide resolved
test/utils.js Outdated Show resolved Hide resolved
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

Phew 😌 , I think that's everything! This looks good to me. Both of the problems we encountered at the hackathon are fixed now (emitting accountsChanged upon unlock and accepting a callback to .send).

@rekmarks rekmarks merged commit 8673d02 into master Nov 22, 2019
@rekmarks rekmarks deleted the LoginPerSite branch April 22, 2020 17:09
Gudahtt added a commit that referenced this pull request Jul 4, 2020
The `data` event was emitted from v3.0.0 of the inpage provider
whenever a `notification` event was received from MetaMask. This event
was removed in #11 because it was thought it was only used internally.
Apparently `web3` was relying upon it though.

It has been restored exactly as it was in v3.0.0, except now a
deprecation warning is shown in the console the first time a listener
is added for this event.
@Gudahtt Gudahtt mentioned this pull request Jul 4, 2020
rekmarks pushed a commit that referenced this pull request Jul 4, 2020
The `data` event was emitted from v3.0.0 of the inpage provider
whenever a `notification` event was received from MetaMask. This event
was removed in #11 because it was thought it was only used internally.
Apparently `web3` was relying upon it though.

It has been restored exactly as it was in v3.0.0, except now a
deprecation warning is shown in the console the first time a listener
is added for this event.
Gudahtt added a commit that referenced this pull request Jul 15, 2020
An alias has been added to restore the `publicCOnfigStore` property
that was renamed in #11. A warning is printed to the console upon first
use, explaining that the property is deprecated and will be removed in
the future.
Gudahtt added a commit that referenced this pull request Jul 15, 2020
An alias has been added to restore the `publicConfigStore` property
that was renamed in #11. A warning is printed to the console upon first
use, explaining that the property is deprecated and will be removed in
the future.
Gudahtt added a commit that referenced this pull request Jul 15, 2020
An alias has been added to restore the `publicConfigStore` property
that was renamed in #11. A warning is printed to the console upon first
use, explaining that the property is deprecated and will be removed in
the future.

Fixes #67
rekmarks pushed a commit that referenced this pull request Jul 15, 2020
An alias has been added to restore the `publicConfigStore` property
that was renamed in #11. A warning is printed to the console upon first
use, explaining that the property is deprecated and will be removed in
the future.

Fixes #67
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.

3 participants