From 6713d1d15d608f9830d937803579a92e32afa69c Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Tue, 5 Sep 2017 13:13:26 -0500 Subject: [PATCH] fix(lint): fix linting errors --- app/lnd/methods/closechannel.js | 4 ++-- app/lnd/push/closechannel.js | 1 - app/reducers/channels.js | 16 ++++++++++++++-- app/reducers/ipc.js | 8 ++++---- .../components/components/Channels/Channels.js | 8 +++++++- .../reducers/__snapshots__/channels.spec.js.snap | 6 ++++++ 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/app/lnd/methods/closechannel.js b/app/lnd/methods/closechannel.js index 537b6de9..feb9abf7 100644 --- a/app/lnd/methods/closechannel.js +++ b/app/lnd/methods/closechannel.js @@ -5,7 +5,7 @@ const BufferUtil = bitcore.util.buffer export default function closechannel(lnd, event, payload) { const tx = payload.channel_point.funding_txid.match(/.{2}/g).reverse().join('') - const res = { + const res = { channel_point: { funding_txid: BufferUtil.hexToBuffer(tx), output_index: Number(payload.channel_point.output_index) @@ -17,4 +17,4 @@ export default function closechannel(lnd, event, payload) { .then(data => resolve(data)) .catch(error => reject(error)) ) -} \ No newline at end of file +} diff --git a/app/lnd/push/closechannel.js b/app/lnd/push/closechannel.js index 5ed16f75..a522874f 100644 --- a/app/lnd/push/closechannel.js +++ b/app/lnd/push/closechannel.js @@ -10,7 +10,6 @@ export default function pushclosechannel(lnd, event, payload) { resolve(null, payload) } catch (error) { - console.log('error: ', error) reject(error, null) } }) diff --git a/app/reducers/channels.js b/app/reducers/channels.js index b7b00b9c..b0a9f20c 100644 --- a/app/reducers/channels.js +++ b/app/reducers/channels.js @@ -111,7 +111,19 @@ export const pushchannelstatus = () => (dispatch) => { export const closeChannel = ({ channel_point }) => (dispatch) => { dispatch(closingChannel()) const channelPoint = channel_point.split(':') - ipcRenderer.send('lnd', { msg: 'closeChannel', data: { channel_point: { funding_txid: channelPoint[0], output_index: channelPoint[1] }, force: true } }) + ipcRenderer.send( + 'lnd', + { + msg: 'closeChannel', + data: { + channel_point: { + funding_txid: channelPoint[0], + output_index: channelPoint[1] + }, + force: true + } + } + ) } // TODO: Decide how to handle streamed updates for closing channels @@ -203,7 +215,7 @@ const initialState = { push_amt: '' }, openingChannel: false, - closeChannel: false + closingChannel: false } export default function channelsReducer(state = initialState, action) { diff --git a/app/reducers/ipc.js b/app/reducers/ipc.js index 79c41dd0..15a92e75 100644 --- a/app/reducers/ipc.js +++ b/app/reducers/ipc.js @@ -5,7 +5,7 @@ import { receiveCryptocurrency } from './ticker' import { receivePeers, connectSuccess, disconnectSuccess } from './peers' import { receiveChannels, - + channelSuccessful, pushchannelupdated, pushchannelend, @@ -16,7 +16,7 @@ import { pushclosechannelupdated, pushclosechannelend, pushclosechannelerror, - pushclosechannelstatus, + pushclosechannelstatus } from './channels' import { receivePayments, paymentSuccessful } from './payment' @@ -38,7 +38,7 @@ const ipc = createIpc({ createdInvoice, receiveBalance, - + paymentSuccessful, channelSuccessful, @@ -54,7 +54,7 @@ const ipc = createIpc({ connectSuccess, disconnectSuccess, - + receiveAddress, receiveCryptocurrency }) diff --git a/app/routes/wallet/components/components/Channels/Channels.js b/app/routes/wallet/components/components/Channels/Channels.js index 8f236fe2..0334b2ca 100644 --- a/app/routes/wallet/components/components/Channels/Channels.js +++ b/app/routes/wallet/components/components/Channels/Channels.js @@ -24,7 +24,13 @@ const Channels = ({ explorerLinkBase }) => (
- +

Channels

diff --git a/test/reducers/__snapshots__/channels.spec.js.snap b/test/reducers/__snapshots__/channels.spec.js.snap index 62a63fe2..f8f621a6 100644 --- a/test/reducers/__snapshots__/channels.spec.js.snap +++ b/test/reducers/__snapshots__/channels.spec.js.snap @@ -11,6 +11,7 @@ Object { }, "channels": Array [], "channelsLoading": true, + "closingChannel": false, "openingChannel": false, "pendingChannels": Object { "pending_closing_channels": Array [], @@ -32,6 +33,7 @@ Object { }, "channels": Array [], "channelsLoading": false, + "closingChannel": false, "openingChannel": true, "pendingChannels": Object { "pending_closing_channels": Array [], @@ -56,6 +58,7 @@ Object { 2, ], "channelsLoading": false, + "closingChannel": false, "openingChannel": false, "pendingChannels": Array [ 3, @@ -75,6 +78,7 @@ Object { }, "channels": Array [], "channelsLoading": false, + "closingChannel": false, "openingChannel": false, "pendingChannels": Object { "pending_closing_channels": Array [], @@ -96,6 +100,7 @@ Object { }, "channels": Array [], "channelsLoading": false, + "closingChannel": false, "openingChannel": false, "pendingChannels": Object { "pending_closing_channels": Array [], @@ -117,6 +122,7 @@ Object { }, "channels": Array [], "channelsLoading": false, + "closingChannel": false, "openingChannel": false, "pendingChannels": Object { "pending_closing_channels": Array [],