From 25417fad26566ca3f6e3ccbc4bf6508239f90e58 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 16 Jul 2018 20:01:36 -0230 Subject: [PATCH] Add updateSendHexData action --- ui/app/actions.js | 9 +++++++++ ui/app/reducers/metamask.js | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/ui/app/actions.js b/ui/app/actions.js index 0aeb802f8..d8b3ed69d 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -164,6 +164,7 @@ var actions = { UPDATE_GAS_PRICE: 'UPDATE_GAS_PRICE', UPDATE_GAS_TOTAL: 'UPDATE_GAS_TOTAL', UPDATE_SEND_FROM: 'UPDATE_SEND_FROM', + UPDATE_SEND_HEX_DATA: 'UPDATE_SEND_HEX_DATA', UPDATE_SEND_TOKEN_BALANCE: 'UPDATE_SEND_TOKEN_BALANCE', UPDATE_SEND_TO: 'UPDATE_SEND_TO', UPDATE_SEND_AMOUNT: 'UPDATE_SEND_AMOUNT', @@ -183,6 +184,7 @@ var actions = { setSendTokenBalance, updateSendTokenBalance, updateSendFrom, + updateSendHexData, updateSendTo, updateSendAmount, updateSendMemo, @@ -838,6 +840,13 @@ function updateSendFrom (from) { } } +function updateSendHexData (value) { + return { + type: actions.UPDATE_SEND_HEX_DATA, + value, + } +} + function updateSendTo (to, nickname = '') { return { type: actions.UPDATE_SEND_TO, diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index 6c8ac9ed7..3f1d3394f 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -222,6 +222,14 @@ function reduceMetamask (state, action) { }, }) + case actions.UPDATE_SEND_HEX_DATA: + return extend(metamaskState, { + send: { + ...metamaskState.send, + data: action.value, + }, + }) + case actions.UPDATE_SEND_FROM: return extend(metamaskState, { send: {