-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JAV-319 Support for Protocol 7 (#341)
* Update concordium-base to 7.0 * Add ProtocolVersion.V7 enum entry * Add cooldowns to AccountInfo * Add availableBalance to AccountInfo * Make some BakerPoolStatus fields optional * Update the changelog * Update version to 8.0.0-SNAPSHOT Breaking changes in BakerPoolStatus * Add BakerDelegationRemoved tx result event Also remove bakerId from AbstractBakerResult. * Add DelegationBakerRemoved tx result event Also remove delegatorId from AbstractDelegatorResult.
- Loading branch information
Showing
36 changed files
with
259 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule concordium-base
updated
13 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
concordium-sdk/src/main/java/com/concordium/sdk/responses/AccountIndex.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
concordium-sdk/src/main/java/com/concordium/sdk/responses/accountinfo/Cooldown.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.concordium.sdk.responses.accountinfo; | ||
|
||
import com.concordium.sdk.transactions.CCDAmount; | ||
import com.concordium.sdk.types.Timestamp; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.extern.jackson.Jacksonized; | ||
|
||
/** | ||
* Records the amount, (expected) release time and whether it's a regular cooldown, | ||
* pre-cooldown or pre-pre-cooldown. | ||
*/ | ||
@Data | ||
@Jacksonized | ||
@Builder | ||
public final class Cooldown { | ||
/** | ||
* The time in milliseconds since the Unix epoch when the cooldown period ends. | ||
*/ | ||
private final Timestamp endTime; | ||
/** | ||
* The amount that is in cooldown and set to be released at the end of the | ||
* cooldown period. | ||
*/ | ||
private final CCDAmount amount; | ||
/** | ||
* The status of the cooldown. | ||
*/ | ||
private final CooldownStatus status; | ||
|
||
public enum CooldownStatus { | ||
COOLDOWN, | ||
PRE_COOLDOWN, | ||
PRE_PRE_COOLDOWN, | ||
; | ||
|
||
public static CooldownStatus from(com.concordium.grpc.v2.Cooldown.CooldownStatus cooldownStatus) { | ||
switch (cooldownStatus) { | ||
case COOLDOWN: | ||
return COOLDOWN; | ||
case PRE_COOLDOWN: | ||
return PRE_COOLDOWN; | ||
case PRE_PRE_COOLDOWN: | ||
return PRE_PRE_COOLDOWN; | ||
default: | ||
throw new IllegalArgumentException("Unrecognized cooldown status."); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../src/main/java/com/concordium/sdk/responses/transactionstatus/BakerDelegationRemoved.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.concordium.sdk.responses.transactionstatus; | ||
|
||
import com.concordium.grpc.v2.BakerEvent; | ||
import com.concordium.sdk.responses.AccountIndex; | ||
import com.concordium.sdk.types.AccountAddress; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
/** | ||
* Removed an existing delegator. | ||
*/ | ||
@Getter | ||
@ToString | ||
@SuperBuilder | ||
@EqualsAndHashCode(callSuper = true) | ||
public class BakerDelegationRemoved extends AbstractBakerResult { | ||
|
||
private final AccountIndex delegatorId; | ||
|
||
public static BakerDelegationRemoved from(BakerEvent.DelegationRemoved bakerDelegationRemoved, AccountAddress sender) { | ||
return BakerDelegationRemoved | ||
.builder() | ||
.delegatorId(AccountIndex.from(bakerDelegationRemoved.getDelegatorId())) | ||
.account(sender) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public TransactionResultEventType getType() { | ||
return TransactionResultEventType.BAKER_DELEGATION_REMOVED; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.