Skip to content

Commit

Permalink
Propagate protocol to remaining queries in cardano-cli
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Nadur <[email protected]>
  • Loading branch information
Jimbo4350 and intricate committed Jul 10, 2020
1 parent 0dc1c26 commit 1c15b9e
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 125 deletions.
1 change: 0 additions & 1 deletion cardano-api/src/Cardano/Api/LocalChainSync.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Cardano.Api.LocalChainSync
import Cardano.Prelude hiding (atomically, catch)

import Control.Concurrent.STM

import Cardano.Api.Typed

import Ouroboros.Network.Block (Tip)
Expand Down
10 changes: 5 additions & 5 deletions cardano-cli/src/Cardano/CLI/Shelley/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ data PoolCmd
data QueryCmd
= QueryPoolId NodeAddress
| QueryProtocolParameters Protocol NetworkId (Maybe OutputFile)
| QueryTip NetworkId (Maybe OutputFile)
| QueryStakeDistribution NetworkId (Maybe OutputFile)
| QueryStakeAddressInfo StakeAddress NetworkId (Maybe OutputFile)
| QueryUTxO QueryFilter NetworkId (Maybe OutputFile)
| QueryTip Protocol NetworkId (Maybe OutputFile)
| QueryStakeDistribution Protocol NetworkId (Maybe OutputFile)
| QueryStakeAddressInfo Protocol StakeAddress NetworkId (Maybe OutputFile)
| QueryUTxO Protocol QueryFilter NetworkId (Maybe OutputFile)
| QueryVersion NodeAddress
| QueryLedgerState NetworkId (Maybe OutputFile)
| QueryLedgerState Protocol NetworkId (Maybe OutputFile)
| QueryStatus NodeAddress
deriving (Eq, Show)

Expand Down
13 changes: 8 additions & 5 deletions cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -462,33 +462,36 @@ pQueryCmd =
<*> pMaybeOutputFile

pQueryTip :: Parser QueryCmd
pQueryTip = QueryTip <$> pNetworkId <*> pMaybeOutputFile
pQueryTip = QueryTip <$> pProtocol <*> pNetworkId <*> pMaybeOutputFile

pQueryUTxO :: Parser QueryCmd
pQueryUTxO =
QueryUTxO
<$> pQueryFilter
<$> pProtocol
<*> pQueryFilter
<*> pNetworkId
<*> pMaybeOutputFile

pQueryStakeDistribution :: Parser QueryCmd
pQueryStakeDistribution =
QueryStakeDistribution
<$> pNetworkId
<$> pProtocol
<*> pNetworkId
<*> pMaybeOutputFile

pQueryStakeAddressInfo :: Parser QueryCmd
pQueryStakeAddressInfo =
QueryStakeAddressInfo
<$> pFilterByStakeAddress
<$> pProtocol
<*> pFilterByStakeAddress
<*> pNetworkId
<*> pMaybeOutputFile

pQueryVersion :: Parser QueryCmd
pQueryVersion = QueryVersion <$> parseNodeAddress

pQueryLedgerState :: Parser QueryCmd
pQueryLedgerState = QueryLedgerState <$> pNetworkId <*> pMaybeOutputFile
pQueryLedgerState = QueryLedgerState <$> pProtocol <*> pNetworkId <*> pMaybeOutputFile

pQueryStatus :: Parser QueryCmd
pQueryStatus = QueryStatus <$> parseNodeAddress
Expand Down
Loading

0 comments on commit 1c15b9e

Please sign in to comment.