Corda CRaSH Shell可以处理UniqueIdentifier fow参数值吗?

当试图通过二级构造函数启动流程时启动ProposeFlow $ Sender info:{recipientBank:“CN = Bank A,O = Bank A,L = Amsterdam,C = NL”,金额:$ 10,paymentInstruction:“abc”, toCurrency:USD,isFXConversionBySenderBank:true,linearId:e8a8c979-c889-433e-b102-fe43fdae7e1a}

我找不到匹配的构造函数: – [recipientBank:Party,金额:金额,paymentInstruction:字符串,toCurrency:货币,isFXConversionBySenderBank:布尔,linearId:UniqueIdentifier]:缺少参数recipientBank – [信息]:不能解析为一个命令:没有构造net.corda.core.contracts.UniqueIdentifier的实例:否在[Source:N / A; String]字符串值('e8a8c979-c889-433e-b102-fe43fdae7e1a')反序列化的String参数构造函数/工厂方法。 line:-1,column:-1](通过引用链:argent.flow.ProposeFlow $ Info [“linearId”]) – [Party,Amount,String,Currency,boolean,UniqueIdentifier,int,DefaultConstructorMarker]:

通过主要构造函数,流程开始ProposeFlow $ Sender recipientBank:“CN = Bank A,O = Bank A,L = Amsterdam,C = NL”,金额:$ 10,paymentInstruction:“abc”,toCurrency:USD,isFXConversionBySenderBank: linearId:e8a8c979-c889-433e-b102-fe43fdae7e1a

我得到没有找到匹配的构造函数: – [党,金额,字符串,货币,布尔,UniqueIdentifier]:无法解析为一个命令:无法构造net.corda.core.contracts.UniqueIdentifier的实例:否字符串参数构造函数/工厂方法来反序列化字符串值('e8a8c979-c889-433e-b102-fe43fdae7e1a')at [Source:N / A; line:-1,column:-1] – [info:Info]:参数太多 – [Party,Amount,String,Currency,boolean,UniqueIdentifier,int,DefaultConstructorMarker]:

这里是流构造函数 – 对象ProposeFlow {@CordaSerializable数据类信息(val recipientBank:党,val数量:金额,val paymentInstruction:字符串,val toCurrency:货币= amount.token,val isFXConversionBySenderBank:布尔=真,val linearId:UniqueIdentifier = UniqueIdentifier())

@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 ) 

有没有办法?

谢谢。

\肖恩

在M13中,懒惰匹配允许您使用参与方的字符串名称传递参数。 因此,不是“CN = BankA,O = BankA,L =阿姆斯特丹,C = NL”,你可以通过“BankA”,名字将被解决给一个Party

这是一个错误(缺少功能) – shell应该支持UUID解析。 如果你想提交PR,这是一个简单的解决方法:看这里:

https://github.com/corda/corda/blob/master/node/src/main/kotlin/net/corda/node/shell/InteractiveShell.kt#L184

你只需要为UniqueIdentifier添加一个Yaml反序列化器,这可能是两三行代码。

我已经在这里提交: https : //github.com/corda/corda/issues/1123