How can I test two different responder flows in the same CorDapp?

久未见 提交于 2019-12-01 12:34:25

问题


I have the following series of flows:

  • Initiator, my initiating flow
  • AliceFlow, which one counterparty uses to respond to Initiator
  • BobFlow, which the other counterparty uses to respond to Initiator

Normally, the two response flows would be defined in separate CorDapps. However, for testing purposes, I have defined them in the same file.

When I run flow tests, I get the error below. How can I fix this?

java.lang.IllegalArgumentException: com.template.Initiator has been specified as the initiating flow by both com.template.BobResponder and com.template.AliceResponder


回答1:


You need to define your responders in different packages. For example, if AliceFlow is defined in com.template, BobFlow could be defined in com.template2.

Then, in your flows, register both packages:

setCordappPackages("com.template", "com.template2")


来源:https://stackoverflow.com/questions/48790458/how-can-i-test-two-different-responder-flows-in-the-same-cordapp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!