Skip to content

Commit

Permalink
Add source account comparison to ClawbackClaimableBalanceOperation,…
Browse files Browse the repository at this point in the history
… `LiquidityPoolWithdrawOperation`, and `LiquidityPoolDepositOperation` for equality check. (#484)
  • Loading branch information
overcat authored Jul 21, 2023
1 parent 0803b98 commit c258f0d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public boolean equals(Object object) {
}

ClawbackClaimableBalanceOperation other = (ClawbackClaimableBalanceOperation) object;
return Objects.equal(this.balanceId, other.balanceId);
return Objects.equal(this.balanceId, other.balanceId)
&& Objects.equal(this.getSourceAccount(), other.getSourceAccount());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ OperationBody toOperationBody(AccountConverter accountConverter) {
}

public int hashCode() {
return Objects.hashCode(liquidityPoolID, maxAmountA, maxAmountB, minPrice, maxPrice);
return Objects.hashCode(
this.getSourceAccount(), liquidityPoolID, maxAmountA, maxAmountB, minPrice, maxPrice);
}

@Override
Expand All @@ -111,6 +112,7 @@ public boolean equals(Object object) {
&& Objects.equal(this.getMaxAmountA(), o.getMaxAmountA())
&& Objects.equal(this.getMaxAmountB(), o.getMaxAmountB())
&& Objects.equal(this.getMinPrice(), o.getMinPrice())
&& Objects.equal(this.getMaxPrice(), o.getMaxPrice());
&& Objects.equal(this.getMaxPrice(), o.getMaxPrice())
&& Objects.equal(this.getSourceAccount(), o.getSourceAccount());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ OperationBody toOperationBody(AccountConverter accountConverter) {
}

public int hashCode() {
return Objects.hashCode(liquidityPoolID, amount, minAmountA, minAmountB);
return Objects.hashCode(
this.getSourceAccount(), liquidityPoolID, amount, minAmountA, minAmountB);
}

@Override
Expand All @@ -93,6 +94,7 @@ public boolean equals(Object object) {
return Objects.equal(this.getLiquidityPoolID(), o.getLiquidityPoolID())
&& Objects.equal(this.getAmount(), o.getAmount())
&& Objects.equal(this.getMinAmountA(), o.getMinAmountA())
&& Objects.equal(this.getMinAmountB(), o.getMinAmountB());
&& Objects.equal(this.getMinAmountB(), o.getMinAmountB())
&& Objects.equal(this.getSourceAccount(), o.getSourceAccount());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.google.common.base.Objects;
import org.stellar.sdk.xdr.*;

public class RevokeDataSponsorshipOperation extends org.stellar.sdk.Operation {
public class RevokeDataSponsorshipOperation extends Operation {
private final String accountId;
private final String dataName;

Expand Down

0 comments on commit c258f0d

Please sign in to comment.