-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce TransactionEvaluationContext to pass data between selectors and plugin #6381
Introduce TransactionEvaluationContext to pass data between selectors and plugin #6381
Conversation
…and plugin (hyperledger#30) * Introduce TransactionSelectionContext to pass data between selectors Signed-off-by: Fabio Di Fabio <[email protected]> * Use TransactionSelectionContext in all the methods of the plugin selector Signed-off-by: Fabio Di Fabio <[email protected]> --------- Signed-off-by: Fabio Di Fabio <[email protected]>
|
Signed-off-by: Fabio Di Fabio <[email protected]>
* @param transactionSelectionResult The transaction selection result | ||
*/ | ||
default void onTransactionNotSelected( | ||
final PendingTransaction pendingTransaction, | ||
final TransactionEvaluationContext<? extends PendingTransaction> evaluationContext, |
Check notice
Code scanning / CodeQL
Useless parameter Note
* @param processingResult The result of processing the selected transaction. | ||
*/ | ||
default void onTransactionSelected( | ||
final PendingTransaction pendingTransaction, | ||
final TransactionEvaluationContext<? extends PendingTransaction> evaluationContext, |
Check notice
Code scanning / CodeQL
Useless parameter Note
* @param processingResult the transaction processing result | ||
* @return TransactionSelectionResult that indicates whether to include the transaction | ||
*/ | ||
TransactionSelectionResult evaluateTransactionPostProcessing( | ||
PendingTransaction pendingTransaction, TransactionProcessingResult processingResult); | ||
TransactionEvaluationContext<? extends PendingTransaction> evaluationContext, |
Check notice
Code scanning / CodeQL
Useless parameter Note
* @param processingResult the transaction processing result | ||
* @return TransactionSelectionResult that indicates whether to include the transaction | ||
*/ | ||
TransactionSelectionResult evaluateTransactionPostProcessing( | ||
PendingTransaction pendingTransaction, TransactionProcessingResult processingResult); | ||
TransactionEvaluationContext<? extends PendingTransaction> evaluationContext, | ||
TransactionProcessingResult processingResult); |
Check notice
Code scanning / CodeQL
Useless parameter Note
* @return TransactionSelectionResult that indicates whether to include the transaction | ||
*/ | ||
TransactionSelectionResult evaluateTransactionPreProcessing( | ||
PendingTransaction pendingTransaction); | ||
TransactionEvaluationContext<? extends PendingTransaction> evaluationContext); |
Check notice
Code scanning / CodeQL
Useless parameter Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Fabio Di Fabio <[email protected]>
PR description
Some tx selector plugins needs more context about the current tx being evaluated, for example the current minGasPrice, or the effective price of the tx and possibly more data in the future, for this we introduce the TransactionEvaluationContext to hold that data and pass it across all the selectors and the plugin. Another advantage of this context is to avoid to compute multiple time the same data, in case it is needed in more that one selector.
Fixed Issue(s)