From ffb592fc855ca7fedce770409108b46413657c14 Mon Sep 17 00:00:00 2001 From: drsk Date: Wed, 18 Dec 2024 14:54:14 +0100 Subject: [PATCH] extension of PoolCurrentPaydayInfo/PoolInfoResponse --- haskell-src/Concordium/GRPC2.hs | 3 +++ haskell-src/Concordium/Types/Queries.hs | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/haskell-src/Concordium/GRPC2.hs b/haskell-src/Concordium/GRPC2.hs index 9628c0916..83f905866 100644 --- a/haskell-src/Concordium/GRPC2.hs +++ b/haskell-src/Concordium/GRPC2.hs @@ -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 @@ -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 diff --git a/haskell-src/Concordium/Types/Queries.hs b/haskell-src/Concordium/Types/Queries.hs index 0cd4a65a5..63eac127e 100644 --- a/haskell-src/Concordium/Types/Queries.hs +++ b/haskell-src/Concordium/Types/Queries.hs @@ -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) @@ -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) @@ -568,6 +576,7 @@ instance FromJSON BakerPoolStatus where abpsBakerStakePendingChange <- obj .: "bakerStakePendingChange" return ActiveBakerPoolStatus{..} psActiveStatus <- optional activeStatusFields + psIsSuspended <- optional $ obj .: "isSuspended" return BakerPoolStatus{..} -- | Status of the passive delegators.