Add isCustomAddress to CompensationModel

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2023-05-17 12:54:56 +07:00
parent 6a649416c2
commit 694e101646
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307
2 changed files with 8 additions and 0 deletions

View File

@ -153,6 +153,7 @@ public class BurningManService {
long decayedIssuanceAmount = getDecayedCompensationAmount(issuanceAmount, issuanceHeight, chainHeight); long decayedIssuanceAmount = getDecayedCompensationAmount(issuanceAmount, issuanceHeight, chainHeight);
long issuanceDate = daoStateService.getBlockTime(issuanceHeight); long issuanceDate = daoStateService.getBlockTime(issuanceHeight);
candidate.addCompensationModel(CompensationModel.fromCompensationRequest(receiverAddress.get(), candidate.addCompensationModel(CompensationModel.fromCompensationRequest(receiverAddress.get(),
isCustomAddress,
issuanceAmount, issuanceAmount,
decayedIssuanceAmount, decayedIssuanceAmount,
issuanceHeight, issuanceHeight,

View File

@ -27,6 +27,7 @@ import lombok.Getter;
@EqualsAndHashCode @EqualsAndHashCode
public final class CompensationModel { public final class CompensationModel {
public static CompensationModel fromCompensationRequest(String address, public static CompensationModel fromCompensationRequest(String address,
boolean isCustomAddress,
long amount, long amount,
long decayedAmount, long decayedAmount,
int height, int height,
@ -34,6 +35,7 @@ public final class CompensationModel {
long date, long date,
int cycleIndex) { int cycleIndex) {
return new CompensationModel(address, return new CompensationModel(address,
isCustomAddress,
amount, amount,
decayedAmount, decayedAmount,
height, height,
@ -51,6 +53,7 @@ public final class CompensationModel {
int outputIndex, int outputIndex,
long date) { long date) {
return new CompensationModel(address, return new CompensationModel(address,
false,
amount, amount,
decayedAmount, decayedAmount,
height, height,
@ -62,6 +65,7 @@ public final class CompensationModel {
private final String address; private final String address;
private final boolean isCustomAddress;
private final long amount; private final long amount;
private final long decayedAmount; private final long decayedAmount;
private final int height; private final int height;
@ -71,6 +75,7 @@ public final class CompensationModel {
private final int cycleIndex; private final int cycleIndex;
private CompensationModel(String address, private CompensationModel(String address,
boolean isCustomAddress,
long amount, long amount,
long decayedAmount, long decayedAmount,
int height, int height,
@ -79,6 +84,7 @@ public final class CompensationModel {
long date, long date,
int cycleIndex) { int cycleIndex) {
this.address = address; this.address = address;
this.isCustomAddress = isCustomAddress;
this.amount = amount; this.amount = amount;
this.decayedAmount = decayedAmount; this.decayedAmount = decayedAmount;
this.height = height; this.height = height;
@ -92,6 +98,7 @@ public final class CompensationModel {
public String toString() { public String toString() {
return "\n CompensationModel{" + return "\n CompensationModel{" +
"\r\n address='" + address + '\'' + "\r\n address='" + address + '\'' +
"\r\n isCustomAddress='" + isCustomAddress + '\'' +
",\r\n amount=" + amount + ",\r\n amount=" + amount +
",\r\n decayedAmount=" + decayedAmount + ",\r\n decayedAmount=" + decayedAmount +
",\r\n height=" + height + ",\r\n height=" + height +