mStructs with encodingKey (integrated with source-mapping branch) #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Helios up until v0.17.0.98 allowed definition of a string-mapped struct (aka mStruct) in this form
This was encoded as a
ConstrData(0, MapData)
, and it worked fine when a script's Datum was itself defined as an mStruct such as thismyStructDef
, and not an enum with a variant havingfield1: mStruct
. Using that definition inside an enum variant would produce a second layer of ConstrData.This change establishes:
This represents a behavioral change versus version 0.16 (which expects a ConstrData in all cases when decoding an mStruct). Developers using such a struct as their Datum can continue getting CIP-68-compliant encoding by changing to an enum: