Skip to content

Commit

Permalink
Add missing retiring federation response code. Use it and existing pe…
Browse files Browse the repository at this point in the history
…nding federation response code not being used in FederationSupportImpl
  • Loading branch information
julia-zack committed Jun 14, 2024
1 parent c550869 commit 5fe05d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public enum FederationChangeResponseCode {
EXISTING_FEDERATION_AWAITING_ACTIVATION(-2),
EXISTING_RETIRING_FEDERATION(-3),
PENDING_FEDERATION_NON_EXISTENT(-1),
RETIRING_FEDERATION_NON_EXISTENT(-1),
FEDERATOR_ALREADY_PRESENT(-2),
INSUFFICIENT_MEMBERS(-2),
PENDING_FEDERATION_MISMATCHED_HASH(-3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public Address getRetiringFederationAddress() {
public int getRetiringFederationSize() {
Federation retiringFederation = getRetiringFederation();
if (retiringFederation == null) {
return -1;
return FederationChangeResponseCode.RETIRING_FEDERATION_NON_EXISTENT.getCode();
}

return retiringFederation.getSize();
Expand All @@ -250,7 +250,7 @@ public int getRetiringFederationSize() {
public int getRetiringFederationThreshold() {
Federation retiringFederation = getRetiringFederation();
if (retiringFederation == null) {
return -1;
return FederationChangeResponseCode.RETIRING_FEDERATION_NON_EXISTENT.getCode();
}

return retiringFederation.getNumberOfSignaturesRequired();
Expand Down Expand Up @@ -339,7 +339,7 @@ public int getPendingFederationSize() {
PendingFederation currentPendingFederation = getPendingFederation();

if (currentPendingFederation == null) {
return -1;
return FederationChangeResponseCode.PENDING_FEDERATION_NON_EXISTENT.getCode();
}

return currentPendingFederation.getSize();
Expand Down

0 comments on commit 5fe05d3

Please sign in to comment.