Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- daml 1.2
- module Demo where
- template Loan
- with
- owner : Party
- where
- signatory owner
- controller owner can
- Loan_Apply : ContractId Loan
- with
- age : Int
- amount : Decimal
- do
- assertMsg "must be over 18 years of age" $ age > 18
- assertMsg "loan value must be at least 120.00" $ amount >= 120.0
- create this
- test_demo = scenario do
- alice <- getParty "alice"
- cid <- submit alice do
- create Loan with owner = alice
- {--
- This example assertion results in the following output
- Scenario execution failed:
- A must-fail commit aborted due to an unexpected failure message
- expected: "must be over 18"
- actual: "loan value must be at least 120.00"
- -}
- submitMustFailMsg alice "must be over 18" do
- exercise cid Loan_Apply with
- age = 19
- amount = 119.00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement