在Corda 3中,使用Cash和模拟网络会引发以下错误:请注册实体<entity_name>

时间:2018-03-22 11:52:24

标签: corda

我正在尝试在Corda 3上运行Obligation CorDapp here。我在发现现金时遇到以下错误:

using System;

public class Bob
{
  static void Main()
  {
    var b = new Bob();
    b.showYToolStripMenuItem_Click();
    Console.WriteLine(b.ShowY);
    Console.ReadLine();
  }
  // different properties of type bool, defined in form1
  private ref bool ShowX { get { return ref _showX; } }
  private ref bool ShowY { get { return ref _showY; }  }
  private bool _showX = false;
  private bool _showY = false;

  // generic menu strip item bool handler
  private void HandleMenuStripItemBool(ref bool boolProp)
  {
    boolProp = true;
  }

  // click event of the "Show X" menu strip item, defined in form1
  private void showXToolStripMenuItem_Click()
  {
    HandleMenuStripItemBool(ref ShowX);
  }

  // click event of the "Show Y" menu strip item, defined in form1
  private void showYToolStripMenuItem_Click()
  {
    HandleMenuStripItemBool(ref ShowY);
  }
}

当我解决时,我得到了这个:

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

我尝试过以下解决方案:

但没有任何帮助。

1 个答案:

答案 0 :(得分:1)

您需要使用Please register the entity ‘net.corda.finance.schemas.CashSchemaV1’ See https://docs.corda.net/api-persistence.html#custom-schema-registration for more information 注册这两个包,如下所示:

MockNetwork