Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve memory usage of query pool params #4162

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 29 additions & 30 deletions cardano-api/src/Cardano/Api/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ import qualified Data.HashMap.Strict as HMS
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (mapMaybe)
import Data.SOP.Strict (SListI)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Sharing (FromSharedCBOR, Interns, Share)
import Data.SOP.Strict (SListI)
import Data.Text (Text)
import Data.Typeable
import Prelude
Expand Down Expand Up @@ -189,51 +189,50 @@ deriving instance Show (QueryInEra era result)


data QueryInShelleyBasedEra era result where
QueryEpoch
:: QueryInShelleyBasedEra era EpochNo
QueryEpoch
:: QueryInShelleyBasedEra era EpochNo

QueryGenesisParameters
:: QueryInShelleyBasedEra era GenesisParameters
QueryGenesisParameters
:: QueryInShelleyBasedEra era GenesisParameters

QueryProtocolParameters
:: QueryInShelleyBasedEra era ProtocolParameters
QueryProtocolParameters
:: QueryInShelleyBasedEra era ProtocolParameters

QueryProtocolParametersUpdate
:: QueryInShelleyBasedEra era
QueryProtocolParametersUpdate
:: QueryInShelleyBasedEra era
(Map (Hash GenesisKey) ProtocolParametersUpdate)

QueryStakeDistribution
:: QueryInShelleyBasedEra era (Map (Hash StakePoolKey) Rational)
QueryStakeDistribution
:: QueryInShelleyBasedEra era (Map (Hash StakePoolKey) Rational)

QueryUTxO
:: QueryUTxOFilter
-> QueryInShelleyBasedEra era (UTxO era)
QueryUTxO
:: QueryUTxOFilter
-> QueryInShelleyBasedEra era (UTxO era)

QueryStakeAddresses
:: Set StakeCredential
-> NetworkId
-> QueryInShelleyBasedEra era (Map StakeAddress Lovelace,
Map StakeAddress PoolId)
QueryStakeAddresses
:: Set StakeCredential
-> NetworkId
-> QueryInShelleyBasedEra era (Map StakeAddress Lovelace, Map StakeAddress PoolId)

QueryStakePools
:: QueryInShelleyBasedEra era (Set PoolId)
QueryStakePools
:: QueryInShelleyBasedEra era (Set PoolId)

QueryStakePoolParameters
:: Set PoolId
-> QueryInShelleyBasedEra era (Map PoolId StakePoolParameters)
QueryStakePoolParameters
:: Set PoolId
-> QueryInShelleyBasedEra era (Map PoolId StakePoolParameters)

-- TODO: add support for RewardProvenance
-- QueryPoolRanking
-- :: QueryInShelleyBasedEra era RewardProvenance

QueryDebugLedgerState
:: QueryInShelleyBasedEra era (SerialisedDebugLedgerState era)
QueryDebugLedgerState
:: QueryInShelleyBasedEra era (SerialisedDebugLedgerState era)

QueryProtocolState
:: QueryInShelleyBasedEra era (ProtocolState era)
QueryProtocolState
:: QueryInShelleyBasedEra era (ProtocolState era)

QueryCurrentEpochState
:: QueryInShelleyBasedEra era (SerialisedCurrentEpochState era)
QueryCurrentEpochState
:: QueryInShelleyBasedEra era (SerialisedCurrentEpochState era)

deriving instance Show (QueryInShelleyBasedEra era result)

Expand Down
Loading