Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Inflate channel's settlingUntil value
Browse files Browse the repository at this point in the history
  • Loading branch information
ukstv committed Feb 5, 2019
1 parent ed6ae48 commit fd4905f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/machinomy/src/ChannelInflator.ts
Expand Up @@ -2,6 +2,7 @@ import ChannelEthContract from './ChannelEthContract'
import ChannelTokenContract from './ChannelTokenContract' import ChannelTokenContract from './ChannelTokenContract'
import { PaymentChannel, PaymentChannelJSON } from './PaymentChannel' import { PaymentChannel, PaymentChannelJSON } from './PaymentChannel'
import { ChannelState } from './ChannelState' import { ChannelState } from './ChannelState'
import { BigNumber } from 'bignumber.js'


export default class ChannelInflator { export default class ChannelInflator {
channelEthContract: ChannelEthContract channelEthContract: ChannelEthContract
Expand All @@ -24,7 +25,8 @@ export default class ChannelInflator {
const state = await contract.getState(channelId) const state = await contract.getState(channelId)
const channel = await contract.channelById(channelId) const channel = await contract.channelById(channelId)
if (channel) { if (channel) {
let value = channel[2] const value = channel[2]
const settlingUntil = new BigNumber(channel[4])


return new PaymentChannel( return new PaymentChannel(
paymentChannelJSON.sender, paymentChannelJSON.sender,
Expand All @@ -35,7 +37,7 @@ export default class ChannelInflator {
state === ChannelState.Impossible ? ChannelState.Settled : state, state === ChannelState.Impossible ? ChannelState.Settled : state,
paymentChannelJSON.tokenContract, paymentChannelJSON.tokenContract,
paymentChannelJSON.settlementPeriod, paymentChannelJSON.settlementPeriod,
paymentChannelJSON.settlingUntil settlingUntil
) )
} else { } else {
return null return null
Expand Down

0 comments on commit fd4905f

Please sign in to comment.