Skip to content
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

kvutils: Refined transaction validation [KVL-1015] #10066

Merged
merged 20 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import com.daml.ledger.participant.state.kvutils.DamlKvutils._
import com.daml.ledger.participant.state.kvutils.committer.Committer._
import com.daml.ledger.participant.state.kvutils.committer._
import com.daml.ledger.participant.state.kvutils.committer.transaction.validation.{
ContractKeysValidator,
LedgerTimeValidator,
ModelConformanceValidator,
TransactionConsistencyValidator,
}
import com.daml.ledger.participant.state.kvutils.{Conversions, Err}
import com.daml.ledger.participant.state.v1.RejectionReasonV0
Expand Down Expand Up @@ -75,10 +75,8 @@ private[kvutils] class TransactionCommitter(
"check_informee_parties_allocation" -> checkInformeePartiesAllocation,
"deduplicate" -> deduplicateCommand,
"validate_ledger_time" -> ledgerTimeValidator.createValidationStep(rejections),
"validate_contract_keys" -> ContractKeysValidator.createValidationStep(rejections),
"validate_model_conformance" -> modelConformanceValidator.createValidationStep(
rejections
),
"validate_model_conformance" -> modelConformanceValidator.createValidationStep(rejections),
"validate_consistency" -> TransactionConsistencyValidator.createValidationStep(rejections),
"blind" -> blind,
"trim_unnecessary_nodes" -> trimUnnecessaryNodes,
"build_final_log_entry" -> buildFinalLogEntry,
Expand Down Expand Up @@ -218,9 +216,8 @@ private[kvutils] class TransactionCommitter(
case Nil => result
case head :: tail =>
import TransactionOuterClass.Node.NodeTypeCase
val node = nodeMap
.get(head)
.getOrElse(throw Err.InternalError(s"Invalid transaction node id $head"))
val node =
nodeMap.getOrElse(head, throw Err.InternalError(s"Invalid transaction node id $head"))
node.getNodeTypeCase match {
case NodeTypeCase.CREATE =>
goNodesToKeep(tail, result + head)
Expand Down

This file was deleted.

Loading