Skip to content

Commit

Permalink
extension of PoolCurrentPaydayInfo/PoolInfoResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
drsk committed Jan 7, 2025
1 parent 758a3ed commit f37c60a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions haskell-src/Concordium/GRPC2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,7 @@ instance ToProto QueryTypes.BakerPoolStatus where
ProtoFields.maybe'equityPendingChange .= toProto abpsBakerStakePendingChange
ProtoFields.maybe'currentPaydayInfo .= fmap toProto psCurrentPaydayStatus
ProtoFields.allPoolTotalCapital .= toProto psAllPoolTotalCapital
ProtoFields.maybe'isSuspended .= psIsSuspended

instance ToProto QueryTypes.PassiveDelegationStatus where
type Output QueryTypes.PassiveDelegationStatus = Proto.PassiveDelegationInfo
Expand Down Expand Up @@ -1731,6 +1732,8 @@ instance ToProto QueryTypes.CurrentPaydayBakerPoolStatus where
ProtoFields.bakerEquityCapital .= toProto bpsBakerEquityCapital
ProtoFields.delegatedCapital .= toProto bpsDelegatedCapital
ProtoFields.commissionRates .= toProto bpsCommissionRates
ProtoFields.maybe'isPrimedForSuspension .= bpsIsPrimedForSuspension
ProtoFields.maybe'missedRounds .= bpsMissedRounds

instance ToProto QueryTypes.RewardStatus where
type Output QueryTypes.RewardStatus = Proto.TokenomicsInfo
Expand Down
13 changes: 11 additions & 2 deletions haskell-src/Concordium/Types/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,12 @@ data CurrentPaydayBakerPoolStatus = CurrentPaydayBakerPoolStatus
-- | The effective delegated capital to the pool for the current reward period.
bpsDelegatedCapital :: !Amount,
-- | The commission rates that apply for the current reward period.
bpsCommissionRates :: !CommissionRates
bpsCommissionRates :: !CommissionRates,
-- | A flag indicating whether the baker is primed for suspension the
-- coming snapshot epoch. Present from protocol version P8.
bpsIsPrimedForSuspension :: !(Maybe Bool),
-- | The missed rounds of the baker. Present from protocol version P8.
bpsMissedRounds :: !(Maybe Word64)
}
deriving (Eq, Show)

Expand All @@ -525,7 +530,10 @@ data BakerPoolStatus = BakerPoolStatus
-- for the current reward period.
psCurrentPaydayStatus :: !(Maybe CurrentPaydayBakerPoolStatus),
-- | Total capital staked across all pools, including passive delegation.
psAllPoolTotalCapital :: !Amount
psAllPoolTotalCapital :: !Amount,
-- | A flag indicating Whether the pool owner is suspended or not. Present
-- from protocol version P8.
psIsSuspended :: !(Maybe Bool)
}
deriving (Eq, Show)

Expand Down Expand Up @@ -568,6 +576,7 @@ instance FromJSON BakerPoolStatus where
abpsBakerStakePendingChange <- obj .: "bakerStakePendingChange"
return ActiveBakerPoolStatus{..}
psActiveStatus <- optional activeStatusFields
psIsSuspended <- obj .: "isSuspended"
return BakerPoolStatus{..}

-- | Status of the passive delegators.
Expand Down

0 comments on commit f37c60a

Please sign in to comment.