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

Command deduplication - test case that uses CommandService and CommandSubmissionService [KVL-1106] #11098

Merged
merged 4 commits into from
Oct 4, 2021
Merged
Changes from 1 commit
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
Next Next commit
Extract common code for command dedup conformance tests
CHANGELOG_BEGIN

CHANGELOG_END
  • Loading branch information
nicu-da committed Sep 30, 2021
commit 4e4170a81aeed22fbdbd3b86507d6a5f6b593601
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.daml.ledger.client.binding.Primitive.Party
import com.daml.ledger.test.model.DA.Types.Tuple2
import com.daml.ledger.test.model.Test.{Dummy, DummyWithAnnotation, TextKey, TextKeyOperations}
import com.daml.timer.Delayed
import io.grpc.Status
import io.grpc.Status.Code

import scala.annotation.nowarn
Expand Down Expand Up @@ -234,11 +235,11 @@ private[testtool] abstract class CommandDeduplicationBase(
for {
// Submit a command as alice
_ <- ledger.submitAndWait(aliceRequest)
_ <- submitAndWaitRequestAndAssertDeduplication(ledger)(aliceRequest)
failure1 <- submitAndWaitRequestAndAssertDeduplication(ledger)(aliceRequest)

// Submit another command that uses same commandId, but is submitted by Bob
_ <- ledger.submitAndWait(bobRequest)
_ <- submitAndWaitRequestAndAssertDeduplication(ledger)(bobRequest)
failure2 <- submitAndWaitRequestAndAssertDeduplication(ledger)(bobRequest)
// Inspect the ledger state
_ <- assertPartyHasActiveContracts(ledger)(
party = alice,
Expand All @@ -259,7 +260,7 @@ private[testtool] abstract class CommandDeduplicationBase(
.map(contracts =>
assert(
contracts.length == noOfActiveContracts,
s"Expected $noOfActiveContracts active contracts for $party but found ${contracts.length} active contracts",
s"Expected ${noOfActiveContracts} active contracts for $party but found ${contracts.length} active contracts",
)
)
}
Expand Down