Hi, I see the use of divulged contracts are being deprecated (and are incompatible with pruning), and that I can exercise a flexible choice on a contract (I’m not a stakeholder of) given readAs rights (to one of its stakeholders). I have 2 questions related to this:
Question 1: I’m wondering if it is necessary to disallow the use of divulged contracts that is being created within the same atomic action, e.g., a contract is created and divulged to Alice, and then Alice exercises a flexible choice on it? Please note the following:
Note 1: Alice can be certain that such a contract (being created and divulged within the same atomic action) is still around within the same atomic action.
Note 2: As a workaround one can obviously add Alice as an observer for a split second to the contract, i.e., as a first step of the atomic action, add Alice as an observer to the contract, and then remove her as a last step (if there are such choices on the contract i.e.). However, adding those choices feel somewhat superfluous (if only used within this context), and some information is also leaked to the stakeholders of the contract (namely that Alice is added as an observer to the contract for a split second).
Note 3: Another workaround (which obviously is not always possible) would be to give Alice readAs rights to one of the parties of the contract being divulged (then it is no need to add Alice as an observer for a split second). In that light it feels like one could as well allow exercising a flexible choice on a created and divulged contract within the same atomic action (at least one can derive that behaviour by solely looking at the DAML code).
Question 2: As Alice can exercise a flexible choice on a contract (of which she is not a stakeholder) through readAs rights (to one of the contract’s stakeholders), why is she not allowed to fetch its contract data (note that she knows the contract id)? A workaround would be to let Alice exercise a flexible choice on the contract that returns the contract data, but adding such choices feels somewhat unnecessary.