Skip to content
CCPEDIAby Unity Nodes
App Development

Fungible - Default implementation for split and merge as functions

2 posts245 views1 likesLast activity Feb 2023

  1. jvelasco.intellecteuOP

    Hi,

    In our project we’ve created a new Interface for Holdings (Withdrawable). The idea is to extend Daml.Finance.Holding.Fungible with this new behaviour. We’ve written a new module MyProject.Holding.FungibleWithdrawable with the contents from Daml.Finance.Holding.Fungible (excepting getRestAmount function which we can import from Daml.Finance.Holding.Fungible) but we ended up with code duplicated.

    Would it be possible to extract the logic on split and merge functions ( interface instance Fungible.I ) into functions (say splitImpl and mergeImpl) in the same way it’s done with transferImpl, acquireImpl, releaseImpl, etc ?

    Thanks
    Jose

  2. Johan_Sjodin 1
    jvelasco.intellecteu:

    extract the logic on split and merge functions ( interface instance Fungible.I ) into functions (say splitImpl and mergeImpl) in the same way it’s done with transferImpl, acquireImpl, releaseImpl, etc ?

    Hi @jvelasco.intellecteu,

    I think that makes sense. I have created a ticket where we can track it here:

    github.com/digital-asset/daml-finance

    Factor out `splitImpl` and `mergeImpl` from the `Fungible` implementation

    opened 04:23PM - 23 Feb 23 UTC
    closed 09:30AM - 17 Mar 23 UTC
    component-core gardening user-experience

    Thanks,
    Johan