Display the state information to a list of participants dynamically

0 votes

I have tweeked the Yo- CordApp to send to a list of participants instead of single participant in the target. I would like to send the YO to more than one Party, moreover I just want to display the state information to the parties which does not require the signatures of all parties. But I am stuck with the below error. Please help.

FlowLogicRef cannot be constructed for FlowLogic of type net.corda.yo.YoFlow as could not find matching constructor for: {target=null}

This is my code: https://github.com/ToniyaSundaram/CordaProjects.

Jul 24, 2018 in Blockchain by sabby
• 4,370 points

edited Jul 24, 2018 by sabby 655 views

1 answer to this question.

0 votes

There might be a bug in your API endpoint code.

In your code, you are setting:

val acceptors : ArrayList<Party>? = null;

And then in the subsequent loop, you have the following logic for expanding the array:

if (acceptors != null) {
    acceptors.add(to)
}

Since acceptors is initialised to null, this condition is never true and you never expand the list. As a result, when you try to construct the YoFlow, you are trying to set the target parameter to null, which isn't allowed due to Kotlin's null safety.

Try this instead:

val acceptors = mutableListOf<Party>()
answered Jul 24, 2018 by Christine
• 15,790 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer

How to get the current state of a smart contract?

Hey, you gotta provide the contract code, and ...READ MORE

answered Aug 1, 2018 in Blockchain by Perry
• 17,100 points
1,106 views
0 votes
1 answer

How do I send back ethers to the sender of the tokens in a smart contract?

Whenever a smart contract receives ether via ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,100 points
3,601 views
0 votes
1 answer

What could be the best term to use for the collection of contracts in a .sol file?

module - don't think so. Because module ...READ MORE

answered Jun 2, 2018 in Blockchain by Shashank
• 10,400 points
730 views
+1 vote
1 answer

How do i generate corda nodes keystores in dev mode?

In Corda, the node will look into ...READ MORE

answered Apr 11, 2018 in Blockchain by Perry
• 17,100 points
1,699 views
0 votes
1 answer
+1 vote
1 answer

I would like to create a blockchain network which will stay at the same level of complexity, is it possible?

You can very easily create a cryptocurrency having a ...READ MORE

answered Apr 4, 2018 in Blockchain by Christine
• 15,790 points
849 views
0 votes
1 answer

In a Blockchain, how difficult is it to modify the third to last block?

Technically, it's not difficult at all, all ...READ MORE

answered Apr 20, 2018 in Blockchain by Christine
• 15,790 points
1,027 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP