gpt4 book ai didi

java - 无法在 Corda-Training-Template Java-Src 上发出 IOU

转载 作者:行者123 更新时间:2023-12-01 19:02:31 25 4
gpt4 key购买 nike

IOUIssueFlow 采用 IOUState 状态 参数。如 creating-an-instance-of-a-class 中所述,我们可以通过崩溃 shell 向流程提供状态对象,如下所示(也尝试不使用美元符号):

flow start IOUIssueFlow$InitiatorFlow state: { amount: $10, lender: "O=ParticipantB, L=New York, C=GB", borrower: "O=ParticipantC, L=Paris, C=FR" }

此语句适用于 Corda-training-template 的 Kotlin 版本,但在 Java 版本中会引发以下错误:

No matching constructor found:
- [net.corda.training.state.IOUState]: Could not parse as a command: Cannot construct instance of `net.corda.training.state.IOUState` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: UNKNOWN; line: -1, column: -1]

虽然我没有使用默认构造函数,但默认构造函数仍然应该由 this() 调用:

@ConstructorForDeserialization
public IOUState(Amount<Currency> amount, Party lender, Party borrower, UniqueIdentifier linearId){
this.amount = amount;
this.lender = lender;
this.borrower = borrower;
this.linearId = linearId;
}

public IOUState(Amount<Currency> amount, Party lender, Party borrower) {
this(amount, lender, borrower, new UniqueIdentifier());
}

corda-training-template 中发出 IOU 状态的正确语法是什么? ?

最佳答案

起始 IOUIssueFlow 金额:10 美元,贷方:ParticipantB,借方:ParticipantC

这应该启动所需的 IOU 流程。

关于java - 无法在 Corda-Training-Template Java-Src 上发出 IOU,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59613313/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com