Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
refactor(grpc): remove unused event emits
Browse files Browse the repository at this point in the history
  • Loading branch information
korhaliv committed Oct 7, 2019
1 parent 48b71b0 commit 1984974
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions services/grpc/lightning.methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,22 @@ async function openChannel(payload = {}) {
call.on('data', data => {
grpcLog.debug('OPEN_CHANNEL DATA', data)
const response = { ...parsePayload(payload), data }
this.emit('openChannel.data', response)
resolve(response)
})

call.on('error', data => {
grpcLog.error('OPEN_CHANNEL ERROR', data)
const error = new Error(data.message)
error.payload = parsePayload(payload)
this.emit('openChannel.error', error)
reject(error)
})

call.on('status', status => {
grpcLog.debug('OPEN_CHANNEL STATUS', status)
this.emit('openChannel.status', status)
})

call.on('end', () => {
grpcLog.debug('OPEN_CHANNEL END')
this.emit('openChannel.end')
})
} catch (e) {
const error = new Error(e.message)
Expand Down Expand Up @@ -235,26 +231,22 @@ async function closeChannel(payload = {}) {
call.on('data', data => {
grpcLog.debug('CLOSE_CHANNEL DATA', data)
const response = { data, chan_id }
this.emit('closeChannel.data', response)
resolve(response)
})

call.on('error', data => {
grpcLog.error('CLOSE_CHANNEL ERROR', data)
const error = new Error(data.message)
error.payload = { chan_id }
this.emit('closeChannel.error', error)
reject(error)
})

call.on('status', status => {
grpcLog.debug('CLOSE_CHANNEL STATUS', status)
this.emit('closeChannel.status', status)
})

call.on('end', () => {
grpcLog.debug('CLOSE_CHANNEL END')
this.emit('closeChannel.end')
})
} catch (e) {
const error = new Error(e.message)
Expand Down

0 comments on commit 1984974

Please # to comment.