Fixes#122
Had used multiple actions for some transitions, which would lead to brief intermediary states.
Now making a few actions much more explicit about what they route to, so there is less intermediary logic, and we can transition confidently to the correct view.
Fixes#151
- Cancelling or completing a tx now goes back to account detail view.
- Restoring a vault now does not select an unloaded account, shows account list.
- Account list now never selects an item only uses the cells as buttons.
- When unlocking, the first account is now selected by default and displayed as the main view.
- There is now a "CHANGE ACCT" button on the detail view to show the accounts list.
- Clicking an account from the accounts list now navigates to the detail view and selects that account.
- Config/Info screen "back" buttons now fire a new action, `GO_HOME`, which is configured to navigate to the accountDetail view, putting that logic in one place.
- When locking and unlocking again, the first account is always displayed, eventually we should persist the selection.
This migration will move users who have their clients configured to point at `rawtestrpc.metamask.io` to point at our new test-net RPC, `testrpc.metamask.io`.
When sending a transaction, we were converting to BN before handling decimals, which meant we were losing any precision past a decimal point, since BN does not handle decimals!
Put this numeric normalization into a utility function with a test around it and got it working.
Transactions are now stored, and are never deleted, they only have their status updated.
We can add deleting later if we'd like.
I've hacked on emitting the new unconfirmedTx key to the UI in the format it received before, I want Aaron's opinion on where I should actually do that.
Abstract all configuration data into a singleton called `configManager`, who is responsible for reading and writing to the persisted storage (localStorage, in our case).
Uses my new module [pojo-migrator](https://www.npmjs.com/package/pojo-migrator), and wraps it with the `ConfigManager` class, which we can hang any state setting or getting methods we need.
By keeping all the persisted state in one place, we can stabilize its outward-facing API, making the interactions increasingly atomic, which will allow us to add features that require restructuring the persisted data in the long term without having to rewrite UI or even `background.js` code.
All the restructuring and data-type management is kept in one neat little place.
This should make it very easy to add new configuration options like user-configured providers, per-domain vaults, and more!
I know this doesn't seem like a big user-facing feature, but we have a big laundry list of features that I think this will really help streamline.
Also added the hdPath that Christian had told me to our calls to the LightWallet, but this does not seem to have made us generate the same accounts as `testrpc` yet.
Added initial test just to verify we can recover the accounts we generate in this way.
Still need to add compliance test to make sure this interoperates with testrpc's new mnemonic flag.