File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
cardano-cli/src/Cardano/CLI/EraBased/Query Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1799,6 +1799,7 @@ runQuerySPOStakeDistribution
1799
1799
, Cmd. target
1800
1800
}
1801
1801
, Cmd. spoHashSources = spoHashSources'
1802
+ , Cmd. outputFormat
1802
1803
, Cmd. mOutFile
1803
1804
} = conwayEraOnwardsConstraints eon $ do
1804
1805
let spoFromSource = firstExceptT QueryCmdSPOKeyError . readSPOCredential
@@ -1845,15 +1846,26 @@ runQuerySPOStakeDistribution
1845
1846
)
1846
1847
(Map. keys addressesAndRewards)
1847
1848
1848
- let toWrite =
1849
+ let json =
1849
1850
[ ( spo
1850
1851
, coin
1851
1852
, Map. lookup spo spoToDelegatee
1852
1853
)
1853
1854
| (spo, coin) <- Map. assocs spoStakeDistribution
1854
1855
]
1855
1856
1856
- writeOutput mOutFile toWrite
1857
+ output =
1858
+ outputFormat
1859
+ & ( id
1860
+ . Vary. on (\ FormatJson -> Json. encodeJson)
1861
+ . Vary. on (\ FormatYaml -> Json. encodeYaml)
1862
+ $ Vary. exhaustiveCase
1863
+ )
1864
+ $ json
1865
+
1866
+ firstExceptT QueryCmdWriteFileError
1867
+ . newExceptT
1868
+ $ writeLazyByteStringOutput mOutFile output
1857
1869
1858
1870
runQueryCommitteeMembersState
1859
1871
:: Cmd. QueryCommitteeMembersStateCmdArgs era
You can’t perform that action at this time.
0 commit comments