Skip to content

Commit

Permalink
Adding 16th voting test
Browse files Browse the repository at this point in the history
- Authorized callers vote same current fee per KB value.
  • Loading branch information
wilmerrootstock authored and marcos-iov committed Jun 7, 2024
1 parent 97b459f commit 4804699
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,29 @@ void feePerKbIntegrationTest() {
voteFeePerKb(fifteenthFeePerKbVote, 1);
//It still has the previous voting round value
assertFeePerKbValue(fifteenthFeePerKbVote);

/*
* 16th voting: authorized callers vote same current fee per KB value
* Authorizers 1 votes for the same current fee per KB value.
* Authorizer 2 votes different value
* Authorizer 3 votes for the same current fee per KB value.
*/
Coin sixteenthFeePerKbVote = feePerKbSupport.getFeePerKb();;

// First vote for a new value
voteFeePerKb(sixteenthFeePerKbVote, 0);
//It still has the previous voting round value
assertFeePerKbValue(fifteenthFeePerKbVote);

// Second vote for a different value, different authorizer
voteFeePerKb(differentFeePerKbVote, 1);
//It still has the previous voting round value
assertFeePerKbValue(fifteenthFeePerKbVote);

// Third vote from authorizer 3, same value as the first one voted from authorizer 1
voteFeePerKb(sixteenthFeePerKbVote, 2);
// Get fee per kb, should return the value voted by authorizer 1 and 3
assertFeePerKbValue(sixteenthFeePerKbVote);
}

private void assertFeePerKbValue(Coin feePerKbExpectedResult) {
Expand Down

0 comments on commit 4804699

Please sign in to comment.