【问题标题】:Corda evolving of the Contract State with Signing constraint带有签名约束的合同状态的 Corda 演变
【发布时间】:2019-09-18 21:31:17
【问题描述】:

在我的 Corda 4.1 安装中,我使用签名约束并希望在我的状态中添加一个新字段“test”。添加它并在我尝试查询我的保管库时更新我的​​ cordapp 后,我收到以下错误:

"VaultQueryException - An error occurred while attempting to query the vault: Failed to deserialise group OUTPUTS_GROUP at index 0 in transaction: Cannot construct evolution serializer for remote type sg.tradecloud.contracts.states.company.properties.Company: Mandatory property test of local type is not present in remote type. This implies the type has not evolved in a backwards compatible way. Consider making test nullable in the newer version of this type.

我有什么方法可以解决这个问题?我应该让“测试”为空吗?我应该做明确的状态更新吗?或者还有其他我可以解决的吗?

【问题讨论】:

    标签: corda


    【解决方案1】:

    您应该将引入的新字段设为可为空。除非您将新添加的字段设为可空,否则 Corda 将无法反序列化旧发布的状态。

    【讨论】:

    • 但无论如何,如果我需要保持它们不可为空,有什么方法可以做到这一点?显式迁移?
    猜你喜欢
    • 2021-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    • 1970-01-01
    相关资源
    最近更新 更多