diff --git a/concordium-grpc-api b/concordium-grpc-api index 044d74361..54e99db08 160000 --- a/concordium-grpc-api +++ b/concordium-grpc-api @@ -1 +1 @@ -Subproject commit 044d743617e8128203a329e81c77ba129192fd72 +Subproject commit 54e99db082c441960829752c3b9855a86a66b053 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..3ae02e7bd 100644 --- a/haskell-src/Concordium/Types/Queries.hs +++ b/haskell-src/Concordium/Types/Queries.hs @@ -500,13 +500,19 @@ 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) $( deriveJSON defaultOptions - { fieldLabelModifier = firstLower . dropWhile isLower + { fieldLabelModifier = firstLower . dropWhile isLower, + omitNothingFields = True } ''CurrentPaydayBakerPoolStatus ) @@ -525,7 +531,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) @@ -538,6 +547,7 @@ instance ToJSON BakerPoolStatus where "currentPaydayStatus" .= psCurrentPaydayStatus, "allPoolTotalCapital" .= psAllPoolTotalCapital ] + ++ ["isSuspended" .= isSuspended | Just isSuspended <- [psIsSuspended]] ++ activeStatusFields where activeStatusFields = case psActiveStatus of @@ -568,6 +578,7 @@ instance FromJSON BakerPoolStatus where abpsBakerStakePendingChange <- obj .: "bakerStakePendingChange" return ActiveBakerPoolStatus{..} psActiveStatus <- optional activeStatusFields + psIsSuspended <- optional $ obj .: "isSuspended" return BakerPoolStatus{..} -- | Status of the passive delegators.