Browse Source

fix(lint): fix linting errors

renovate/lint-staged-8.x
Jack Mallers 8 years ago
parent
commit
6713d1d15d
  1. 4
      app/lnd/methods/closechannel.js
  2. 1
      app/lnd/push/closechannel.js
  3. 16
      app/reducers/channels.js
  4. 8
      app/reducers/ipc.js
  5. 8
      app/routes/wallet/components/components/Channels/Channels.js
  6. 6
      test/reducers/__snapshots__/channels.spec.js.snap

4
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))
)
}
}

1
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)
}
})

16
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) {

8
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
})

8
app/routes/wallet/components/components/Channels/Channels.js

@ -24,7 +24,13 @@ const Channels = ({
explorerLinkBase
}) => (
<div className={styles.channels}>
<ChannelModal isOpen={channelModalOpen} resetChannel={setChannel} channel={modalChannel} explorerLinkBase={explorerLinkBase} closeChannel={closeChannel} />
<ChannelModal
isOpen={channelModalOpen}
resetChannel={setChannel}
channel={modalChannel}
explorerLinkBase={explorerLinkBase}
closeChannel={closeChannel}
/>
<ChannelForm form={channelForm} setForm={setChannelForm} ticker={ticker} peers={peers} openChannel={openChannel} currentTicker={currentTicker} />
<div className={styles.header}>
<h3>Channels</h3>

6
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 [],

Loading…
Cancel
Save