Templates and Interfaces such as Account are currently 'flat', meaning they have no nested structures:
data View = View
with
custodian : Party
-- ^ Party providing accounting services.
owner : Party
-- ^ Party owning this account.
id : Id
-- ^ Identifier for the account.
description : Text
-- ^ Human readable description of the account.
controllers : Controllers
-- ^ Parties controlling transfers.
Accessing the keys of these entities can be done with a convenience function, e.g. toKey in this case:
-- | Convert the account's 'View' to its key.
toKey : View -> AccountKey
toKey v = AccountKey with custodian = v.custodian; owner = v.owner; id = v.id
While this works fine within Daml, these functions can't be used from a client application. These need to be packed/unpacked manually, (both externally, but also in Daml) - which requires looking at the function definition to know what the key is.
I suggest that this be changed to:
data View = View
with
key: AccountKey
description : Text
-- ^ Human readable description of the account.
controllers : Controllers
-- ^ Parties controlling transfers.
I have a recollection that at some point we had this, and I think it's changed since.
Templates and Interfaces such as
Account
are currently 'flat', meaning they have no nested structures:Accessing the keys of these entities can be done with a convenience function, e.g.
toKey
in this case:While this works fine within Daml, these functions can't be used from a client application. These need to be packed/unpacked manually, (both externally, but also in Daml) - which requires looking at the function definition to know what the key is.
I suggest that this be changed to:
I have a recollection that at some point we had this, and I think it's changed since.