Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Eth-wallet rebased #14734

Merged
merged 93 commits into from
Aug 14, 2018
Merged

Eth-wallet rebased #14734

merged 93 commits into from
Aug 14, 2018

Conversation

Slava
Copy link
Contributor

@Slava Slava commented Jul 13, 2018

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@Slava Slava mentioned this pull request Jul 13, 2018
10 tasks
@diracdeltas diracdeltas changed the base branch from feature/ethwallet to master July 13, 2018 18:48
@@ -721,6 +721,16 @@ const api = {
}
})

tab.on('did-detach', (e, oldTabId) => {
Copy link
Member

Choose a reason for hiding this comment

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

@Slava is this block supposed to be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand why this is needed. Maybe you can remember the context of this commit? c375ba3

Copy link
Member

Choose a reason for hiding this comment

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

@Slava lol wow i have no idea. sorry i thought it was left over from the rebase.

Copy link
Member

Choose a reason for hiding this comment

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

er yeah this needs to - looks like a rebase issue from before -> after the signle-webview project. Tab's now detach every time they are made inactive / active, so this will break something (minor).

Copy link
Member

Choose a reason for hiding this comment

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

@petemill sorry do you mean this chunk should be deleted or kept (or other)?

Copy link
Member

Choose a reason for hiding this comment

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

@petemill ping

Copy link
Member

Choose a reason for hiding this comment

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

looks like this block got added during rebase because of a fix within in the original ethwallet branch - 00cdfdd#diff-2be38b3d97f35cd818780bac4be979c4R629

I think we should delete this block

Copy link
Member

Choose a reason for hiding this comment

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

oops missed out a key word

this needs to go

Thanks for the spot

@srirambv
Copy link
Collaborator

Selecting Open/Transfer/Create from extension popup, opens up a new tab each time. Is this expected behaviour?

@bsclifton
Copy link
Member

Steps from #13177

Steps:

  1. git pull
  2. npm install
  3. open Brave, turn on "Ethereum Wallet" in about:preferences#extensions
  4. create a wallet (or plug in your hardware wallet) and have fun

'style-src': '\'self\' \'unsafe-inline\'',
'connect-src': 'blob: \'self\' ws://localhost:* http://localhost:* https://min-api.cryptocompare.com https://mini-api.cryptocompare.com',
'img-src': '\'self\' data:',
'script-src': '\'self\' \'unsafe-eval\' \'sha256-7B6rTuXUsu9shBeECmDFH4h7RDsfogQ3kIonJnIL40o\' \'sha256-zgjB35Pd2ax7Wwfk9iKnAH8r+gNrD2cHpxDkH81DHzw=\'',
Copy link
Member

Choose a reason for hiding this comment

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

@Slava do we need unsafe-eval here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I added it because whatever the Meteor app compiles into uses new Function. I can look into how tweaking the minifier and try to get something that doesn't use eval.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok after spending some time on this I tracked it down to this
facebook/regenerator#336. It is an unsafe line in regenerator that used to compile web3js package for Meteor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm maybe not exactly this, but something very similar that tries to get the value of global

package.json Outdated
@@ -95,7 +97,8 @@
"bat-client": "^3.3.2",
"bat-publisher": "^2.0.18",
"bignumber.js": "^4.0.4",
"bloodhound-js": "brave/bloodhound",
"bloodhound-js": "github:brave/bloodhound",
Copy link
Contributor

@NejcZdovc NejcZdovc Jul 31, 2018

Choose a reason for hiding this comment

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

is this change needed?

@ryanml
Copy link
Contributor

ryanml commented Jul 31, 2018

@Slava could you rebase when you get a chance?


geth = spawn(gethProcessPath, gethArgs, spawnOptions)

geth.on('exit', function (code, signal) {
Copy link
Member

Choose a reason for hiding this comment

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

both the exit/close handlers should do the same thing: log the code & siginal, and restart geth.

there should be a handler for error that logs the error and does not restart geth.

Copy link
Contributor

Choose a reason for hiding this comment

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

++

if (fs.existsSync(pidPath)) {
try {
const pid = fs.readFileSync(pidPath)
cleanupGeth(pid)
Copy link
Member

Choose a reason for hiding this comment

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

since geth is probably undefined at this point, will cleanupGeth actually kill that pid?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, in the event that geth is undefined the kill will not go forward. Will fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed

@ryanml ryanml force-pushed the feature/ethwallet branch from 326048d to edb3ba8 Compare August 13, 2018 21:31
ryanml
ryanml previously approved these changes Aug 13, 2018
Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

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

lgtm

@ryanml ryanml force-pushed the feature/ethwallet branch from 5b1fd0d to be48f37 Compare August 13, 2018 23:21
@ryanml ryanml force-pushed the feature/ethwallet branch from e4d805c to b36ab69 Compare August 14, 2018 02:12
Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

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

re-approved

@bsclifton bsclifton merged commit 0845eaf into brave:master Aug 14, 2018
bsclifton added a commit that referenced this pull request Aug 14, 2018
bsclifton added a commit that referenced this pull request Aug 14, 2018
@bsclifton
Copy link
Member

master 0845eaf
0.24.x 72820e8
0.23.x 1814e19

petemill added a commit that referenced this pull request Aug 15, 2018
delete did-detach block accidentally brought back in #14734
petemill added a commit that referenced this pull request Aug 15, 2018
delete did-detach block accidentally brought back in #14734
petemill added a commit that referenced this pull request Aug 15, 2018
delete did-detach block accidentally brought back in #14734
@bsclifton bsclifton mentioned this pull request Aug 16, 2018
10 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.