Skip to content

Commit

Permalink
Merge pull request #277 from Concordium/extendPoolInfo
Browse files Browse the repository at this point in the history
Extend pool info
  • Loading branch information
magnusbechwind authored Nov 1, 2023
2 parents ca1b9f8 + 415d729 commit 0c8975e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -120,6 +125,11 @@ public void getPoolInfo(PoolInfoRequest request, StreamObserver<PoolInfoResponse
.delegatedCapital(CCDAmount.fromMicro(DELEGATED_CAPITAL))
.blocksBaked(UInt64.from(BLOCKS_BAKED))
.bakerEquityCapital(CCDAmount.fromMicro(EQUITY_CAPITAL))
.commissionRates(com.concordium.sdk.responses.accountinfo.CommissionRates.builder()
.bakingCommission(PartsPerHundredThousand.from(COMMISSION_BAKING_PPHT).asDouble())
.finalizationCommission(PartsPerHundredThousand.from(COMMISSION_FINALIZATION_PPHT).asDouble())
.transactionCommission(PartsPerHundredThousand.from(COMMISSION_TRANSACTION_PPHT).asDouble())
.build())
.build())
.delegatedCapital(CCDAmount.fromMicro(DELEGATED_CAPITAL))
.poolInfo(com.concordium.sdk.responses.accountinfo.BakerPoolInfo.builder()
Expand Down

0 comments on commit 0c8975e

Please sign in to comment.