Daml.Finance.Interface.Util.Lockable¶
Interfaces¶
interface Lockable
An interface for managing locking of contracts. Locking is a mechanism to temporarily encumber contracts by adding third-party lockers as additional signatories.
viewtype V
Choice Acquire
Lock a contract.
Controller: (DA.Internal.Record.getField @"controllers" (view this)), newLockers
Returns: ContractId Lockable
Field Type Description newLockers Parties Parties which restrain the contract’s ability to perform specified actions. context Text Reason for acquiring a lock. lockType LockType Type of lock to acquire. Choice Archive
Controller: Signatories of implementing template
Returns: ()
(no fields)
Choice GetView
Retrieves the interface view.
Controller: viewer
Returns: V
Field Type Description viewer Party The party retrieving the view. Choice Release
Unlock a locked contract.
Controller: getLockers this
Returns: ContractId Lockable
Field Type Description context Text Method acquire : Acquire -> Update (ContractId Lockable)
Implementation of the
Acquire
choice.Method release : Release -> Update (ContractId Lockable)
Implementation of the
Release
choice.
Data Types¶
data Lock
Locking details.
Field Type Description lockers Parties Parties which are locking the contract. context Set Text Context of the lock, explaining why this lock is held by the locking parties. If the lock is reentrant, there may be more than one locking context for the set of lockers. lockType LockType The type of lock applied.
data LockType
- type V
= View
Type synonym for
View
.instance HasFromAnyView Lockable V
data View
Functions¶
- getLockers
: HasToInterface t Lockable => t -> Parties
Retrieves the lockers of a
Lockable
.
- mustNotBeLocked
: HasToInterface i Lockable => i -> Update ()
Asserts that a lockable is not locked.