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

feat(verified_contracts-values) - add verified_contracts creation and runtime values constraints #13

Merged
merged 9 commits into from
Sep 10, 2024

Conversation

rimrakhimov
Copy link
Contributor

@rimrakhimov rimrakhimov commented Aug 1, 2024

Add a check that only allowed keys are used inside verified_contracts.creation_values and verified_contracts.runtime_values. Allows for keys not to be present in the object.

Adds internal constraints for the values according to json-schema (checks that values are valid hexes and have correct lengths)

@rimrakhimov rimrakhimov force-pushed the rimrakhimov/values-constraints branch from b438373 to ec1f649 Compare August 1, 2024 22:43
@rimrakhimov rimrakhimov force-pushed the rimrakhimov/values-constraints branch from ec1f649 to 657300e Compare September 1, 2024 12:48
@rimrakhimov rimrakhimov changed the base branch from rimrakhimov/artifacts-constraints to master September 1, 2024 12:48
@rimrakhimov rimrakhimov force-pushed the rimrakhimov/values-constraints branch from 657300e to 22d04c7 Compare September 3, 2024 10:51
@rimrakhimov rimrakhimov changed the title feat(database.sql) - add verified_contracts creation and runtime values constraints feat(values) - add verified_contracts creation and runtime values constraints Sep 5, 2024
@rimrakhimov rimrakhimov changed the title feat(values) - add verified_contracts creation and runtime values constraints feat(verified_contracts-values) - add verified_contracts creation and runtime values constraints Sep 5, 2024
@kuzdogan kuzdogan self-requested a review September 5, 2024 13:03
@kuzdogan kuzdogan self-assigned this Sep 5, 2024
Copy link
Member

@kuzdogan kuzdogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 comment, and about that, we do allow submitting contracts without creation match right? In my mind it was that we require a creation match but runtime match was optional. What I can see from the schema now, is it can be either runtime or creation.

Otherwise great tests again. Thank you

tests/test_constraint_runtime_values.py Show resolved Hide resolved
@rimrakhimov
Copy link
Contributor Author

As far as I remember, we've agreed upon at least one match without any difference if it is creation or runtime one. For example, for contracts deployed in genesis there will be no creation matches, but runtime only

@rimrakhimov rimrakhimov force-pushed the rimrakhimov/values-constraints branch from d5c4d8e to facb73a Compare September 10, 2024 14:27
@rimrakhimov rimrakhimov merged commit 8e9a47e into master Sep 10, 2024
1 check passed
@rimrakhimov rimrakhimov deleted the rimrakhimov/values-constraints branch September 10, 2024 16:26
@rimrakhimov rimrakhimov restored the rimrakhimov/values-constraints branch September 10, 2024 16:27
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.

2 participants