In Corda 3, using Cash with a mock network throws the following error: Please register the entity <ENTITY_NAME>

末鹿安然 提交于 2019-12-13 03:27:35

问题


I am trying to run the Obligation CorDapp here on Corda 3. I am getting following error when issuing cash:

Cannot find contract attachments for [net.corda.finance.contracts.asset.Cash]. See https://docs.corda.net/api-contract-constraints.html#debugging

And when settling I get this:

Please register the entity ‘net.corda.finance.schemas.CashSchemaV1’ See https://docs.corda.net/api-persistence.html#custom-schema-registration for more information

I have tried following solutions:

  • Error While Fetching Data from Corda Custom Tables

  • https://docs.corda.net/api-contract-constraints.html#debugging

But nothing helped.


回答1:


You need to register both packages with the MockNetwork, as follows:

network = MockNetwork(
    listOf("net.corda.finance.contracts.asset", "net.corda.finance.schemas")
)


来源:https://stackoverflow.com/questions/49428000/in-corda-3-using-cash-with-a-mock-network-throws-the-following-error-please-re

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