daml
daml copied to clipboard
[FEATURE REQUEST] Archive for Daml Interfaces
I confirm that, if this is a feature request that has security implications, I already contacted [email protected] and followed the responsible disclosure policy.
I confirm that this is not a question or a request for technical support by the community, for which the Daml forum is available.
What is the problem you want to solve?
Given that all implementations of interfaces are templates, it is surprising that the archive function does work on them. It would improve the UX a fair amount if one didn't have to declare functions
archive_IMyInterface : ContractId IMyInterface -> Update ()
in each interface and then implement them using archive on each interface implementation.
create should already exists. are you encountering an issue with that? Archive indeed does not exist (yet). We thought about it but there are a few reasons why it’s more complex than it seems but I’m optimistic we can find a solution.
No, to be fair, the issue was flagged up to me in the context of archive and I just took on writing a ticket to make sure it doesn't get lost.
edited the description to only talk about archive, we have tests for create so it does work. if it doesn’t open a separate bug with an example.
Once we drop the name collision check between interface choices & template choices (see https://github.com/digital-asset/daml/issues/13653), we can add the Archive choice and HasArchive instance for interfaces, like we already do for templates.
Now that interface choices are not "inherited" by templates, it would be a relatively simple change to add instance HasExercise <Interface> Archive and instance HasArchive <Interface>. If there's still a need for this we'd be happy to work on it @bame-da @cocreature
I think there is a need for this but I'd recommend to not rush this. I discussed making Archive a "builtin" choice with @remyhaemmerle-da and I’d do it as part of that rather than just generating it from the compiler.
I still think we want this feature. I don't mind waiting a little, but targeting 2.6 would be a good thing imo.