Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Validate trait and impl for ScVal variants that can be invalid (U63, Symbol, Bitset) #111

Merged
merged 58 commits into from
Jul 19, 2022

Conversation

leighmcculloch
Copy link
Member

What

Add Validate trait and impl for ScVal variants that can be invalid (ScVal::U63, ScVal::Symbol, ScVal::Bitset) regardless of any other context.

Why

Facilitate users of the XDR validating that the ScVal types are valid. There are likely to be multiple places that we'll need to validate these XDR values.

Close #106

Known limitations

The ScVal::Map variant and its type, ScMap, also need to be validated, but that is left as a todo! in this change and will be added in a follow up change.

The Validate trait is simple and provides no inputs to address the future need of versioning that @graydon mentions in #106 (comment). We can extend the trait in the future, or create new traits and separate implementations for each version, as the need arises.

@leighmcculloch leighmcculloch changed the base branch from main to base64 July 19, 2022 01:05
Base automatically changed from base64 to main July 19, 2022 01:55
@leighmcculloch leighmcculloch marked this pull request as ready for review July 19, 2022 03:47
@leighmcculloch leighmcculloch enabled auto-merge (squash) July 19, 2022 03:47
@leighmcculloch leighmcculloch merged commit a79301d into main Jul 19, 2022
@leighmcculloch leighmcculloch deleted the issue106 branch July 19, 2022 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Fwk: Add ScVal validation trait and fns (U63, Bitset, Symbol)
1 participant