mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
Extract rejection_reason.proto from daml_kvutils.proto [KVL-1090] (#11235)
CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
a1d94e10ba
commit
be899b32a8
@ -1,14 +1,5 @@
|
||||
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
//
|
||||
// Protocol buffer messages used by the participant state key-value utilities
|
||||
// for implementing a Daml ledger backed by a key-value store.
|
||||
//
|
||||
// These messages should only be produced and consumed by the methods in
|
||||
// `KeyValueCommitting`, `KeyValueConsumption` and `KeyValueSubmission` objects.
|
||||
//
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package com.daml.ledger.participant.state.kvutils.envelope;
|
||||
|
@ -9,7 +9,7 @@ option java_multiple_files = true;
|
||||
option csharp_namespace = "Com.Daml.Ledger.Participant.State.KVUtils.Store.Events";
|
||||
|
||||
import "com/daml/ledger/configuration/ledger_configuration.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/daml_kvutils.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/events/rejection_reason.proto";
|
||||
|
||||
// This message is in it's own file because it would introduce a circular dependency if kept in `configuration.proto`
|
||||
|
||||
|
@ -1,14 +1,5 @@
|
||||
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
//
|
||||
// Protocol buffer messages used by the participant state key-value utilities
|
||||
// for implementing a Daml ledger backed by a key-value store.
|
||||
//
|
||||
// These messages should only be produced and consumed by the methods in
|
||||
// `KeyValueCommitting`, `KeyValueConsumption` and `KeyValueSubmission` objects.
|
||||
//
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package com.daml.ledger.participant.state.kvutils.store.events;
|
||||
@ -17,7 +8,7 @@ option java_package = "com.daml.ledger.participant.state.kvutils.store.events";
|
||||
option csharp_namespace = "Com.Daml.Ledger.Participant.State.KVUtils.Store.Events";
|
||||
|
||||
import "com/daml/daml_lf_dev/daml_lf.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/daml_kvutils.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/events/rejection_reason.proto";
|
||||
|
||||
// A public package upload.
|
||||
// Daml-LF packages will be deduplicated based on their hashes. Only unique
|
||||
|
@ -8,7 +8,7 @@ option java_package = "com.daml.ledger.participant.state.kvutils.store.events";
|
||||
option java_multiple_files = true;
|
||||
option csharp_namespace = "Com.Daml.Ledger.Participant.State.KVUtils.Store.Events";
|
||||
|
||||
import "com/daml/ledger/participant/state/kvutils/daml_kvutils.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/events/rejection_reason.proto";
|
||||
|
||||
// An allocation of party name and assignment of a party to a given
|
||||
// participant.
|
||||
|
@ -1,27 +1,15 @@
|
||||
// Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
//
|
||||
// Protocol buffer messages used by the participant state key-value utilities
|
||||
// for implementing a Daml ledger backed by a key-value store.
|
||||
//
|
||||
// These messages should only be produced and consumed by the methods in
|
||||
// `KeyValueCommitting`, `KeyValueConsumption` and `KeyValueSubmission` objects.
|
||||
//
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package com.daml.ledger.participant.state.kvutils;
|
||||
package com.daml.ledger.participant.state.kvutils.store.events;
|
||||
|
||||
option java_package = "com.daml.ledger.participant.state.kvutils";
|
||||
option csharp_namespace = "Com.Daml.Ledger.Participant.State.KVUtils";
|
||||
option java_package = "com.daml.ledger.participant.state.kvutils.store.events";
|
||||
option java_multiple_files = true;
|
||||
option csharp_namespace = "Com.Daml.Ledger.Participant.State.KVUtils.Store.Events";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "com/daml/ledger/configuration/ledger_configuration.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/state.proto";
|
||||
|
||||
// Errors
|
||||
|
||||
//
|
||||
// Used by participant.state.v1 API.
|
||||
//
|
@ -20,7 +20,7 @@ option csharp_namespace = "Com.Daml.Ledger.Participant.State.KVUtils.Store.Event
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "com/daml/lf/transaction.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/daml_kvutils.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/events/rejection_reason.proto";
|
||||
|
||||
message DamlSubmitterInfo {
|
||||
repeated string submitters = 1;
|
||||
|
@ -11,7 +11,6 @@ option csharp_namespace = "Com.Daml.Ledger.Participant.State.KVUtils.Store";
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/daml_kvutils.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/events/configuration.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/events/configuration_rejection.proto";
|
||||
import "com/daml/ledger/participant/state/kvutils/store/events/package_upload.proto";
|
||||
|
@ -9,7 +9,6 @@ import java.time.{Duration, Instant}
|
||||
import com.daml.ledger.api.DeduplicationPeriod
|
||||
import com.daml.ledger.grpc.GrpcStatuses
|
||||
import com.daml.ledger.offset.Offset
|
||||
import com.daml.ledger.participant.state.kvutils.DamlKvutils._
|
||||
import com.daml.ledger.participant.state.kvutils.committer.transaction.Rejection
|
||||
import com.daml.ledger.participant.state.kvutils.committer.transaction.Rejection.{
|
||||
ExternallyInconsistentTransaction,
|
||||
@ -21,9 +20,21 @@ import com.daml.ledger.participant.state.kvutils.store.events.DamlTransactionBli
|
||||
DivulgenceEntry,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
CausalMonotonicityViolated,
|
||||
DamlSubmitterInfo,
|
||||
DamlTransactionBlindingInfo,
|
||||
DamlTransactionRejectionEntry,
|
||||
DuplicateKeys,
|
||||
InconsistentContracts,
|
||||
InconsistentKeys,
|
||||
InvalidLedgerTime,
|
||||
InvalidParticipantState,
|
||||
MissingInputState,
|
||||
PartiesNotKnownOnLedger,
|
||||
RecordTimeOutOfRange,
|
||||
SubmitterCannotActViaParticipant,
|
||||
SubmittingPartyNotKnownOnLedger,
|
||||
ValidationFailure,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.{
|
||||
DamlCommandDedupKey,
|
||||
|
@ -9,11 +9,15 @@ import com.daml.ledger.participant.state.kvutils.Conversions.{
|
||||
configDedupKey,
|
||||
configurationStateKey,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.DamlKvutils._
|
||||
import com.daml.ledger.participant.state.kvutils.committer.Committer._
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
DamlConfigurationEntry,
|
||||
DamlConfigurationRejectionEntry,
|
||||
Duplicate,
|
||||
GenerationMismatch,
|
||||
Invalid,
|
||||
ParticipantNotAuthorized,
|
||||
TimedOut,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.{
|
||||
DamlLogEntry,
|
||||
|
@ -7,13 +7,16 @@ import java.util.concurrent.Executors
|
||||
|
||||
import com.daml.daml_lf_dev.DamlLf
|
||||
import com.daml.ledger.participant.state.kvutils.Conversions.packageUploadDedupKey
|
||||
import com.daml.ledger.participant.state.kvutils.DamlKvutils
|
||||
import com.daml.ledger.participant.state.kvutils.DamlKvutils._
|
||||
import com.daml.ledger.participant.state.kvutils.committer.Committer.buildLogEntryWithOptionalRecordTime
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.PackageUpload.{
|
||||
DamlPackageUploadEntry,
|
||||
DamlPackageUploadRejectionEntry,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
Duplicate,
|
||||
Invalid,
|
||||
ParticipantNotAuthorized,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.{
|
||||
DamlLogEntry,
|
||||
DamlStateKey,
|
||||
@ -188,7 +191,7 @@ final private[kvutils] class PackageCommitter(
|
||||
ctx.recordTime,
|
||||
uploadEntry.getSubmissionId,
|
||||
uploadEntry.getParticipantId,
|
||||
_.setInvalidPackage(DamlKvutils.Invalid.newBuilder.setDetails(message)),
|
||||
_.setInvalidPackage(Invalid.newBuilder.setDetails(message)),
|
||||
)
|
||||
} else {
|
||||
StepContinue(partialResult)
|
||||
@ -253,7 +256,7 @@ final private[kvutils] class PackageCommitter(
|
||||
ctx.recordTime,
|
||||
uploadEntry.getSubmissionId,
|
||||
uploadEntry.getParticipantId,
|
||||
_.setInvalidPackage(DamlKvutils.Invalid.newBuilder.setDetails(message)),
|
||||
_.setInvalidPackage(Invalid.newBuilder.setDetails(message)),
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -331,7 +334,7 @@ final private[kvutils] class PackageCommitter(
|
||||
ctx.recordTime,
|
||||
uploadEntry.getSubmissionId,
|
||||
uploadEntry.getParticipantId,
|
||||
_.setInvalidPackage(DamlKvutils.Invalid.newBuilder.setDetails(message)),
|
||||
_.setInvalidPackage(Invalid.newBuilder.setDetails(message)),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,14 @@
|
||||
package com.daml.ledger.participant.state.kvutils.committer
|
||||
|
||||
import com.daml.ledger.participant.state.kvutils.Conversions.partyAllocationDedupKey
|
||||
import com.daml.ledger.participant.state.kvutils.DamlKvutils._
|
||||
import com.daml.ledger.participant.state.kvutils.committer.Committer.buildLogEntryWithOptionalRecordTime
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
AlreadyExists,
|
||||
DamlPartyAllocationEntry,
|
||||
DamlPartyAllocationRejectionEntry,
|
||||
Duplicate,
|
||||
Invalid,
|
||||
ParticipantNotAuthorized,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.{
|
||||
DamlLogEntry,
|
||||
|
@ -10,7 +10,6 @@ import java.time.Instant
|
||||
|
||||
import com.daml.ledger.configuration.Configuration
|
||||
import com.daml.ledger.participant.state.kvutils.Conversions._
|
||||
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.{
|
||||
@ -18,7 +17,10 @@ import com.daml.ledger.participant.state.kvutils.committer.transaction.validatio
|
||||
ModelConformanceValidator,
|
||||
TransactionConsistencyValidator,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.DamlTransactionRejectionEntry
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
DamlTransactionRejectionEntry,
|
||||
Duplicate,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.{
|
||||
DamlCommandDedupValue,
|
||||
DamlContractKeyState,
|
||||
|
@ -8,7 +8,6 @@ import java.time.{Duration, Instant}
|
||||
import com.daml.ledger.api.DeduplicationPeriod
|
||||
import com.daml.ledger.configuration.LedgerTimeModel
|
||||
import com.daml.ledger.participant.state.kvutils.Conversions._
|
||||
import com.daml.ledger.participant.state.kvutils.DamlKvutils._
|
||||
import com.daml.ledger.participant.state.kvutils.committer.transaction.Rejection
|
||||
import com.daml.ledger.participant.state.kvutils.store.DamlStateKey
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.DamlTransactionBlindingInfo.{
|
||||
@ -19,6 +18,13 @@ import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
DamlSubmitterInfo,
|
||||
DamlTransactionBlindingInfo,
|
||||
DamlTransactionRejectionEntry,
|
||||
Disputed,
|
||||
Duplicate,
|
||||
Inconsistent,
|
||||
InvalidLedgerTime,
|
||||
PartyNotKnownOnLedger,
|
||||
ResourcesExhausted,
|
||||
SubmitterCannotActViaParticipant,
|
||||
}
|
||||
import com.daml.ledger.participant.state.v2.Update.CommandRejected
|
||||
import com.daml.lf.crypto
|
||||
|
@ -7,7 +7,6 @@ import java.time.{Instant, ZoneOffset, ZonedDateTime}
|
||||
|
||||
import com.codahale.metrics.MetricRegistry
|
||||
import com.daml.daml_lf_dev.DamlLf
|
||||
import com.daml.ledger.participant.state.kvutils.DamlKvutils._
|
||||
import com.daml.ledger.participant.state.kvutils.TestHelpers.{createCommitContext, lfTuple}
|
||||
import com.daml.ledger.participant.state.kvutils.committer.transaction.{
|
||||
DamlTransactionEntrySummary,
|
||||
@ -15,6 +14,7 @@ import com.daml.ledger.participant.state.kvutils.committer.transaction.{
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.committer.{StepContinue, StepStop}
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
CausalMonotonicityViolated,
|
||||
DamlSubmitterInfo,
|
||||
DamlTransactionEntry,
|
||||
DamlTransactionRejectionEntry,
|
||||
|
@ -4,14 +4,17 @@
|
||||
package com.daml.ledger.validator.preexecution
|
||||
|
||||
import com.daml.ledger.participant.state.kvutils.KeyValueCommitting.PreExecutionResult
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.DamlPartyAllocationRejectionEntry
|
||||
import com.daml.ledger.participant.state.kvutils.Raw
|
||||
import com.daml.ledger.participant.state.kvutils.store.events.{
|
||||
DamlPartyAllocationRejectionEntry,
|
||||
Duplicate,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.store.{
|
||||
DamlContractState,
|
||||
DamlLogEntry,
|
||||
DamlStateKey,
|
||||
DamlStateValue,
|
||||
}
|
||||
import com.daml.ledger.participant.state.kvutils.{DamlKvutils, Raw}
|
||||
import com.daml.ledger.validator.StateKeySerializationStrategy
|
||||
import com.daml.ledger.validator.TestHelper.{
|
||||
aLogEntry,
|
||||
@ -114,7 +117,7 @@ object RawPreExecutingCommitStrategySpec {
|
||||
private val aRejectionLogEntry = DamlLogEntry.newBuilder
|
||||
.setPartyAllocationRejectionEntry(
|
||||
DamlPartyAllocationRejectionEntry.newBuilder
|
||||
.setDuplicateSubmission(DamlKvutils.Duplicate.getDefaultInstance)
|
||||
.setDuplicateSubmission(Duplicate.getDefaultInstance)
|
||||
.setParticipantId("a participant ID")
|
||||
.setSubmissionId("a submission")
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user