Skip to content

Commit

Permalink
Deprecate kvutils rejections generated only by participant state v1 […
Browse files Browse the repository at this point in the history
…KVL-1090] (#10791)

* Deprecated protobuf DamlTransactionRejection reasons which are generated by the v1 participant state API only.

CHANGELOG_BEGIN
kvutils - protobuf rejections generated by the participant state v1 API are deprecated (Inconsistent, Disputed, ResourcesExhausted, PartyNotKnownOnLedger)
CHANGELOG_END

* Reorganize proto fields in the order of the  field number
  • Loading branch information
nicu-da authored Sep 7, 2021
1 parent 116d6a5 commit 5b28aef
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,18 @@ message DamlTransactionRejectionEntry {
oneof reason {

// Rejections used by both participant.state v1 and v2 API.
InvalidLedgerTime invalid_ledger_time = 9;
Duplicate duplicate_command = 6;
SubmitterCannotActViaParticipant submitter_cannot_act_via_participant = 8;
InvalidLedgerTime invalid_ledger_time = 9;

//
// Rejections used by participant.state.v1 API.
// Note that these are deprecated.
//
Inconsistent inconsistent = 2;
Disputed disputed = 3;
ResourcesExhausted resources_exhausted = 4;
Duplicate duplicate_command = 6;
PartyNotKnownOnLedger party_not_known_on_ledger = 7;
Inconsistent inconsistent = 2 [deprecated = true];
Disputed disputed = 3 [deprecated = true];
ResourcesExhausted resources_exhausted = 4 [deprecated = true];
PartyNotKnownOnLedger party_not_known_on_ledger = 7 [deprecated = true];

//
// Rejections used by participant.state.v2 API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ private[state] object Conversions {
builder
}

@nowarn("msg=deprecated")
def decodeTransactionRejectionEntry(
entry: DamlTransactionRejectionEntry
): Option[FinalReason] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import com.daml.lf.value.ValueCoder
import com.daml.logging.{ContextualizedLogger, LoggingContext}
import com.daml.metrics.Metrics

import scala.annotation.nowarn

class ConflictDetection(val damlMetrics: Metrics) {
private val logger = ContextualizedLogger.get(getClass)
private val metrics = damlMetrics.daml.kvutils.conflictdetection
Expand Down Expand Up @@ -123,6 +125,7 @@ class ConflictDetection(val damlMetrics: Metrics) {
}
.getOrElse("Unspecified conflict")

@nowarn("msg=deprecated")
private def transactionRejectionEntryFrom(
logEntry: DamlLogEntry,
reason: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import org.scalatest.Inside
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec

import scala.annotation.nowarn

@nowarn("msg=deprecated")
class ConflictDetectionSpec extends AsyncWordSpec with Matchers with Inside with MockitoSugar {
"detectConflictsAndRecover" should {
"return output keys as invalidated and unchanged input in case of no conflicts" in {
Expand Down

0 comments on commit 5b28aef

Please sign in to comment.