Skip to content

Commit

Permalink
Re-add application_id to DamlCommandDedupKey [KVL-1000] (#10341)
Browse files Browse the repository at this point in the history
* Re-add `application_id` to DamlCommandDedupKey

CHANGELOG_BEGIN
CHANGELOG_END

* Fix test

* Merge main

* commandDedupKey: reorder calls to proto builder setters according to proto order

* Empty commit to set the changelog

CHANGELOG_BEGIN
[Integration Kit] The command de-duplication key now also includes the daml application ID
CHANGELOG_END
  • Loading branch information
fabiotudone-da authored Jul 21, 2021
1 parent 27d439d commit 49745f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ message DamlStateValue {

message DamlCommandDedupKey {
repeated string submitters = 1;
reserved 2; // was application_id
string application_id = 2;
string command_id = 3;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ private[state] object Conversions {
DamlStateKey.newBuilder
.setCommandDedup(
DamlCommandDedupKey.newBuilder
.setCommandId(subInfo.getCommandId)
.addAllSubmitters(sortedUniqueSubmitters)
.setApplicationId(subInfo.getApplicationId)
.setCommandId(subInfo.getCommandId)
.build
)
.build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class KeyValueCommittingSpec extends AnyWordSpec with Matchers {

private val alice = Ref.Party.assertFromString("Alice")
private val commandId = Ref.CommandId.assertFromString("cmdid")
private val applicationId = Ref.ApplicationId.assertFromString("appid")

private def toSubmission(tx: SubmittedTransaction): DamlSubmission = {
val timestamp = Time.Timestamp.Epoch
Expand All @@ -41,7 +42,7 @@ class KeyValueCommittingSpec extends AnyWordSpec with Matchers {
)
val submitterInfo = SubmitterInfo(
actAs = List(alice),
applicationId = Ref.ApplicationId.assertFromString("appid"),
applicationId = applicationId,
commandId = commandId,
deduplicateUntil = Instant.EPOCH,
)
Expand All @@ -57,7 +58,11 @@ class KeyValueCommittingSpec extends AnyWordSpec with Matchers {

private val dedupKey = DamlStateKey.newBuilder
.setCommandDedup(
DamlCommandDedupKey.newBuilder.addSubmitters(alice).setCommandId(commandId).build
DamlCommandDedupKey.newBuilder
.addSubmitters(alice)
.setApplicationId(applicationId)
.setCommandId(commandId)
.build
)
.build

Expand Down

0 comments on commit 49745f6

Please sign in to comment.