corda / token-sdk

Corda Tokens SDK
Other
79 stars 76 forks source link

Multiple issuance calls will cause multiple distribution list entries #66

Closed philippkueng closed 5 years ago

philippkueng commented 5 years ago

In the case when an Issuer issues 10 ACME tokens to Receiver multiple times, this will result in the Receiver with a LinearId for ACME being included in the DistributionList multiple times. I'd say that's a bug and would expect the DistributionList to only contain a single entry for a Token(LinearId) and Party combination.

https://github.com/corda/token-sdk/blob/01adf4bbe8d7fdd88c84c225646aed394a6c693d/workflow/src/main/kotlin/com/r3/corda/sdk/token/workflow/flows/internal/distribution/UpdateDistributionListFlow.kt#L52

If you agree with me, please give me some guidance if you'd prefer the addPartyToDistributionList or any DistributionList helper function to be upsert-like to if you'd like to do a check as part of the flow.

roger-that-dev commented 5 years ago

Yup that makes sense - thanks for flagging this @philippkueng. I'll fix it now 👍

roger-that-dev commented 5 years ago

Fixed!