Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Riley <derek.riley@swirldslabs.com>
  • Loading branch information
derektriley committed Oct 23, 2024
1 parent ec5c3a8 commit a257ba3
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.hedera.node.app.spi.workflows.TransactionHandler;
import com.hedera.node.app.tss.stores.WritableTssBaseStore;
import com.hedera.pbj.runtime.io.buffer.Bytes;
import com.swirlds.platform.state.service.ReadableRosterStore;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -44,7 +43,7 @@
@Singleton
public class TssVoteHandler implements TransactionHandler {

public static final double THRESHOLD_ONE_THIRD = 3.0;
public static final double CONSENSUS_VOTE_THRESHOLD_ONE_THIRD = 3.0;

@Inject
public TssVoteHandler() {
Expand Down Expand Up @@ -73,7 +72,7 @@ public void handle(@NonNull final HandleContext context) throws HandleException
return;
}

if (!TssVoteHandler.hasReachedThreshold(txBody, context, THRESHOLD_ONE_THIRD)) {
if (!TssVoteHandler.hasReachedThreshold(txBody, context, CONSENSUS_VOTE_THRESHOLD_ONE_THIRD)) {
tssBaseStore.put(tssVoteMapKey, txBody);
}
}
Expand All @@ -84,7 +83,7 @@ public void handle(@NonNull final HandleContext context) throws HandleException
*
* @param tssVoteTransaction the TssVoteTransaction to check
* @param context the HandleContext
* @param thresholdDenominator the denominator of the threshold
* @param thresholdDenominator the denominator of the threshold fraction
* @return true if the threshold has been reached, false otherwise
*/
public static boolean hasReachedThreshold(
Expand Down Expand Up @@ -131,6 +130,6 @@ public static boolean hasReachedThreshold(
// Check if the total weight of votes with the same vote byte array is at least 1/thresholdDenominator of the
// total weight of the
// network
return voteWeight >= activeRosterTotalWeight / thresholdDenominator;
return voteWeight >= activeRosterTotalWeight / CONSENSUS_VOTE_THRESHOLD_ONE_THIRD;
}
}

0 comments on commit a257ba3

Please sign in to comment.