Upgrading a template by changing a field from being mandatory to Optional
- cohen.avrahamOP
Hello,
I am using the SCU tool when upgrading my contracts, and I would like to know why when I change the definition of a field from
InttoOptional Intit require bumping the main version of the package?Why is this change not defined as an SCU-compatible? In terms of knowing the new value, that is not an issue, as it will be
Some <Int> - Jatin_Pandya_cf
hey,
before this, just a heads up that SCU compatibility table is explicit on this point that “Change of Field Type” is listed as not covered by SCU so changing
InttoOptional Intis a type of change, even though it seems semantically lossless.AFIK, a v1 contract with
myField: Int = 42can be represented in v2 asmyField: Optional Int = Some 42. That direction works.BUT buttom line is SCU does allow adding a new
Optionalfield at the end. - cohen.avraham
Thank you @Jatin_Pandya_cf for your response, and I am well aware of what is defined as SCU compatible and what is not.
I would like to know why such changes are not possible to be SCU compatible.
Is it related to protobuf compatibility?