diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb3bccd0..e5ec929f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased changes - Added support for GRPC V2 `GetBlockCertificates` for retrieving certificates for a block supporting ConcordiumBF, i.e. a node with at least version 6.1. +- Extended `CurrentPaydayStatus` with `CommissionRates` that apply for the current reward period. Requires at least node version 6.1. ## 5.1.0 - Fixed a regression that made it harder to deserialize transactions from bytes. diff --git a/concordium-sdk/src/main/java/com/concordium/sdk/ClientV2MapperExtensions.java b/concordium-sdk/src/main/java/com/concordium/sdk/ClientV2MapperExtensions.java index add487a94..9fb4faaec 100644 --- a/concordium-sdk/src/main/java/com/concordium/sdk/ClientV2MapperExtensions.java +++ b/concordium-sdk/src/main/java/com/concordium/sdk/ClientV2MapperExtensions.java @@ -1240,6 +1240,7 @@ static com.concordium.sdk.responses.poolstatus.PendingChange to(PoolPendingChang .finalizationLive(currentPaydayInfo.getFinalizationLive()) .lotteryPower(currentPaydayInfo.getLotteryPower()) .transactionFeesEarned(to(currentPaydayInfo.getTransactionFeesEarned())) + .commissionRates(CommissionRates.from(currentPaydayInfo.getCommissionRates())) .build(); } diff --git a/concordium-sdk/src/main/java/com/concordium/sdk/responses/poolstatus/CurrentPaydayStatus.java b/concordium-sdk/src/main/java/com/concordium/sdk/responses/poolstatus/CurrentPaydayStatus.java index cb93850da..8996dd207 100644 --- a/concordium-sdk/src/main/java/com/concordium/sdk/responses/poolstatus/CurrentPaydayStatus.java +++ b/concordium-sdk/src/main/java/com/concordium/sdk/responses/poolstatus/CurrentPaydayStatus.java @@ -1,5 +1,6 @@ package com.concordium.sdk.responses.poolstatus; +import com.concordium.sdk.responses.accountinfo.CommissionRates; import com.concordium.sdk.transactions.CCDAmount; import com.concordium.sdk.types.UInt64; import lombok.Builder; @@ -45,4 +46,9 @@ public class CurrentPaydayStatus { * The effective delegated capital to the pool for the current reward period. */ private final CCDAmount delegatedCapital; + + /** + * The commission rates that apply for the current reward period. + */ + private final CommissionRates commissionRates; } diff --git a/concordium-sdk/src/test/java/com/concordium/sdk/ClientV2GetPoolInfoTest.java b/concordium-sdk/src/test/java/com/concordium/sdk/ClientV2GetPoolInfoTest.java index b3c7c5c9e..52d1560fa 100644 --- a/concordium-sdk/src/test/java/com/concordium/sdk/ClientV2GetPoolInfoTest.java +++ b/concordium-sdk/src/test/java/com/concordium/sdk/ClientV2GetPoolInfoTest.java @@ -85,6 +85,11 @@ public class ClientV2GetPoolInfoTest { .setLotteryPower(LOTTERY_POWER) .setFinalizationLive(FINALIZATION_LIVE) .setTransactionFeesEarned(to(TRANSACTION_FEES)) + .setCommissionRates(CommissionRates.newBuilder() + .setBaking(toAmountFrac(COMMISSION_BAKING_PPHT)) + .setFinalization(toAmountFrac(COMMISSION_FINALIZATION_PPHT)) + .setTransaction(toAmountFrac(COMMISSION_TRANSACTION_PPHT)) + .build()) .build()) .setDelegatedCapital(to(DELEGATED_CAPITAL)) .setDelegatedCapitalCap(to(DELEGATED_CAPITAL_CAP)) @@ -120,6 +125,11 @@ public void getPoolInfo(PoolInfoRequest request, StreamObserver