aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-08-02 11:57:26 +0800
committerGitHub <noreply@github.com>2019-08-02 11:57:26 +0800
commit3eff4787757ac22d0a469c91599cdcfd97a2a98c (patch)
treed0ba3b8b5fbbb9f6d68ba227fa3fd8410b766912 /test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js
parent189e126f6184b4351a9f11d8dc063d7abd5e9bbe (diff)
downloadtangerine-wallet-browser-3eff4787757ac22d0a469c91599cdcfd97a2a98c.tar.gz
tangerine-wallet-browser-3eff4787757ac22d0a469c91599cdcfd97a2a98c.tar.zst
tangerine-wallet-browser-3eff4787757ac22d0a469c91599cdcfd97a2a98c.zip
I5849 incremental account security (#6874)
* Implements ability to defer seed phrase backup to later * Adds incremental-security.spec.js, including test dapp that sends signed tx with stand alone localhost provider * Update metamask-responsive-ui for incremental account security changes * Update backup-notification style and fix responsiveness of seed phrase screen * Remove uneeded files from send-eth-with-private-key-test/ * Apply linguist flags in .gitattributes for send-eth-with-private-key-test/ethereumjs-tx.js * Improve docs in controllers/onboarding.js * Clean up metamask-extension/test/e2e/send-eth-with-private-key-test/index.html * Remove unnecessary newlines in a couple first-time-flow/ files * Fix import of backup-notification in home.component * Fix git attrs file
Diffstat (limited to 'test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js')
-rw-r--r--test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js b/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js
new file mode 100644
index 000000000..5f7291950
--- /dev/null
+++ b/test/e2e/send-eth-with-private-key-test/send-eth-with-private-key.js
@@ -0,0 +1,28 @@
+/* eslint-disable */
+var Tx = ethereumjs.Tx
+var privateKey = ethereumjs.Buffer.Buffer.from('53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9', 'hex')
+
+const web3 = new Web3(new Web3.providers.HttpProvider(`http://localhost:8545`))
+
+const sendButton = document.getElementById('send')
+
+sendButton.addEventListener('click', function () {
+ var rawTx = {
+ nonce: '0x00',
+ gasPrice: '0x09184e72a000',
+ gasLimit: '0x22710',
+ value: '0xde0b6b3a7640000',
+ r: '0x25a1bc499cd8799a2ece0fcba0df6e666e54a6e2b4e18c09838e2b621c10db71',
+ s: '0x6cf83e6e8f6e82a0a1d7bd10bc343fc0ae4b096c1701aa54e6389d447f98ac6f',
+ v: '0x2d46',
+ to: document.getElementById('address').value,
+ }
+ var tx = new Tx(rawTx);
+ tx.sign(privateKey);
+
+ var serializedTx = tx.serialize();
+
+ web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex')).on('receipt', (transactionResult) => {
+ document.getElementById('success').innerHTML = `Successfully sent transaction: ${transactionResult.transactionHash}`
+ })
+})