-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Inject parity script to all dapps // Expand dapps to any ZIP file #7260
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.
LGTM, minor grumbles.
dapps/src/tests/fetch.rs
Outdated
@@ -167,13 +167,15 @@ fn should_return_fetched_dapp_content() { | |||
response1.assert_status("HTTP/1.1 200 OK"); | |||
assert_security_headers_for_embed(&response1.headers); | |||
assert_eq!( |
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.
could use assert!(condition, format, params..)
instead of assert_eq!(expression, true, format, params..)
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.
👍
hash-fetch/src/urlhint.rs
Outdated
@@ -85,14 +89,16 @@ pub struct Content { | |||
/// MIME type of the content | |||
pub mime: Mime, | |||
/// Content owner address | |||
pub owner: Address, | |||
pub owner: Address |
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.
In rust we try to have trailing commas after each line.
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.
Can't there be a linter 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.
I'd love to have one, we tried using rustfmt
some time ago, but there were many places were the formatting was a bit weird. We should give it a go again soon though!
hash-fetch/src/urlhint.rs
Outdated
Content { | ||
url: account_slash_repo, | ||
mime: mime, | ||
owner: owner |
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.
Could be simplified to:
Content {
url: account_slash_repo,
mime,
owner,
}
This PR injects too all HTML files served by the dapps server the
parity.js
script that instantiate a newwindow.ethereumProvider
object.It also adds the possibility to now link a dapp to a ZIP file (like a Github Release), instead of only the
repo
+commit
tuppleTo do that, one must set as the
commit
field in the GithubHint contract entry the value0x00..001
. This is to prevent the dapp server to extract zip files that should remain zip files, and not dapps.