diff options
author | Dan J Miller <danjm.com@gmail.com> | 2019-05-15 02:14:07 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2019-05-15 02:14:07 +0800 |
commit | b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0 (patch) | |
tree | f2deb9c7ebb567e02e6fed5f4510062e584f655e /test/e2e/beta/contract-test | |
parent | 3b01ba8741543d54bd2c3aad6a8ea0ef352e8924 (diff) | |
download | tangerine-wallet-browser-b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0.tar tangerine-wallet-browser-b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0.tar.gz tangerine-wallet-browser-b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0.tar.bz2 tangerine-wallet-browser-b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0.tar.lz tangerine-wallet-browser-b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0.tar.xz tangerine-wallet-browser-b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0.tar.zst tangerine-wallet-browser-b81c4e5c98cdf3f5e6ebb05e57c2be993cdf5da0.zip |
Set a default value for code in _determineTransactionCategory (#6604)
* Set a default value for code in _determineTransactionCategory
* Adds e2e tests that fail when token txs without gas param are not properly handled.
* Adds unit tests for _determineTransactionCategory
* Base error throwing and simple gas setting in estimateTxGas on transactionCategory
Diffstat (limited to 'test/e2e/beta/contract-test')
-rw-r--r-- | test/e2e/beta/contract-test/contract.js | 25 | ||||
-rw-r--r-- | test/e2e/beta/contract-test/index.html | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/e2e/beta/contract-test/contract.js b/test/e2e/beta/contract-test/contract.js index e247e26ea..e1f886c58 100644 --- a/test/e2e/beta/contract-test/contract.js +++ b/test/e2e/beta/contract-test/contract.js @@ -37,6 +37,8 @@ web3.currentProvider.enable().then(() => { const createToken = document.getElementById('createToken') const transferTokens = document.getElementById('transferTokens') const approveTokens = document.getElementById('approveTokens') + const transferTokensWithoutGas = document.getElementById('transferTokensWithoutGas') + const approveTokensWithoutGas = document.getElementById('approveTokensWithoutGas') deployButton.addEventListener('click', async function () { document.getElementById('contractStatus').innerHTML = 'Deploying' @@ -135,6 +137,29 @@ web3.currentProvider.enable().then(() => { console.log(result) }) }) + + transferTokensWithoutGas.addEventListener('click', function (event) { + console.log(`event`, event) + contract.transfer('0x2f318C334780961FB129D2a6c30D0763d9a5C970', '7', { + from: web3.eth.accounts[0], + to: contract.address, + data: '0xa9059cbb0000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C970000000000000000000000000000000000000000000000000000000000000000a', + gasPrice: '20000000000', + }, function (result) { + console.log('result', result) + }) + }) + + approveTokensWithoutGas.addEventListener('click', function () { + contract.approve('0x2f318C334780961FB129D2a6c30D0763d9a5C970', '7', { + from: web3.eth.accounts[0], + to: contract.address, + data: '0x095ea7b30000000000000000000000002f318C334780961FB129D2a6c30D0763d9a5C9700000000000000000000000000000000000000000000000000000000000000005', + gasPrice: '20000000000', + }, function (result) { + console.log(result) + }) + }) } }) diff --git a/test/e2e/beta/contract-test/index.html b/test/e2e/beta/contract-test/index.html index 0d422ef20..6e134dc36 100644 --- a/test/e2e/beta/contract-test/index.html +++ b/test/e2e/beta/contract-test/index.html @@ -27,6 +27,8 @@ <button id="createToken">Create Token</button> <button id="transferTokens">Transfer Tokens</button> <button id="approveTokens">Approve Tokens</button> + <button id="transferTokensWithoutGas">Transfer Tokens Without Gas</button> + <button id="approveTokensWithoutGas">Approve Tokens Without Gas</button> </div> </div> |