paych: Print available amounts in paych status

This commit is contained in:
Łukasz Magiera 2022-01-04 23:20:11 +01:00
parent 7a938b2dea
commit 8f6f21c94c
4 changed files with 10 additions and 0 deletions

View File

@ -854,6 +854,10 @@ type ChannelAvailableFunds struct {
ConfirmedAmt types.BigInt
// PendingAmt is the amount of funds that are pending confirmation on-chain
PendingAmt types.BigInt
// AvailableAmt is part of ConfirmedAmt that is available for use (pre-allocated)
AvailableAmt types.BigInt
// PendingAvailableAmt is the amount of available funds that are pending confirmation on-chain
PendingAvailableAmt types.BigInt
// PendingWaitSentinel can be used with PaychGetWaitReady to wait for
// confirmation of pending funds
PendingWaitSentinel *cid.Cid

View File

@ -191,6 +191,8 @@ func paychStatus(writer io.Writer, avail *api.ChannelAvailableFunds) {
{"To", avail.To.String()},
{"Confirmed Amt", fmt.Sprintf("%s", types.FIL(avail.ConfirmedAmt))},
{"Pending Amt", fmt.Sprintf("%s", types.FIL(avail.PendingAmt))},
{"Available Amt", fmt.Sprintf("%s", types.FIL(avail.AvailableAmt))},
{"Pending Available Amt", fmt.Sprintf("%s", types.FIL(avail.PendingAvailableAmt))},
{"Queued Amt", fmt.Sprintf("%s", types.FIL(avail.QueuedAmt))},
{"Voucher Redeemed Amt", fmt.Sprintf("%s", types.FIL(avail.VoucherReedeemedAmt))},
}

View File

@ -142,6 +142,8 @@ func (pm *Manager) AvailableFundsByFromTo(ctx context.Context, from address.Addr
To: to,
ConfirmedAmt: types.NewInt(0),
PendingAmt: types.NewInt(0),
AvailableAmt: types.NewInt(0),
PendingAvailableAmt: types.NewInt(0),
PendingWaitSentinel: nil,
QueuedAmt: types.NewInt(0),
VoucherReedeemedAmt: types.NewInt(0),

View File

@ -340,6 +340,8 @@ func (ca *channelAccessor) currentAvailableFunds(ctx context.Context, channelID
To: channelInfo.to(),
ConfirmedAmt: channelInfo.Amount,
PendingAmt: channelInfo.PendingAmount,
AvailableAmt: channelInfo.AvailableAmount,
PendingAvailableAmt: channelInfo.PendingAvailableAmount,
PendingWaitSentinel: waitSentinel,
QueuedAmt: queuedAmt,
VoucherReedeemedAmt: totalRedeemed,