aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-05-24 02:33:15 +0800
committerDan <danjm.com@gmail.com>2018-05-24 02:33:15 +0800
commit440905125d77d1d5d72d1aceac2940925a8ac38f (patch)
treed5418384983f9de8092d2dfdd1ddddec2ffd555e /docs
parent3dec7cb52443b24d6a24f75434ee41a54f4cfd0b (diff)
parented01c6c8264a860cdc4248991839954bdf22e2ef (diff)
downloadtangerine-wallet-browser-440905125d77d1d5d72d1aceac2940925a8ac38f.tar.gz
tangerine-wallet-browser-440905125d77d1d5d72d1aceac2940925a8ac38f.tar.zst
tangerine-wallet-browser-440905125d77d1d5d72d1aceac2940925a8ac38f.zip
Merge branch 'develop' into i3725-refactor-send-component-
Diffstat (limited to 'docs')
-rw-r--r--docs/porting_to_new_environment.md13
-rw-r--r--docs/send-screen-QA-checklist.md96
2 files changed, 108 insertions, 1 deletions
diff --git a/docs/porting_to_new_environment.md b/docs/porting_to_new_environment.md
index 729a28e5d..3b1e46052 100644
--- a/docs/porting_to_new_environment.md
+++ b/docs/porting_to_new_environment.md
@@ -1,6 +1,16 @@
# Guide to Porting MetaMask to a New Environment
-MetaMask has been under continuous development for nearly two years now, and we’ve gradually discovered some very useful abstractions, that have allowed us to grow more easily. A couple of those layers together allow MetaMask to be ported to new environments and contexts increasingly easily.
+MetaMask has been under continuous development for nearly two years now, and we’ve gradually discovered some useful abstractions that have allowed us to grow more easily. A couple of those layers together allow MetaMask to be ported to new environments and contexts increasingly easily (although it still could be easier, and please let us know if you get stuck!)
+
+Before we get started, it's worth becoming familiar with our basic architecture:
+
+![metamask-architecture-diagram](./architecture.png)
+
+The `metamask-background` describes the file at `app/scripts/background.js`, which is the web extension singleton. This context instantiates an instance of the `MetaMask Controller`, which represents the user's accounts, a connection to the blockchain, and the interaction with new Dapps.
+
+When a new site is visited, the WebExtension creates a new `ContentScript` in that page's context, which can be seen at `app/scripts/contentscript.js`. This script represents a per-page setup process, which creates the per-page `web3` api, connects it to the background script via the Port API (wrapped in a [stream abstraction](https://github.com/substack/stream-handbook)), and injected into the DOM before anything loads.
+
+The most confusing part about porting MetaMask to a new platform is the way we provide the Web3 API over a series of streams between contexts. Once you understand how we create the [InpageProvider](../app/scripts/lib/inpage-provider.js) in the [inpage.js script](../app/scripts/inpage.js), you will be able to understand how the [port-stream](../app/scripts/lib/port-stream.js) is just a thin wrapper around the [postMessage API](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage), and a similar stream API can be wrapped around any communication channel to communicate with the `MetaMaskController` via its `setupUntrustedCommunication(stream, domain)` method.
### The MetaMask Controller
@@ -90,3 +100,4 @@ If streams seem new and confusing to you, that's ok, they can seem strange at fi
## Conclusion
I hope this has been helpful to you! If you have any other questionsm, or points you think need clarification in this guide, please [open an issue on our GitHub](https://github.com/MetaMask/metamask-plugin/issues/new)!
+
diff --git a/docs/send-screen-QA-checklist.md b/docs/send-screen-QA-checklist.md
new file mode 100644
index 000000000..52167b50b
--- /dev/null
+++ b/docs/send-screen-QA-checklist.md
@@ -0,0 +1,96 @@
+# Send screen QA checklist:
+
+This checklist can be to guide QA of the send screen. It can also be used to guide e2e tests for the send screen.
+
+Once all of these are QA verified on master, resolutions to any bugs related to the send screen should include and update to this list.
+
+Additional features or functionality on the send screen should include an update to this list.
+
+## Send Eth mode
+ - [ ] **Header** _It should:_
+ - [ ] have title "Send ETH"
+ - [ ] have sub title "Only send ETH to an Ethereum address."
+ - [ ] return user to main screen when top right X is clicked
+ - [ ] **From row** _It should:_
+ - [ ] show the currently selected account by default
+ - [ ] show a dropdown with all of the users accounts
+ - [ ] contain the following info for each account: identicon, account name, balance in ETH, balance in current currency
+ - [ ] change the account selected in the dropdown (but not the app-wide selected account) when one in the dropdown is clicked
+ - [ ] close the dropdown, without changing the dropdown selected account, when the dropdown is open and then a click happens outside it
+ - [ ] **To row** _It should:_
+ - [ ] Show a placeholder with the text 'Recipient Address' by default
+ - [ ] Show, when clicked, a dropdown list of all 'to accounts': the users accounts, plus any other accounts they have previously sent to
+ - [ ] Show account address, and account name if it exists, of each item in the dropdown list
+ - [ ] Show a dropdown list of all to accounts (see above) whose address matches an address currently being typed in
+ - [ ] Set the input text to the address of an account clicked in the dropdown list, and also hide the dropdown
+ - [ ] Hide the dropdown without changing what is in the input if the user clicks outside the dropdown list while it is open
+ - [ ] Select the text in the input (i.e. the address) if an address is displayed and then clicked
+ - [ ] Show a 'required' error if the dropdown is opened but no account is selected
+ - [ ] Show an 'invalid address' error if text is entered in the input that cannot be a valid hex address or ens address
+ - [ ] Support ens names. (enter dinodan.eth on mainnet) After entering the plain text address, the hex address should appear in the input with a green checkmark beside
+ - [ ] Should show a 'no such address' error if a non-existent ens address is entered
+ - [ ] **Amount row** _It should:_
+ - [ ] allow user to enter any rational number >= 0
+ - [ ] allow user to copy and paste into the field
+ - [ ] show an insufficient funds error if an amount > balance - gas fee
+ - [ ] display 'ETH' after the number amount. The position of 'ETH' should change as the length of the input amount text changes
+ - [ ] display the value of the amount of ETH in the current currency, formatted in that currency
+ - [ ] show a 'max' but if amount < balance - gas fee
+ - [ ] show no max button or error if amount === balance - gas fee
+ - [ ] set the amount to balance - gas fee if the 'max' button is clicked
+ - [ ] **Gas Fee Display row** _It should:_
+ - [ ] Default to the fee given by the estimated gas price
+ - [ ] display the fee in ETH and the current currency
+ - [ ] update when changes are made using the customize gas modal
+ - [ ] **Cancel button** _It should:_
+ - [ ] Take the user back to the main screen
+ - [ ] **submit button** _It should:_
+ - [ ] be disabled if no recipient address is provided or if any field is in error
+ - [ ] sign a transaction with the info in the above form, and display the details of that transaction on the confirm screen
+
+## Send token mode
+- [ ] **Header** _It should:_
+ - [ ] have title "Send Tokens"
+ - [ ] have sub title "Only send [token symbol] to an Ethereum address."
+ - [ ] return user to main screen when top right X is clicked
+- [ ] **From row** _It should:_
+ - [ ] Behave the same as 'Send ETH mode' (see above)
+- [ ] **To row** _It should:_
+ - [ ] Behave the same as 'Send ETH mode' (see above)
+- [ ] **Amount row** _It should:_
+ - [ ] allow user to enter any rational number >= 0
+ - [ ] allow user to copy and paste into the field
+ - [ ] show an 'insufficient tokens' error if an amount > token balance
+ - [ ] show an 'insufficient funds' error if an gas fee > eth balance
+ - [ ] display [token symbol] after the number amount. The position of [token symbol] should change as the length of the input amount text changes
+ - [ ] display the value of the amount of tokens in the current currency, formatted in that currency
+ - [ ] show a 'max' but if amount < token balance
+ - [ ] show no max button or error if amount === token balance
+ - [ ] set the amount to token balance if the 'max' button is clicked
+- [ ] **Gas Fee Display row** _It should:_
+ - [ ] Behave the same as 'Send ETH mode' (see above)
+- [ ] **Cancel button** _It should:_
+ - [ ] Take the user back to the main screen
+- [ ] **submit button** _It should:_
+ - [ ] be disabled if no recipient address is provided or if any field is in error
+ - [ ] sign a token transaction with the info in the above form, and display the details of that transaction on the confirm screen
+
+## Edit send Eth mode
+ - [ ] Say 'Editing transaction' in the header
+ - [ ] display a button to go back to the confirmation screen without applying update
+ - [ ] say 'update transaction' on the submit button
+ - [ ] update the existing transaction, instead of signing a new one, when clicking the submit button
+ - [ ] Otherwise, behave the same as 'Send ETH mode' (see above)
+
+## Edit send token mode
+ - [ ] Behave the same as 'Edit send Eth mode' (see above)
+
+## Specific cases to test
+ - [ ] Send eth to a hex address
+ - [ ] Send eth to an ENS address
+ - [ ] Donate to the faucet at https://faucet.metamask.io/ and edit the transaction before confirming
+ - [ ] Send a token that is available on the 'Add Token' screen search to a hex address
+ - [ ] Create a custom token at https://tokenfactory.surge.sh/ and send it to a hex address
+ - [ ] Send a token to an ENS address
+ - [ ] Create a token transaction using https://tokenfactory.surge.sh/#/, and edit the transaction before confirming
+ - [ ] Send each of MKR, EOS and ICON using myetherwallet, and edit the transaction before confirming