英文:
Don't we need DeprecatedConstructorForDeserialization() In Corda State while deleting a state field for 4.9 Enterprise version?
问题
I was trying to test some deletion scenarios of fields in a Corda state. But I was wondered that it doesn't throw deserialization error while retrieving the older data, even without providing deserialization constructors for the deleted field.
And yes, I confirm that older version state has data in it for this particular field.
Is it handled somehow in 4.9 Enterprise version?
Edit: The datatype of my deleted field were String? & String (tested both). Will test customDataType soon, is it like String Corda will manage? (though, don't we need a matching class constructor for deserializing the old state data blob?)
This https://corda.net/blog/a-developers-primer-on-cordapp-upgrades/ blog also suggests providing a deserializationConstructor!
英文:
I was trying to test some deletion scenarios of fields in a Corda state. But I was wondered that it doesn't throw deserialisation error while retrieving the older data, even without providing deserialisation constructors for the deleted field.
And yes, I confirm that older version state has data in it for this particular field.
Is it handled somehow in 4.9 Enterprise version?
Edit: The datatype of my deleted field were String? & String (tested both). Will test customDataType soon, is it like String Corda will manage? (though, dont we need a matching class constructor for deserialising the old state data blob?)
This https://corda.net/blog/a-developers-primer-on-cordapp-upgrades/ blog also suggest to provide deserialisationConstructor!
答案1
得分: 1
这种情况可能发生在删除可空字段时,当Corda序列化框架检测到删除可空字段后的状态时,主构造函数中没有匹配参数的属性将被简单地从对象构建中省略。
要了解更多,请查看这里:https://docs.r3.com/en/platform/corda/4.7/enterprise/serialization-default-evolution.html
英文:
This can be a situation when you delete nullable fields, when a state after removing nullable fields is detected by the Corda serialization framework, properties that don’t have matching parameters in the main constructor are simply omitted from object construction.
To read more take a look here https://docs.r3.com/en/platform/corda/4.7/enterprise/serialization-default-evolution.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论