Skip to content

Commit

Permalink
Participant-side deduplication compatibility tests exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-da committed Jan 27, 2022
1 parent d8af4c2 commit 6030225
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
13 changes: 13 additions & 0 deletions compatibility/bazel_tools/testing.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,19 @@ excluded_test_tool_tests = [
},
],
},
{
# Sandbox-on-X doesn't use participant-side command deduplication starting with next release,
# hence older tests will fail to assert it.
"end": "2.0.0-snapshot.20220126.9029.1",
"platform_ranges": [
{
"start": "2.0.0-snapshot.20220126.9029.1",
"exclusions": [
"CommandDeduplicationIT:ParticipantCommandDeduplication",
],
},
],
},
]

def in_range(version, range):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ private[validate] class SequenceImpl(
case s: Submission.UploadPackages =>
Some(packageUploadSuccess(s, timeProvider.getCurrentTimestamp))
case _: Submission.Transaction =>
// TODO SoX: Handle gracefully
throw new RuntimeException("Unexpected Submission.Transaction")
}

Expand Down Expand Up @@ -156,11 +155,15 @@ private[validate] class SequenceImpl(

withErrorLogger(submitterInfo.submissionId) { implicit errorLogger =>
for {
_ <- checkTimeModel(txSubmission.submission, recordTime, ledgerConfiguration)
_ <- checkTimeModel(
transaction = txSubmission.submission,
recordTime = recordTime,
ledgerConfiguration = ledgerConfiguration,
)
_ <- validateParties(
allocatedParties,
txSubmission.transactionInformees,
completionInfo,
allocatedParties = allocatedParties,
transactionInformees = txSubmission.transactionInformees,
completionInfo = completionInfo,
)
_ <- conflictCheckWithInFlight(
keysState = sequencerState.keyState,
Expand All @@ -169,7 +172,7 @@ private[validate] class SequenceImpl(
inputContracts = txSubmission.inputContracts,
completionInfo = completionInfo,
)
_ <- deduplicate(
_ <- deduplicateAndUpdateState(
changeId = ChangeId(
submitterInfo.applicationId,
submitterInfo.commandId,
Expand Down Expand Up @@ -237,7 +240,7 @@ private[validate] class SequenceImpl(
}
}

private def deduplicate(
private def deduplicateAndUpdateState(
changeId: ChangeId,
deduplicationPeriod: DeduplicationPeriod,
completionInfo: CompletionInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ class SequenceSpec extends AnyFlatSpec with MockitoSugar with Matchers with Argu
initialAllocatedParties = allocatedInformees,
initialLedgerConfiguration = initialLedgerConfiguration,
maxDeduplicationDuration = maxDeduplicationDuration,
wallClockTime = () => timeProviderMock.getCurrentTimestamp,
)

def exerciseNonConsuming(
Expand Down

0 comments on commit 6030225

Please sign in to comment.