add regression test for #14171 in conformance test (#14212)

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Remy 2022-06-20 09:41:50 +02:00 committed by GitHub
parent 253b0b186c
commit 5b139bea60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 0 deletions

View File

@ -850,6 +850,7 @@ excluded_test_tool_tests = [
"end": "2.3.0-snapshot.20220611.10066.0.458cfc43",
"exclusions": [
"ExceptionsIT:ExRollbackCreate",
"ExceptionsIT:ExRollbackExerciseCreateLookup",
],
},
],

View File

@ -441,4 +441,16 @@ final class ExceptionsIT extends LedgerTestSuite {
}
})
test(
"ExRollbackExerciseCreateLookup",
"Lookup a contract Archiving a contract created within a rolled-back try-catch block, fails",
allocate(SingleParty),
)(implicit ec => { case Participants(Participant(ledger, party)) =>
for {
helper <- ledger.create(party, ExceptionTester(party))
withKey <- ledger.create(party, WithSimpleKey(party))
_ <- ledger.exercise(party, helper.exerciseRollbackExerciseCreateLookup(_, withKey))
} yield ()
})
}

View File

@ -374,3 +374,16 @@ template ExceptionTester
catch
Ecid cid ->
archive cid
-- regression test for https://github.com/digital-asset/daml/issues/14171
nonconsuming choice RollbackExerciseCreateLookup: ()
with cid : ContractId WithSimpleKey
controller p
do
try do
exercise cid Archive
create (WithSimpleKey p)
throw (E "")
catch E _ -> pure ()
result <- lookupByKey @WithSimpleKey p
result === Some cid