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
Dao improvements #1746
Dao improvements #1746
Conversation
As PB handles enums globally there must not be same entries in 2 diff. enums. Therefore I postfixed with _OUTPUT 3 entries in TxOutputType.
- Remove unneeded isLastOutput - Rename bsqOutputs to tempTxOutputs - Rename commitTxOutputs to commitTxOutputsForValidTx
- Remove voteRevealInputState and replace with isVoteRevealInputInValid in TxInputParser - Rename optionalVerifiedOpReturnType to optionalOpReturnType - Replace if checks with checkNotNull if case must not happen - Remove unused isLastOutput param - Inline handleOpReturnOutput code to processOpReturnOutput - Remove class fields remainingInputValue and use a local var instead - Rename getOptionalVerifiedOpReturnType to getOptionalOpReturnType
- Continue to refactor to make methods more testable
- Add isUnLockInputValid to TxInputParser - Continue to refactor to make methods more testable - Clean up
- Move unlockBlockHeight field from Tx to TxOutput
- Remove tempTx from TxOutputParser - Renamings - Add isOpReturnOutput method to TempTxOuput
- Add check for opReturn in processTxOutput - Handle burntBondValue - Check for TxOutputType.INVALID_OUTPUT in isTxInvalid
- Use commitUTXOCandidates for processGenesisTxOutput - Cleanup
- Extract genesis parsing to GenesisTxParser - Cleanups
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.
utACK
Some good refactoring making it much clearer I think. As noticed you fixed all the issues found along the way.
@@ -52,7 +52,8 @@ | |||
|
|||
private final BsqStateService bsqStateService; | |||
@Getter | |||
private TxInputParser.VoteRevealInputState voteRevealInputState = TxInputParser.VoteRevealInputState.UNKNOWN; | |||
boolean isVoteRevealInputInValid = false; |
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.
This should be isVoteRevealInputValid
tempTxOutput.setTxOutputType(txOutputType); | ||
|
||
optionalOpReturnType = getMappedOpReturnType(txOutputType); | ||
// TODO: Do we really want to store the lockTime in another output as where we get it delivered? |
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.
Since the lockTime is referring to the lockTime of the first output I think it's correct. It just happens that the information has to be carried in the opreturn, and this is when it's parsed and assigned to the concerned txOutput.
* @param optionalOpReturnType If present, the OP_RETURN type of the transaction. | ||
* @param tempTx The temporary transaction. | ||
* @param optionalOpReturnType The optional OP_RETURN type of the transaction. | ||
* @param hasBurntBSQ If the have been remaining value from the inputs which got not spent in outputs. |
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.
This comment is quite hard to understand.
@@ -293,7 +291,7 @@ private void processVoteReveal(int blockHeight, TempTx tempTx) { | |||
} | |||
|
|||
// We must not use an `if else` here! | |||
if (!isPhaseValid || txInputParser.isVoteRevealInputInValid()) { | |||
if (!isPhaseValid || txInputParser.isVoteRevealInputValid()) { |
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.
I think this is now incorrect, it should be !txInputParser.isVoteRevealInputValid()
Thanks for the review! |
No description provided.