Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Add dapp-wallet to built-in dapps; load it from fs #126

Merged
merged 8 commits into from
Jun 11, 2018
Merged

Conversation

axelchalon
Copy link
Contributor

The wallet retains the same id (v1) as when the dapp was served by Parity, so it shouldn't ask for any new permissions.

I updated inject.js to cover the case of a fs (builtin) dapp with an id that is not a hash.

Also made it so that dapps cannot overwrite already loaded builtin dapps (to ignore the v1 app.type === 'local' served by Parity until it's removed from the node).

I'm sometimes getting "Uncaught Error: Provider needs to be supplied to Api instance" (in the wallet at least) or window.require errors; not sure why, don't think it's related to this PR.

* Add dapp-wallet to built-in dapps
* Modify inject.js to cover local dapp name "v1" (not a hash)
package.json Outdated
@@ -157,6 +157,7 @@
},
"dependencies": {
"@parity/api": "2.1.20",
"@parity/dapp-wallet": "github:js-dist-paritytech/dapp-wallet#037638fec1d3146bc3d3980597cee62b37617373",
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably this should go in devDependencies for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, totally

@amaury1093
Copy link
Contributor

Ah, another bug I found: token images are not working anymore.

The reason I suppose: the token images are loaded in the code as /api/content/d40679a3a234d8421c678d64f4df3308859e8ad07ac95ce4a228aceb96955287 (gavcoin), which before resolved to localhost:8545/api/content/..., but now to file:///api/content/d40679a3a234d8421c678d64f4df3308859e8ad07ac95ce4a228aceb96955287.

@axelchalon Could you do a small PR on dapp-wallet to force it to load token images with dappsUrl prefix?

@axelchalon axelchalon added the A3-inprogress Pull request is in progress. No review needed at this stage. label Jun 4, 2018
@axelchalon
Copy link
Contributor Author

Waiting on parity-js/dapp-wallet#13 to be merged; then I'll update the dependency and the PR will be ready!

This was referenced Jun 10, 2018
@axelchalon axelchalon removed the A3-inprogress Pull request is in progress. No review needed at this stage. label Jun 11, 2018
@amaury1093 amaury1093 added the A8-looksgood Pull request is reviewed well. label Jun 11, 2018
@amaury1093 amaury1093 merged commit 9193e5b into master Jun 11, 2018
@amaury1093 amaury1093 deleted the ac-v1-builtin branch June 11, 2018 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants