Implement Wasm validation for known issues/markers#171
Conversation
ascjones
left a comment
There was a problem hiding this comment.
It would be possible to make it forward compatible if we wanted by adding these to an extra section in the generated metadata, though this would of course rely on the metadata being generated first.
This protocol should not exist in the contract metadata since it has absolutely no value beyond |
|
That makes sense. There is still a way at least to provide some forward compatibility by detecting the common prefix |
| .expect("error marker must exist as prefix"); | ||
| let hex = serde_hex::from_hex(&encoded).expect("decoding hex failed"); | ||
| let decoded = | ||
| <EnforcedErrors as codec::Decode>::decode(&mut &hex[..]).expect("decoding object failed"); |
There was a problem hiding this comment.
This should probably still return a friendly string explaining that the EnforcedError could not be decoded, and the probable cause (a mismatch between the ink! version and the local definition).
There was a problem hiding this comment.
This could occur when e.g. ink! adds a new variant, and someone is running an outdated version of cargo-contract.
Closes #163.
Output currently looks like this: