-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORE-11865: Add strategy to TokenClaimCriteria (#1562)
* Adds a new Strategy enum with RANDOM and PRIORTY values * Adds strategy property to TokenClaimCriteria
- Loading branch information
1 parent
7fcb0eb
commit a29570d
Showing
3 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/token/selection/Strategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package net.corda.v5.ledger.utxo.token.selection; | ||
|
||
/** | ||
* Token selection strategy. RANDOM is the default. | ||
*/ | ||
public enum Strategy { | ||
/** | ||
* Choose tokens in transaction ID order. As this field is not a sequential value, it has the effect of a pseudo | ||
* random order. | ||
* <p> | ||
* This is the default selection strategy. | ||
*/ | ||
RANDOM, | ||
|
||
/** | ||
* Choose tokens in priority, then transaction ID order. | ||
* <p> | ||
* Lower priority values are treated as higher priority. Equal priority values fall back to transaction ID ordering, | ||
* behaving the same as RANDOM strategy. Null priority values are sorted to the end, making them the lowest possible | ||
* priority. | ||
*/ | ||
PRIORITY | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters