Corda CRaSH Shell能否处理参数值的唯一标识符?
尝试通过辅助构造函数启动流时 流程启动建议flow$Sender info:{收款人银行:“CN=银行A,O=银行A,L=阿姆斯特丹,C=NL”,金额:$10,付款说明:“abc”,币种:美元,IsFXConversion BySenderBank:真,linearId:e8a8c979-c889-433e-b102-fe43fdae7e1a} 我得到 未找到匹配的构造函数: -[recipientBank:Party,amount:amount,paymentInstruction:String,toCurrency:Currency,isFXConversionBySenderBank:boolean,linearId:UniqueIdentifier]:缺少参数recipientBank -[信息]:无法作为命令进行分析:无法构造net.corda.core.contracts.UniqueIdentifier的实例:没有字符串参数构造函数/工厂方法从字符串值('e8a8c979-c889-433e-b102-fe43fdae7e1a'反序列化) 在[来源:不适用;第1行,第1列](通过参考链:argent.flow.ProposeFlow$Info[“linearId”]) -[参与方、金额、字符串、货币、布尔值、唯一标识符、int、DefaultConstructorMarker]: 通过主构造函数, 流程启动建议flow$Sender recipientBank:“CN=银行A,O=银行A,L=阿姆斯特丹,C=NL”,金额:$10,付款说明:“abc”,币种:美元,ISFXConversion BySenderBank:true,linearId:e8a8c979-c889-433e-b102-fe43fdae7e1a 我得到 未找到匹配的构造函数: -[Party,Amount,String,Currency,boolean,UniqueIdentifier]:无法作为命令进行分析:无法构造net.corda.core.contracts.UniqueIdentifier的实例:没有字符串参数构造函数/工厂方法从字符串值('e8a8c979-c889-433e-b102-fe43fdae7e1a'反序列化) 在[来源:不适用;第1行,第1列] -[信息:信息]:参数太多 -[参与方、金额、字符串、货币、布尔值、唯一标识符、int、DefaultConstructorMarker]: 下面是流构造函数- 对象建议流{ @可互换 数据类信息(val接收方银行:一方, val金额:金额, val paymentInstruction:字符串, val toCurrency:Currency=amount.token, val isFXConversionBySenderBank:Boolean=true, val linearId:UniqueIdentifier=UniqueIdentifier())Corda CRaSH Shell能否处理参数值的唯一标识符?,corda,Corda,尝试通过辅助构造函数启动流时 流程启动建议flow$Sender info:{收款人银行:“CN=银行A,O=银行A,L=阿姆斯特丹,C=NL”,金额:$10,付款说明:“abc”,币种:美元,IsFXConversion BySenderBank:真,linearId:e8a8c979-c889-433e-b102-fe43fdae7e1a} 我得到 未找到匹配的构造函数: -[recipientBank:Party,amount:amount,paymentInstruction:Strin
@InitiatingFlow
@星表
类别发送方(val接收方银行:一方,
val金额:金额,
val paymentInstruction:字符串,
val toCurrency:Currency=amount.token,
val isFXConversionBySenderBank:Boolean=true,
val linearId:UniqueIdentifier=UniqueIdentifier()):FlowLogic(){
构造函数(info:info):这个(
recipientBank=info.recipientBank,
金额=信息金额,
paymentInstruction=info.paymentInstruction,
toCurrency=info.toCurrency,
isFXConversionBySenderBank=info.isFXConversionBySenderBank,
linearId=info.linearId
)
附近有路吗
谢谢
\Sean这是一个bug(缺少功能)-shell应该支持UUID解析。如果您想提交PR,这是一个简单的修复方法:请看这里:
您只需要为UniqueIdentifier添加一个Yaml反序列化程序,它可能是两行或三行代码
我在这里归档了:
@InitiatingFlow
@StartableByRPC
class Sender(val recipientBank: Party,
val amount: Amount<Currency>,
val paymentInstruction: String,
val toCurrency: Currency = amount.token,
val isFXConversionBySenderBank: Boolean = true,
val linearId: UniqueIdentifier = UniqueIdentifier()) : FlowLogic<SignedTransaction>() {
constructor(info: Info): this (
recipientBank = info.recipientBank,
amount = info.amount,
paymentInstruction = info.paymentInstruction,
toCurrency = info.toCurrency,
isFXConversionBySenderBank = info.isFXConversionBySenderBank,
linearId = info.linearId
)