1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
Commit Graph

415 Commits

Author SHA1 Message Date
Dan Finlay
7b9749e30c Got bad account detection working and added to state 2016-12-09 12:24:25 -08:00
Dan Finlay
ab9e15b782 Mostly added bad account detection
Currently riddled with logs, because the migrator is inexplicably returning before generating the new style accounts for comparison.
2016-12-08 14:22:02 -08:00
Dan Finlay
1880cda9b9 Fix vault encrypting & unlocking bug
This is only a bug in dev, but was committed yesterday.

Sometimes the `encrypt` method was being passed values other than the password as the encryption key, leading to un-unlockable vaults.

To find this, and avoid it for all time hereafter, I added several more steps to our oft-neglected integration test suite, which now fully initializes a vault, locks it, and unlocks it again, to make sure all of those steps definitely work always.
2016-11-30 19:36:24 -08:00
Dan Finlay
95bcc21a06 Add useful nodeify error message
If a nodified method does not return a Promise, it will throw an error, like this:
```
Error in event handler for (unknown): Error: The function setSelectedAccount did not return a Promise, but was nodeified.
```
2016-11-29 15:54:10 -08:00
Dan Finlay
9e764b1935 Fix nodeify 2016-11-28 17:27:20 -08:00
Dan Finlay
80e76b45ee Denodeify most of KeyringController
Mostly Fixes #893

A couple methods cache callbacks, and will require a larger refactor to fully denodeify.

Specifically, our methods involving web3 requests to sign a tx, sign a message, and approve or cancel either of those.

I think we should postpone those until the TxManager refactor, since it will likely handle this response caching itself.
2016-11-28 16:13:03 -08:00
Dan Finlay
b899119582 Merge branch 'master' into dev 2016-11-23 16:54:27 -08:00
kumavis
c0a2eb146a rpc - add sync uninstallFilter support 2016-11-23 10:48:20 -08:00
Dan Finlay
05c8658ff3 Fix new encryptor migration logic 2016-11-22 17:41:54 -08:00
Dan Finlay
de8da9ddf6 Simplify Encryptor API Surface
At least, the portion of it that we use.

Moved salting within the encryptor, so it does not need to be managed externally.

KeyringController now caches the password instead of a passwordDerivedKey, since it is ignorant of the salt.

Encryptor payload is now in a JSON format, so its portions are both base64 encoded *and* labeled appropriately.  The format is `{ "data": "0x0", "iv": "0x0", "salt": "string" }`.

Fixes #843
Fixes #859
2016-11-22 15:54:51 -08:00
kumavis
4669f262e2 Merge pull request #857 from MetaMask/i841-RenameMethod
Rename idStoreMigrator method for clarity
2016-11-22 15:55:48 -05:00
kumavis
e61d792832 Merge pull request #869 from MetaMask/dev-cleanup
Dev Cleanup Package
2016-11-22 15:23:55 -05:00
kumavis
fa2f0dee28 idStore - fix estimateGas calculation 2016-11-22 12:10:49 -08:00
Kevin Serrano
6dad4f1f20
Phase out ethereumjs-util from encryptor module. 2016-11-22 11:17:05 -08:00
Dan Finlay
9fb96128e6 Rename idStoreMigrator method for clarity
Fixes #841
2016-11-21 19:52:56 -08:00
Kevin Serrano
f5b0795ac5
change all instances of selectedAddress to selectedAccount. 2016-11-21 16:21:16 -08:00
Kevin Serrano
9123e70434
Remove entropy from encryption and project. 2016-11-21 15:49:03 -08:00
Dan Finlay
7ab9d40820 Merge branch 'dev' into i831-AddRopsten-Dev 2016-11-21 11:03:32 -08:00
Dan Finlay
e8a8302624 Begin adding Ropsten support
Ropsten links will still not work until Etherscan publishes their ropsten link format.

At that time we will need to update ui/lib/account-link.js

Otherwise, fixes #831
2016-11-21 10:58:49 -08:00
Kevin Serrano
d6286cd13a
Maintain linting. 2016-11-18 16:27:26 -08:00
Dan Finlay
ce1c5eb75a Update migration code for new hd wallet param name 2016-11-18 11:37:07 -08:00
Kevin Serrano
bef023fb4a
Resolve merge conflict. 2016-11-18 09:23:20 -08:00
kumavis
39e0a33bba random-id - use Number.MAX_SAFE_INTEGER as max 2016-11-17 14:29:35 -08:00
Dan Finlay
8eb91e89bf Increment tx ids to avoid collisions
Fixes #791

It was possible for two requests to have the same ID, causing a crash and loss of StreamProvider connection.

This new id generation strategy creates a random ID, and increments it for each request.

In case the id generator is included from two different processes, I'm initializing the counter at a random number, and rolling it over a large number when it gets too big.
2016-11-17 14:05:12 -08:00
Dan Finlay
4352c7031a Merge branch 'i328-MultiVault' of github.com:MetaMask/metamask-plugin into i328-MultiVault 2016-11-17 13:51:32 -08:00
Dan Finlay
f229d32442 Replace old random-id code with incrementing id generator 2016-11-17 13:49:46 -08:00
Kevin Serrano
e18109f1ea
Fix semantics in comments 2016-11-15 13:45:21 -08:00
Kevin Serrano
585284cb88
Lints. 2016-11-15 13:44:22 -08:00
Kevin Serrano
64296df309
Resolve merge conflicts. 2016-11-15 13:43:15 -08:00
Kevin Serrano
7de6b12aad
Re-enable disclaimer screen. Rename variables to reflect role more clearly. 2016-11-14 16:49:16 -08:00
Kevin Serrano
d891869eff
First attempt at fixing errors in confirmation screen. 2016-11-14 11:19:01 -08:00
Kevin Serrano
7012747fb5
Package normalize inside sig util file. 2016-11-11 15:37:54 -08:00
Kevin Serrano
23263bec7d
Linting to the max. 2016-11-11 10:26:12 -08:00
kumavis
e123e3095b Merge branch 'master' into i328-MultiVault 2016-11-11 01:01:06 -05:00
kumavis
536cab0687 detect tx error - show warning and fix gasLimit 2016-11-10 21:19:34 -08:00
Frankie
f665b779cb Merge branch 'master' into i328-MultiVault 2016-11-10 16:53:47 -08:00
Kevin Serrano
e2b2083df0
remove gas field, due to alias redundancy. 2016-11-09 16:38:28 -08:00
Kevin Serrano
b6b4be61d9
Fix bug for increasing gas by 20 percent. 2016-11-09 16:29:24 -08:00
Dan Finlay
7068d2e71c Adjust gas buffer to be 20% over estimate 2016-11-08 08:39:41 -08:00
Dan Finlay
6f39924e60 Increase gas buffer
Fixes #795
2016-11-08 08:32:34 -08:00
Dan Finlay
161ff62fdc Merge branch 'master' into i328-MultiVault 2016-11-07 15:38:25 -08:00
Dan Finlay
1896928562 Fix gas price buffering
Our gas price buffering logic had a bug, because bn.js has inconsistent behavior when using hex-prefixed output.  The issue has been opened with them here:
https://github.com/indutny/bn.js/issues/151

We've corrected our usage in the mean time.
2016-11-07 11:56:20 -08:00
Dan Finlay
ba7d6b437f Fix password validation and persistence issue
Was wiping the vault on each successful password attempt... :P
2016-11-03 16:14:37 -07:00
Dan Finlay
bd2a429a85 Fix account nicknaming bug
When nicknaming, we weren't normalizing the input, and so we were retrieving with differently formatted addresses than we were persisting.
2016-11-03 11:59:20 -07:00
Dan Finlay
4db976ae46 Don't faucet during tests 2016-11-03 11:22:10 -07:00
Dan Finlay
756f56cfee Don't faucet in development 2016-11-03 10:42:34 -07:00
Dan Finlay
4cf1b606e4 Fix handling of migrating old vault style
Now old vaults are recognized as an "Initialized" MetaMask instance.

Upon logging in, when fetching the initial password-derived key, if there is no new-style vault, but there is an old style vault, it is migrated to the new format before proceeding through the usual unlocking steps.
2016-11-02 15:04:50 -07:00
Kevin Serrano
96643c222a
Implement seed word confirmation page.
Remove logs.
Move HD render files to ui/app.
2016-10-31 11:35:09 -07:00
Kevin Serrano
f9409793d8
Merge branch 'i328-MultiVault' of github.com:MetaMask/metamask-plugin into i328-MultiVault 2016-10-30 16:02:11 -07:00
Dan Finlay
18e5173f06 Now migrating old vaults to new DEN format 2016-10-29 02:29:25 -07:00
Kevin Serrano
6eb6968037
Merge branch 'master' into i328-MultiVault 2016-10-28 16:19:03 -07:00
Dan Finlay
c834b4f637 Merge branch 'master' into i762-RenameWalletToAccount 2016-10-26 11:31:08 -07:00
Dan Finlay
21e7331111 Fix delegate call function reference 2 2016-10-25 17:41:50 -07:00
Dan Finlay
6c469a1826 Merge branch 'i328-MultiVault' of github.com:MetaMask/metamask-plugin into i328-MultiVault 2016-10-25 17:00:19 -07:00
Dan Finlay
f9ff6cb55e Merge branch 'master' into i328-MultiVault 2016-10-25 16:59:58 -07:00
Dan Finlay
b3613232a2 Rename wallet to account
Fixes #762
2016-10-25 16:54:43 -07:00
Dan Finlay
bda64ab132 Fix delegate call analysis
Fixed reference allowing transactions to be analyzed for delegate call again.
2016-10-25 14:58:04 -07:00
Kevin Serrano
678301a20e
Phase out extra warning screen. 2016-10-25 13:24:03 -07:00
kumavis
85d03cc8fb Merge branch 'master' into i743-FixDelegateCallFlag 2016-10-24 12:24:19 -07:00
Dan Finlay
44aa1be277 Create basic keyring-controller unit test file 2016-10-21 12:11:54 -07:00
Dan Finlay
c3e1c5c57f Added SimpleKeyring tests 2016-10-21 11:10:36 -07:00
Dan Finlay
55d56f77cf Began adding first basic keyring 2016-10-20 16:45:58 -07:00
Dan Finlay
351c8e2086 Merge branch 'master' into i328-MultiVault 2016-10-20 14:02:24 -07:00
Dan Finlay
0deed17752 Fix tests 2016-10-20 12:07:53 -07:00
Dan Finlay
383f8ea7dc Linted & added salting to vault 2016-10-20 11:33:18 -07:00
Dan Finlay
090959470b Add note about callback param to sync method warning 2016-10-19 15:16:27 -07:00
Kevin Serrano
afbc4c832b
Git merge resolution. 2016-10-19 14:57:30 -07:00
Kevin Serrano
ad3fa24a28
Intermediary commit. 2016-10-19 14:55:08 -07:00
Kevin Serrano
17506fe14f
Merge in crypto. 2016-10-19 11:17:29 -07:00
Dan Finlay
049705004f Reproduced issue 743 in test case
This contract hex does include the value `f4`, but it was compiled from a contract with no instance of `.delegatecall`. I believe `f4` in this case is part of some other value or contract address, and `ethBinToOps` has some error in how it skips pushed data.

@kumavis
2016-10-17 14:48:25 -07:00
Dan Finlay
827d7553fc Restore hex prefix to gas price 2016-10-17 13:05:45 -07:00
Dan Finlay
91f43fa213 Increase gas estimate by 100000 wei
To prevent minor gas estimation errors, probably usually related to operating on dynamic state.

Fixes #738.
2016-10-17 12:47:37 -07:00
Kevin Serrano
1481a3ef8e
Initial work on UI side 2016-10-15 10:48:12 -07:00
Frankie
67eba9f542 Specify base 10 in bignumber 2016-10-13 16:04:23 -07:00
Frankie
b200f74d5f Merge branch 'master' into i#495CustomGasField 2016-10-13 15:17:30 -07:00
Frankie
c400f7c0f6 Fix gasPrice range 2016-10-13 15:10:29 -07:00
kumavis
88a68f732e Merge branch 'master' into i695-dapp-reload 2016-10-12 13:03:15 -07:00
kumavis
a1c3c944cf dapp reload - fixed disconnect detection via polling 2016-10-12 12:35:55 -07:00
Frankie
229d95956b Merge branch 'master' into i#495CustomGasField 2016-10-11 16:19:13 -07:00
Dan Finlay
5c9476e57d Fix bug where new vaults had no nicknames 2016-10-11 15:29:12 -07:00
Frankie
3a610f2c06 Merge branch 'master' into i#495CustomGasField 2016-10-10 18:18:07 -07:00
Frankie
e1b78da3e6 Add custom gas field to send page 2016-10-10 18:17:56 -07:00
Kevin Serrano
7c5ebb6a53
Renamed variables to make more sense. 2016-10-07 01:41:27 -07:00
Kevin Serrano
db06813404
Add new functions for storing TOS hashes in config manager. 2016-10-06 03:23:47 -07:00
Dan Finlay
f21170c7c3 Add tolerance for sending from mixed-case addresses.
We had to convert to lower case, and also had to modify the new provider-engine sanitizer to tolerate mixed case addresses.

Fixes #707
2016-10-05 15:26:56 -07:00
Dan Finlay
d02b2c4b4a Correct async link 2016-10-05 11:10:39 -07:00
Dan Finlay
f9eba9d7e5 Make popup a little taller
For some reason the popup was often cutting off the bottom buttons of the UI.

We should look at that more carefully later perhaps, but especially since we're considering moving off the popup, I'm just fixing it by making it taller for now.
2016-10-04 13:10:28 -07:00
kumavis
11363b4f2a Merge pull request #655 from MetaMask/FixPortStreamEnd
Fix port stream end bug
2016-09-13 12:49:44 -07:00
Dan Finlay
e10c651db0 Fix port stream end bug
Emitting `end` or `close` was not ending the stream.

Pushing a null packet also closes a stream, so I did that instead.

Fixes #616
2016-09-13 12:07:29 -07:00
Dan Finlay
b508541935 Fix cache clearing reference for Opera
For some reason Chrome didn't mind this awful bug, but Opera caught it.
2016-09-12 22:13:52 -07:00
Dan Finlay
0ea0a9813d Make cache clearning error tolerant 2016-09-12 15:26:07 -07:00
Dan Finlay
c3d1404e72 Fix clearing of account cache on vault restore 2016-09-12 15:18:32 -07:00
Dan Finlay
02b57adbf1 Linted 2016-09-12 14:34:45 -07:00
Dan Finlay
1ba83766bb Load accounts into ethStore on unlock 2016-09-12 14:33:54 -07:00
Dan Finlay
0d11eab8cb Add accounts back to metamask state 2016-09-12 14:22:06 -07:00
Dan Finlay
4a47f26e8c Fix keystore reference 2016-09-12 11:25:30 -07:00
Dan Finlay
e0e38b879f Fix some references 2016-09-12 11:21:27 -07:00
Dan Finlay
363c2a0939 Fix account unlocking
SubmitPassword was not creating a new id-management

This is because I broke up the old "createIdmgmt" method to not perform as much conditional logic.

Now the pieces are reusable and do what they should do.
2016-09-12 11:13:26 -07:00
Dan Finlay
5c1d8e299e Select first address when restoring vault
Fixes #642
2016-09-12 08:50:42 -07:00
Dan Finlay
f51a13abaf Fix ethStore pushed addresses
Needed to add hex prefix always.
2016-09-12 08:39:46 -07:00
Dan Finlay
9b861b6687 Fixed caching bug
Fixed bug where the second new vault created in an IdStore would initially return the accounts from the original store.

Also fixed some tests that were incorrect.
2016-09-10 15:45:34 -07:00
Dan Finlay
59fd86383f Correctly clear ethStore cache on new vault restore 2016-09-10 12:08:27 -07:00
Dan Finlay
6763871c41 Captured #640 in failing test 2016-09-10 11:46:50 -07:00
Dan Finlay
36dc63bc04 Add new eth-lightwallet salting to vault.
eth-lightwallet was previously not salting vault passwords, potentially making it easier to crack them once obtained.

This branch incorporates the API changes to allow us to take advantage of the new salting logic.

This is still throwing deprecation warnings, but that's actually a bug in eth-lightwallet I wrote, [I've submitted a PR for that here](https://github.com/ConsenSys/eth-lightwallet/pull/116).

Fixes #555
2016-09-09 19:42:18 -07:00
Dan Finlay
01f3683dcf Only init one wallet on restore
Fixes #610
2016-09-08 19:49:28 -07:00
Vincent Serpoul
4cf12337f2 linting 2016-09-06 11:24:09 +08:00
Vincent Serpoul
76d63ec4e0 Error message more helpful 2016-09-06 11:20:22 +08:00
kumavis
891e17c44c notif - use standard err-first callback style 2016-09-02 13:29:47 -07:00
Dan Finlay
34fd23803d Merge branch 'master' into i566-NoPopupWhenOpen 2016-09-01 11:34:38 -07:00
Dan Finlay
4f614d0852 Linted 2016-09-01 11:31:39 -07:00
Dan Finlay
47b2ae1c5f Do not open popup for internally produced txs 2016-09-01 11:26:27 -07:00
kumavis
532737a101 inpage - remap ids on response 2016-08-31 15:40:05 -07:00
Dan Finlay
742a0e0dfe Make popup a type Edge supports 2016-08-29 17:33:35 -07:00
Dan Finlay
1b617402ec Add extra edge compatibility 2016-08-29 17:33:18 -07:00
Frankie
547894ed39 Merge branch 'master' into i#563forgotPassword 2016-08-25 16:06:54 -07:00
Frankie
11c6c63d76 Merge branch 'master' into i#563forgotPassword 2016-08-25 14:17:29 -07:00
Frankie
483a7fee0a Add a back button on lock screen to go back to init menu 2016-08-25 14:13:32 -07:00
Dan Finlay
793ad6b8d8 Merge branch 'master' into PopupNotifications 2016-08-24 16:59:22 -07:00
Kevin Serrano
c82a494b4b Implement usage of nock. 2016-08-24 13:58:50 -07:00
Kevin Serrano
d3d634d09c Added mock option to function. 2016-08-24 13:28:06 -07:00
Dan Finlay
671ca33abb Close notification on opening main UI 2016-08-23 15:44:50 -07:00
Dan Finlay
b3887ffd0a Skip popup dismissal in tests 2016-08-23 11:48:46 -07:00
Dan Finlay
4fb49dfb4b Close popup even if last tx is dismissed from main UI 2016-08-23 11:40:08 -07:00
Dan Finlay
e5ca83d2bf Emit updates to all listeners on pending tx updates
Previously the metamask controller only supported a single UI event listener, which wasn't useful for having a separate notification UI open at the same time.

Also reduced the notification's complexity down to a single method, which is heavily re-used.

Still has an outstanding bug where if the plugin ui dismisses the last tx, it does not close the notification popup.
2016-08-23 11:15:56 -07:00
Dan Finlay
49ab51d825 Merge branch 'master' into PopupNotifications 2016-08-22 20:06:59 -07:00
kumavis
5c9ca21ba3 Merge branch 'master' into i390-TransactionLimit 2016-08-22 19:19:53 -07:00
kumavis
b8077983d6 inpage provider - reassign incomming ids 2016-08-22 18:59:15 -07:00
Dan Finlay
361e26fad7 Limit to one popup, re-focus on additional notifications. 2016-08-22 17:18:14 -07:00
Dan Finlay
6e1000f361 Merge branch 'master' into PopupNotifications 2016-08-22 15:03:36 -07:00
Dan Finlay
3d451ddf3e Merge branch 'master' into i390-TransactionLimit 2016-08-22 11:59:08 -07:00
Dan Finlay
7389f9d0a0 Enforce tx history limit 2016-08-18 15:40:56 -07:00
Frankie
3525dc0801 Create a ShapeShift tx in tx History 2016-08-18 15:20:26 -07:00
Frankie
efa61f2cf8 Merge branch 'master' into shapeshiftTx 2016-08-18 11:06:32 -07:00
Frankie
752d16f6c0 WIP: ShapeShift tx 2016-08-18 11:04:28 -07:00
Dan Finlay
dfaac78e39 Linted 2016-08-16 17:50:51 -07:00
Dan Finlay
a167bbc5a0 MVP Popup Notifications Working
I'm unsure which will be more performant: A notification using a trimmed down version of the UI, or using them both, letting the browser cache them both.

In any case, here I've modified the normal UI to recognize when it's a popup, and change the UX accordingly in a few ways:
 - Hide the menu bar
 - Hide the back button from the notifications view.
 - When confirming the last tx, close the window.
2016-08-16 17:32:54 -07:00
Dan Finlay
030bdec27a Unify notification and popup ui files 2016-08-16 16:46:44 -07:00
Dan Finlay
4ba90969ee Merge branch 'master' into PopupNotifications 2016-08-16 15:41:11 -07:00
Dan Finlay
5479509618 Set up MVP for popup-based notifications. 2016-08-16 15:39:40 -07:00
Kevin Serrano
666f3cd66c Added compliance for tests and properly accounts for N/A conversions. 2016-08-16 15:11:40 -07:00
Kevin Serrano
6041ba1ed2 Add fallback to API failure. 2016-08-16 14:07:06 -07:00
Kevin Serrano
6895d330ff Merge master. 2016-08-15 10:50:53 -07:00
Dan Finlay
e826eb932c Remove ethereum classic provider
Fixes #542
2016-08-14 18:41:05 -07:00
kumavis
0b660f4ac8 deps - extracted ensnare to module 2016-08-12 13:25:38 -07:00
Kevin Serrano
b1f68ec9cd Add global var for background. 2016-08-11 19:44:59 -07:00
kumavis
c0f7c49105 inpage-prov - sync error - fix link 2016-08-11 14:35:55 -07:00
kumavis
d7dffedf48 deps - local-message-stream extracted as module post-message-stream 2016-08-11 14:04:20 -07:00
kumavis
53b1334d37 clean -formatting 2016-08-11 13:31:00 -07:00
kumavis
3417c421c8 inpage-provider - remove createSyncProvider, just fail 2016-08-11 13:23:49 -07:00
Kevin Serrano
abfc5632ef Fix ether warning checkbox. 2016-08-10 10:54:55 -07:00