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(base_layer): basic validations for proposals, proposal acceptances and amendments #4238

Merged
merged 11 commits into from
Jun 30, 2022

Conversation

mrnaveira
Copy link
Contributor

@mrnaveira mrnaveira commented Jun 28, 2022

Description

  • Added new base layer validations for:
    • Contract update proposals:
      • The corresponding constitution must be already published
      • No duplicated proposals (same contract_id and proposal_id) can be published
    • Contract update proposal acceptances:
      • The corresponding update proposal must be already published
      • No duplicated acceptances (same proposal and validator node) can be published
    • Contract amendments:
      • The corresponding update proposal must be already published
      • No duplicated amendments can be published for the same proposal
      • The updated_constitution ratified in the amendment must match exactly the one in the update proposal
  • Added new unit tests for all the new validations
  • Adapted an existing integration test for amendments due to the new validations
  • Added ContractAmendment to the base layer database index (lmdb)
  • Refactored some redundant helper code for validations

Motivation and Context

The base layer should perform basic validations (required prior data, no duplications and consistency) on update proposals, proposal acceptances and amendments

How Has This Been Tested?

  • New unit test to check the new validation
  • The existing unit and integration tests pass

stringhandler
stringhandler previously approved these changes Jun 29, 2022
@aviator-app aviator-app bot removed the mq-failed label Jun 30, 2022
@aviator-app aviator-app bot merged commit 64f8972 into tari-project:development Jun 30, 2022
@mrnaveira mrnaveira deleted the validate-proposals branch June 30, 2022 14:10
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