Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
Simplify ParsingModel constructor to take TempTx
Browse files Browse the repository at this point in the history
  • Loading branch information
chirhonul committed Aug 11, 2018
1 parent 4b459e5 commit 0ef70cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/main/java/bisq/core/dao/node/parser/ParsingModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ enum BlindVoteOutputState {
@Nullable
private OpReturnType verifiedOpReturnType;

ParsingModel() {
}

ParsingModel(long availableInputValue) {
this.availableInputValue = availableInputValue;
ParsingModel(TempTx tx) {
this.tx = tx;
}

public void addToInputValue(long value) {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/bisq/core/dao/node/parser/TxParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ public Optional<Tx> findTx(RawTx rawTx, String genesisTxId, int genesisBlockHeig

// If it is not a genesis tx we continue to parse to see if it is a valid BSQ tx.
int blockHeight = rawTx.getBlockHeight();
ParsingModel parsingModel = new ParsingModel();
TempTx tempTx = TempTx.fromRawTx(rawTx);
// We could pass tx also to the sub validators but as long we have not refactored the validators to pure
// functions lets use the parsingModel.
parsingModel.setTx(tempTx);
TempTx tempTx = TempTx.fromRawTx(rawTx);
ParsingModel parsingModel = new ParsingModel(tempTx);

for (int inputIndex = 0; inputIndex < tempTx.getTxInputs().size(); inputIndex++) {
TxInput input = tempTx.getTxInputs().get(inputIndex);
Expand Down

0 comments on commit 0ef70cd

Please sign in to comment.