From fd4905f874aceb588fbac163a7f108638cf322bc Mon Sep 17 00:00:00 2001 From: Sergey Ukustov Date: Tue, 5 Feb 2019 12:35:02 +0400 Subject: [PATCH] Inflate channel's settlingUntil value --- packages/machinomy/src/ChannelInflator.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/machinomy/src/ChannelInflator.ts b/packages/machinomy/src/ChannelInflator.ts index 0eea5cfe..cefadc24 100644 --- a/packages/machinomy/src/ChannelInflator.ts +++ b/packages/machinomy/src/ChannelInflator.ts @@ -2,6 +2,7 @@ import ChannelEthContract from './ChannelEthContract' import ChannelTokenContract from './ChannelTokenContract' import { PaymentChannel, PaymentChannelJSON } from './PaymentChannel' import { ChannelState } from './ChannelState' +import { BigNumber } from 'bignumber.js' export default class ChannelInflator { channelEthContract: ChannelEthContract @@ -24,7 +25,8 @@ export default class ChannelInflator { const state = await contract.getState(channelId) const channel = await contract.channelById(channelId) if (channel) { - let value = channel[2] + const value = channel[2] + const settlingUntil = new BigNumber(channel[4]) return new PaymentChannel( paymentChannelJSON.sender, @@ -35,7 +37,7 @@ export default class ChannelInflator { state === ChannelState.Impossible ? ChannelState.Settled : state, paymentChannelJSON.tokenContract, paymentChannelJSON.settlementPeriod, - paymentChannelJSON.settlingUntil + settlingUntil ) } else { return null