Bug 1076 conversion error flattening #1216
Merged
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.
This is the SDK companion to stellar/rs-soroban-env#1339 -- it won't work until that change has landed and its refs have updated to point to it.
There's an explanation of the change over there, but briefly: we were discarding meaningful errors when passing through the
TryFromVal<ScVal> for Val
andTryFromVal<Val> for ScVal
impls in env-common, and now (or at least if 1339 lands) we're not. Instead of returningConversionError
we'd be returningError
.The SDK happens to also have conversions with
ConversionError
signatures, and I've opted in this PR to not go a step further and actually change those toError
, instead re-burying theError
intoConversionError
in the SDK, keeping the SDK APIs as they are. I could also change them. But I figured that could be left to @leighmcculloch's choice; he might want to keep the SDK's error repertoire simpler, I'm not sure.