Skip to content

Commit

Permalink
query proposals: share code using QueryCommons
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Dec 11, 2024
1 parent 11721af commit 54f4a6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
5 changes: 1 addition & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,8 @@ data QueryDRepStateCmdArgs era = QueryDRepStateCmdArgs

data QueryProposalsCmdArgs era = QueryProposalsCmdArgs
{ eon :: !(ConwayEraOnwards era)
, nodeSocketPath :: !SocketPath
, consensusModeParams :: !ConsensusModeParams
, networkId :: !NetworkId
, commons :: !QueryCommons
, govActionIds :: !(AllOrOnly (L.GovActionId L.StandardCrypto))
, target :: !(Consensus.Target ChainPoint)
, mOutFile :: !(Maybe (File () Out))
}
deriving Show
Expand Down
5 changes: 1 addition & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,8 @@ pQueryProposalsCmd era envCli = do
pQueryProposalsCmdArgs :: ConwayEraOnwards era -> Parser (QueryProposalsCmdArgs era)
pQueryProposalsCmdArgs w =
QueryProposalsCmdArgs w
<$> pSocketPath envCli
<*> pConsensusModeParams
<*> pNetworkId envCli
<$> pQueryCommons (convert w) envCli
<*> pAllOrOnlyGovActionIds w
<*> pTarget era
<*> optional pOutputFile

pQuerySPOStakeDistributionCmd
Expand Down
11 changes: 7 additions & 4 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1810,11 +1810,14 @@ runQueryProposals
runQueryProposals
Cmd.QueryProposalsCmdArgs
{ Cmd.eon
, Cmd.nodeSocketPath
, Cmd.consensusModeParams
, Cmd.networkId
, Cmd.commons =
Cmd.QueryCommons
{ Cmd.nodeSocketPath
, Cmd.consensusModeParams
, Cmd.networkId
, Cmd.target
}
, Cmd.govActionIds = govActionIds'
, Cmd.target
, Cmd.mOutFile
} = conwayEraOnwardsConstraints eon $ do
let localNodeConnInfo = LocalNodeConnectInfo consensusModeParams networkId nodeSocketPath
Expand Down

0 comments on commit 54f4a6d

Please sign in to comment.