Skip to content

Commit caa5bd3

Browse files
committed
cmd/account/show: Add JSON output
1 parent 28cfc20 commit caa5bd3

2 files changed

Lines changed: 187 additions & 127 deletions

File tree

cmd/account/show/delegations.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import (
1111
staking "github.com/oasisprotocol/oasis-core/go/staking/api"
1212
"github.com/spf13/cobra"
1313

14-
"github.com/oasisprotocol/cli/cmd/common"
15-
1614
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/config"
1715
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/connection"
1816
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/helpers"
@@ -259,7 +257,7 @@ func prettyPrintParaTimeDelegations(
259257
ctx context.Context,
260258
c connection.Connection,
261259
height int64,
262-
npa *common.NPASelection,
260+
network *config.Network,
263261
addr *types.Address,
264262
rtDelegations []*consensusaccounts.ExtendedDelegationInfo,
265263
rtUndelegations []*consensusaccounts.UndelegationInfo,
@@ -316,21 +314,21 @@ func prettyPrintParaTimeDelegations(
316314

317315
if len(delegations) > 0 {
318316
fmt.Fprintf(w, "%sActive Delegations from this Account:\n", prefix)
319-
fmt.Fprintf(w, "%sTotal: %s\n", innerPrefix, helpers.FormatConsensusDenomination(npa.Network, totalDeg))
317+
fmt.Fprintf(w, "%sTotal: %s\n", innerPrefix, helpers.FormatConsensusDenomination(network, totalDeg))
320318
fmt.Fprintln(w)
321319

322320
sort.Sort(byEndTimeAmountAddress(delegations))
323-
prettyPrintDelegationDescriptions(npa.Network, delegations, "To:", innerPrefix, w)
321+
prettyPrintDelegationDescriptions(network, delegations, "To:", innerPrefix, w)
324322
fmt.Fprintln(w)
325323
}
326324

327325
if len(undelegations) > 0 {
328326
fmt.Fprintf(w, "%sDebonding Delegations from this Account:\n", prefix)
329-
fmt.Fprintf(w, "%sTotal: %s\n", innerPrefix, helpers.FormatConsensusDenomination(npa.Network, totalUndeg))
327+
fmt.Fprintf(w, "%sTotal: %s\n", innerPrefix, helpers.FormatConsensusDenomination(network, totalUndeg))
330328
fmt.Fprintln(w)
331329

332330
sort.Sort(byEndTimeAmountAddress(undelegations))
333-
prettyPrintDelegationDescriptions(npa.Network, undelegations, "To:", innerPrefix, w)
331+
prettyPrintDelegationDescriptions(network, undelegations, "To:", innerPrefix, w)
334332
fmt.Fprintln(w)
335333
}
336334
}

0 commit comments

Comments
 (0)