I have a simple template with one choice and a script that creates a contract and exercises the choice. When I run daml test, it gives the summary shown below which says that there are two choices in the template. Is there a hidden choice somewhere? How can I test that choice to make test-coverage 100%
Test Summary
daml/Main.daml:testBankService: ok, 1 active contracts, 2 transactions.
Modules internal to this package:
- Internal templates
1 defined
1 (100.0%) created
- Internal template choices
2 defined
1 ( 50.0%) exercised
Here is the code:
module BankService where
template BankAccount
with
bank: Party
accountOwner: Party
balance: Numeric 2
where
signatory bank, accountOwner
choice Deposit: ContractId BankAccount
with amount: Numeric 2
controller accountOwner
do
create this with
balance = balance + amount
module Main where
import Daml.Script
import BankService
testBankService : Script ()
testBankService = script do
bank <- allocateParty "Bank"
alice <- allocateParty "Alice"
aliceAccountCid <- submitMulti [bank, alice][] do
createCmd BankAccount with
bank
accountOwner = alice
balance = 100.00
aliceAccountCid <- submit alice do
exerciseCmd aliceAccountCid Deposit
with
amount = 20.00
return ()