mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-23 04:36:50 +00:00
Changed error response from RewardShareTransaction.isValid() for existing self-shares.
Before: 0-fee self-share REWARD_SHARE when there is an existing self-share would result in INSUFFICIENT_FEE from isFeeValid() After: isFeeValid() returns OK for above, but isValid() returns SELF_SHARE_EXISTS. In addition, a transaction that tries to modify existing self-share, even with fee, also returns SELF_SHARE_EXISTS. Improved tests to double check.
This commit is contained in:
@@ -168,9 +168,14 @@ public class RewardShareTests extends Common {
|
||||
newTransactionData = AccountUtils.createRewardShare(repository, testAccountName, testAccountName, CANCEL_SHARE_PERCENT);
|
||||
newTransaction = Transaction.fromData(repository, newTransactionData);
|
||||
|
||||
// Confirm terminating reward-share is valid
|
||||
// Confirm terminating reward-share with fee is valid
|
||||
validationResult = newTransaction.isValidUnconfirmed();
|
||||
assertEquals("Subsequent zero-fee self-share should be invalid", ValidationResult.OK, validationResult);
|
||||
assertEquals("Subsequent self-share cancel should be valid", ValidationResult.OK, validationResult);
|
||||
|
||||
// Confirm terminating reward-share with zero fee is invalid
|
||||
newTransactionData.setFee(BigDecimal.ZERO);
|
||||
validationResult = newTransaction.isValidUnconfirmed();
|
||||
assertNotSame("Subsequent zero-fee self-share cancel should be invalid", ValidationResult.OK, validationResult);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user