Hi everyone!
I’m working with Daml Finance library. I implement my own Holding:
instance Fungible.HasImplementation Holding
and when I do
interface instance Transferable.I for ...
I need to use a function reapplyLocks
. I tried to import it from import Daml.Finance.Holding.Util (reapplyLocks)
. But not succeeded. With an error:
Could not find module ‘Daml.Finance.Holding.Util’
It is not a module in the current program, or in any known package.
I had this problem a month ago, and if I remember it correctly I just found this function in the source code and redefined it locally:
-- | Utility function to reapply holding locks
reapplyLocks : Lockable.Lock -> ContractId Lockable.I -> Update (ContractId Lockable.I)
reapplyLocks lock cid =
let apply accM context = do
cid <- accM
exercise cid Lockable.Acquire with newLocker = lock.locker; context; lockType = lock.lockType
in foldl apply (pure cid) (S.toList lock.context)
But maybe you know what can be the cause of the import problem?
I have small example project with this case. Here is the file with the import problem. Lines 23-36