From 533349cc0d0d13de84531e2deb822b2f3a51a210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 5 Jan 2022 12:11:19 +0100 Subject: [PATCH] paych: Fix cli tests --- cli/paych.go | 4 ++-- itests/paych_cli_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/paych.go b/cli/paych.go index 171ab38ab..29e8c6407 100644 --- a/cli/paych.go +++ b/cli/paych.go @@ -193,11 +193,11 @@ func paychStatus(writer io.Writer, avail *api.ChannelAvailableFunds) { {"From", avail.From.String()}, {"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))}, + {"Voucher Redeemed Amt", fmt.Sprintf("%s", types.FIL(avail.VoucherReedeemedAmt))}, + {"Pending Amt", fmt.Sprintf("%s", types.FIL(avail.PendingAmt))}, {"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))}, } if avail.PendingWaitSentinel != nil { nameValues = append(nameValues, []string{ diff --git a/itests/paych_cli_test.go b/itests/paych_cli_test.go index a4ad1920b..f964d7813 100644 --- a/itests/paych_cli_test.go +++ b/itests/paych_cli_test.go @@ -133,10 +133,10 @@ func TestPaymentChannelStatus(t *testing.T) { require.True(t, stateCreating || stateCreated) channelAmtAtto := types.BigMul(types.NewInt(channelAmt), types.NewInt(build.FilecoinPrecision)) - channelAmtStr := fmt.Sprintf("%d", channelAmtAtto) + channelAmtStr := fmt.Sprintf("%s", types.FIL(channelAmtAtto)) if stateCreating { // If we're in the creating state (most likely) the amount should be pending - require.Regexp(t, regexp.MustCompile("Pending.*"+channelAmtStr), out) + require.Regexp(t, regexp.MustCompile("Pending Amt.*"+channelAmtStr), out) } // Wait for create channel to complete @@ -159,7 +159,7 @@ func TestPaymentChannelStatus(t *testing.T) { out = creatorCLI.RunCmd("paych", "status", chstr) fmt.Println(out) voucherAmtAtto := types.BigMul(types.NewInt(voucherAmt), types.NewInt(build.FilecoinPrecision)) - voucherAmtStr := fmt.Sprintf("%d", voucherAmtAtto) + voucherAmtStr := fmt.Sprintf("%s", types.FIL(voucherAmtAtto)) // Output should include voucher amount require.Regexp(t, regexp.MustCompile("Voucher.*"+voucherAmtStr), out) }