Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the code to create session only if the recipient is not the node initiating the flow #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ajithathayahar
Copy link

  1. IssueToken -> Checked and created the session only if the node running the flow is different from the owner. Please check whether I have created owningParty correctly in case if anonymous is set to true
  2. UpdateEvolvableToken -> Filtered the updateSubscribers list in case if the node running the flow is part of the updateSubscribers list. This will happen, if we have self-issued token.
  3. MoveToken -> When a token is transferred to a party, I felt that new party should be added to the distribution list hence added a subflow AddPartyToDistributionList. If this is not needed, please let me know.

Copy link

@roger-that-dev roger-that-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Some minor changes to make - ping me on slack if you'd like to talk through any of the comments. I realise that these flows are a bit of a mess and need tidying up. What I'd like to do in future is to make each of the flows smaller and more simple and then allow them to be composed together easily with sub flows.

val owningParty: AbstractParty = if (anonymous) {
subFlow(RequestConfidentialIdentity.Initiator(ownerSession)).party.anonymise()
} else owner
val owningParty: AbstractParty

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this can be a conditional assignment? val owningParty = if (x) { y() } else { z() }

@@ -40,7 +41,11 @@ object MoveToken {
val owningParty: AbstractParty = if (anonymous) {
subFlow(RequestConfidentialIdentity.Initiator(ownerSession)).party.anonymise()
} else owner


if (ownedToken is TokenPointer<*>) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this will work. I set up the distribution list so that only the creator of the evolvable token type has the distribution list, as they are the only ones which can update the list. Here we are setting up a distribution list on the party which is moving the token (which references the evolvable token type) to another node. So they will have a list but there is no code path in the token SDK currently which would result in this non-issuer party forwarding on the evolvable token updates.... This is where data distribution groups come in. I realise that for now, the functionality here is quite limited until we get data distribution groups. The solution is for all Partys to manually sign up with the maintainer of the evolvable token type using the RequestAdditionToDistributionList flow.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall i remove this AddPartyToDistributionList? I misunderstood the concept and to enable all parties receiving the updates when an update happens on the evolvable token, I added this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants