diff --git a/development/states/send-new-ui.json b/development/states/send-new-ui.json index 0cd2f23f2..9be4ef0da 100644 --- a/development/states/send-new-ui.json +++ b/development/states/send-new-ui.json @@ -159,4 +159,319 @@ "nonce": "", "fetchingMethodData": false } + "gas": { + "customData": { + "price": null, + "limit": "0x186a0" + }, + "basicEstimates": { + "average": 73, + "avgWait": 10.6, + "blockTime": 13.871657754010695, + "blockNum": 6655504, + "fast": 160, + "fastest": 290, + "fastestWait": 0.5, + "fastWait": 0.6, + "safeLow": 50, + "safeLowWait": 16.1, + "speed": 0.6702462692280712 + }, + "basicEstimateIsLoading": false, + "gasEstimatesLoading": false, + "priceAndTimeEstimates": [ + { + "expectedTime": "1374.1168296452973076627", + "expectedWait": 99.0593088449, + "gasprice": 4.1 + }, + { + "expectedTime": "1280.88976972896682763716", + "expectedWait": 92.3386225672, + "gasprice": 4.4 + }, + { + "expectedTime": "1245.13314632680319175597", + "expectedWait": 89.7609477113, + "gasprice": 4.8 + }, + { + "expectedTime": "1227.99925007911014385881", + "expectedWait": 88.5257747744, + "gasprice": 4.9 + }, + { + "expectedTime": "965.52572720362993349654", + "expectedWait": 69.6042062402, + "gasprice": 5 + }, + { + "expectedTime": "917.466895447437420776", + "expectedWait": 66.1396721082, + "gasprice": 5.1 + }, + { + "expectedTime": "915.81694044041496090521", + "expectedWait": 66.0207277804, + "gasprice": 5.2 + }, + { + "expectedTime": "902.13145619709089691874", + "expectedWait": 65.034148924, + "gasprice": 5.3 + }, + { + "expectedTime": "890.83591122200105749896", + "expectedWait": 64.2198594443, + "gasprice": 5.4 + }, + { + "expectedTime": "879.10469542971335712248", + "expectedWait": 63.3741627006, + "gasprice": 5.5 + }, + { + "expectedTime": "876.99737395823100420974", + "expectedWait": 63.2222470818, + "gasprice": 5.6 + }, + { + "expectedTime": "865.96781957003849098957", + "expectedWait": 62.4271327138, + "gasprice": 5.7 + }, + { + "expectedTime": "865.44839472121496158482", + "expectedWait": 62.3896876688, + "gasprice": 5.8 + }, + { + "expectedTime": "802.16173170976255602161", + "expectedWait": 57.8273877524, + "gasprice": 6 + }, + { + "expectedTime": "780.79313908053047074843", + "expectedWait": 56.2869379368, + "gasprice": 6.1 + }, + { + "expectedTime": "770.04888359616469549233", + "expectedWait": 55.5123906062, + "gasprice": 6.2 + }, + { + "expectedTime": "745.01007965146736962697", + "expectedWait": 53.7073573226, + "gasprice": 6.3 + }, + { + "expectedTime": "735.19921111598501681816", + "expectedWait": 53.0000973318, + "gasprice": 6.6 + }, + { + "expectedTime": "705.68767153912619368694", + "expectedWait": 50.8726270539, + "gasprice": 6.7 + }, + { + "expectedTime": "705.26438593445239690121", + "expectedWait": 50.8421126329, + "gasprice": 6.9 + }, + { + "expectedTime": "652.51573119854865429742", + "expectedWait": 47.0394918019, + "gasprice": 7 + }, + { + "expectedTime": "635.51471669299464383162", + "expectedWait": 45.813898235, + "gasprice": 7.1 + }, + { + "expectedTime": "634.37181911960854759036", + "expectedWait": 45.7315073922, + "gasprice": 7.2 + }, + { + "expectedTime": "633.23097691113902888918", + "expectedWait": 45.6492647195, + "gasprice": 7.3 + }, + { + "expectedTime": "112.7753456245379663928", + "expectedWait": 8.1299111919, + "gasprice": 7.6 + }, + { + "expectedTime": "102.9665314468898381829", + "expectedWait": 7.4227992986, + "gasprice": 8 + }, + { + "expectedTime": "100.94784507024919649891", + "expectedWait": 7.2772733339, + "gasprice": 8.1 + }, + { + "expectedTime": "100.46445647447807351078", + "expectedWait": 7.2424261221, + "gasprice": 8.8 + }, + { + "expectedTime": "84.91686745986737853339", + "expectedWait": 6.1216091808, + "gasprice": 9 + }, + { + "expectedTime": "80.39566429296684383503", + "expectedWait": 5.7956781892, + "gasprice": 9.1 + }, + { + "expectedTime": "78.24522052614759252715", + "expectedWait": 5.6406539084, + "gasprice": 9.2 + }, + { + "expectedTime": "77.1685119880459882636", + "expectedWait": 5.5630345959, + "gasprice": 9.5 + }, + { + "expectedTime": "72.43649507646737870178", + "expectedWait": 5.2219061601, + "gasprice": 9.8 + }, + { + "expectedTime": "71.48259532351443753818", + "expectedWait": 5.1531400638, + "gasprice": 9.9 + }, + { + "expectedTime": "58.23892805162994573827", + "expectedWait": 4.1984115442, + "gasprice": 10 + }, + { + "expectedTime": "53.13065124862245917617", + "expectedWait": 3.8301587446, + "gasprice": 10.1 + }, + { + "expectedTime": "53.03510209647058751971", + "expectedWait": 3.82327066, + "gasprice": 10.3 + }, + { + "expectedTime": "49.06846157804491912403", + "expectedWait": 3.5373177776, + "gasprice": 11 + }, + { + "expectedTime": "48.30893330101818116637", + "expectedWait": 3.4825638116, + "gasprice": 11.1 + }, + { + "expectedTime": "48.25099734861818116715", + "expectedWait": 3.4783872414, + "gasprice": 11.3 + }, + { + "expectedTime": "47.64416885027272662988", + "expectedWait": 3.4346413165, + "gasprice": 11.9 + }, + { + "expectedTime": "46.76354741392085498401", + "expectedWait": 3.3711578128, + "gasprice": 12.6 + }, + { + "expectedTime": "44.99427448545882292232", + "expectedWait": 3.2436119232, + "gasprice": 13 + }, + { + "expectedTime": "44.61790554199251276697", + "expectedWait": 3.2164796979, + "gasprice": 13.1 + }, + { + "expectedTime": "42.87832690973048070488", + "expectedWait": 3.0910744534, + "gasprice": 14 + }, + { + "expectedTime": "42.21224091308663044649", + "expectedWait": 3.0430566888, + "gasprice": 14.9 + }, + { + "expectedTime": "41.15715335111336842864", + "expectedWait": 2.9669960203, + "gasprice": 15 + }, + { + "expectedTime": "40.9600723880876999821", + "expectedWait": 2.9527885646, + "gasprice": 15.1 + }, + { + "expectedTime": "38.89138450301711177472", + "expectedWait": 2.8036580193, + "gasprice": 15.8 + }, + { + "expectedTime": "37.89655640860213852611", + "expectedWait": 2.7319414219, + "gasprice": 16 + }, + { + "expectedTime": "37.35265517364705831954", + "expectedWait": 2.692731888, + "gasprice": 17.4 + }, + { + "expectedTime": "36.79447683873796741798", + "expectedWait": 2.652493126, + "gasprice": 17.8 + }, + { + "expectedTime": "36.11439350850802090309", + "expectedWait": 2.6034663015, + "gasprice": 19 + }, + { + "expectedTime": "31.32676199432192471101", + "expectedWait": 2.2583286403, + "gasprice": 20 + }, + { + "expectedTime": "30.76792490132192471855", + "expectedWait": 2.2180423888, + "gasprice": 20.1 + }, + { + "expectedTime": "29.94493658520962526441", + "expectedWait": 2.1587136243, + "gasprice": 25 + }, + { + "expectedTime": "29.53287347625561457478", + "expectedWait": 2.1290082267, + "gasprice": 29 + }, + { + "expectedTime": "29.09318627175614934008", + "expectedWait": 2.0973114236, + "gasprice": 47 + } + ], + "priceAndTimeEstimatesLastRetrieved": 1541527901281, + "errors": {} + }, } diff --git a/test/integration/lib/send-new-ui.js b/test/integration/lib/send-new-ui.js index 271dd91cf..98e5f549b 100644 --- a/test/integration/lib/send-new-ui.js +++ b/test/integration/lib/send-new-ui.js @@ -21,37 +21,6 @@ global.ethQuery = { global.ethereumProvider = {} -async function customizeGas (assert, price, limit, ethFee, usdFee) { - const sendGasOpenCustomizeModalButton = await queryAsync($, '.sliders-icon-container') - sendGasOpenCustomizeModalButton[0].click() - - const customizeGasModal = await queryAsync($, '.send-v2__customize-gas') - assert.ok(customizeGasModal[0], 'should render the customize gas modal') - - const customizeGasPriceInput = (await queryAsync($, '.send-v2__gas-modal-card')).first().find('input') - customizeGasPriceInput.val(price) - reactTriggerChange(customizeGasPriceInput[0]) - const customizeGasLimitInput = (await queryAsync($, '.send-v2__gas-modal-card')).last().find('input') - customizeGasLimitInput.val(limit) - reactTriggerChange(customizeGasLimitInput[0]) - - const customizeGasSaveButton = await queryAsync($, '.send-v2__customize-gas__save') - customizeGasSaveButton[0].click() - const sendGasField = await queryAsync($, '.send-v2__gas-fee-display') - - assert.equal( - (await findAsync(sendGasField, '.currency-display-component'))[0].textContent, - ethFee, - 'send gas field should show customized gas total' - ) - - assert.equal( - (await findAsync(sendGasField, '.currency-display__converted-value'))[0].textContent, - usdFee, - 'send gas field should show customized gas total converted to USD' - ) -} - async function runSendFlowTest (assert, done) { console.log('*** start runSendFlowTest') const selectState = await queryAsync($, 'select') @@ -112,10 +81,6 @@ async function runSendFlowTest (assert, done) { errorMessage = $('.send-v2__error') assert.equal(errorMessage.length, 0, 'send should stop rendering amount error message after amount is corrected') - await customizeGas(assert, 0, 21000, '0ETH', '$0.00USD') - await customizeGas(assert, 1, 21000, '0.000021ETH', '$0.03USD') - await customizeGas(assert, 500, 60000, '0.03ETH', '$36.03USD') - const sendButton = await queryAsync($, 'button.btn-primary.btn--large.page-container__footer-button') assert.equal(sendButton[0].textContent, 'Next', 'next button rendered') sendButton[0].click() diff --git a/ui/app/app.js b/ui/app/app.js index 10428d1fd..7669a5db9 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -121,8 +121,9 @@ class App extends Component { isOpen: sidebarIsOpen, transitionName: sidebarTransitionName, type: sidebarType, - props: { transaction: sidebarTransaction }, + props, } = sidebar + const { transaction: sidebarTransaction } = props || {} return ( h('.flex-column.full-height', {