-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement new validation spec (#204)
* Rename custom error type * Create validation module * Helper validation method used in nextArgs * GQL scalar type for DocumentViewId * Include new modules * Refactor next_entry_args * WIP: refactor publish entry * WIP: refactor publish entry * WIP: nearly there with publish_entry * Introduce domain module * Make more fine grained methods for validation * Remove duplicate insertion of operation from replication service * Fix skiplink and backlink orsering mistake * Comment out test which hangs * Introduce test methods to be used instead of publish() and next_args() * Use cbor macro for more readabe test operations * update expected test hashes * Split test_utils in store into seperate files * Don't validate operation against schema for now * Make existing tests pass * Comment out operation schema validation for now * Test for ensure_log_id * Update test const names * Commit Cargo.lock * Use cbor macro for more readabe test operations * Remove modules which accidentaly came across in cherry-pick * Update tests for LogId's which now start from 0 * Update CHANGELOG * Specify p2panda-rs dep by commit hash * Fixes after p2panda bump * Test for ensure_entry_contains_expected_log_id * Split up data and api validation tests for publish_entry * Refactor verify seq_num, log_id, skiplink and backlink methods * Propergate panic from test runner back to test runtime * Rework seq and log id validation * Test for seq num validation * Refactor verify_log_id and add tests * Update test values * get_expected_skiplink doesn't return option plus tests * Don't return option from get_expected_backlink plus tests * A few more e2e tests * Make clippy happy * Fix after merge * Tidy test publish and next_args methods * Don't depend on DocumentStore in ensure_document_not_deleted * Remove unverified test versions of publish and next_args (whoop!) * Tests for ensure_document_not_deleted * Publish new entry on service bus in replication service * Remove unused deps * Remove unused deps * Add comment about code which will be deprecated after this PR * Remove param validation from next_args * Fix comment * Implement get_latest_log_id on SqlStorage and then safely increment with error handling * Helper methods for safely incrementing seq numbers * Validate passed parameters in gql query method * Refactor verify_seq_num * Move validation of entry and operation out of * Add doc strings for next_args * Remove determine_document_id helper * Add doc strings for `publish` * Fix test error string * Better seperation for pre-publish validation logic * Some nice refactoring in next_args * Move location of determine next args in publish * Implement SqlStorage using new associated type pattern * Make store implementation generic * Correct test names * Test for publish with missing skiplink using MemoryStore * Commit Cargo.lock * Clippy & fmt * Clippy... * Refactor one test * Test for errors when calling publish * Refactor seq_num and backlink getter to avoid unnecessary db call * More cases for missing entrytests * WIP: tests for publishing operations * Helpers for domain tests * Update duplicate entry test * Tests for next_args * Remove some TODOs * Fix one test * Remove println * Remove deprecated request and response structs * More tests for next args * Change test order * Remove wrapper method around bemboo verification * Test for DocumentViewId GQL scalar * Revert to using DocumentId in next_args GQL query plus test * Doc strings in verify module * Tests for publishing to valid and invalid logs * Deleted document tests * Test for missing next skiplink * Increment seq and log tests * Fix expected error strings * Test for latest_log_id * Update CHANGELOG * Docstring and comment review * Clearer error messages * Remove commited test logging file * License header * Comment about updating nex_entry_args API * Typo * Remove println * Better SQL query for latest_log_id * Correct comment string * Don't use nested imports * Correct comment * Move error into match statement * Revert get_expected_skiplink ensure behaviour and improve error message * Another test for get_expected_skiplink * Target p2panda-rs main branch * Fix CHANGELOG.md formatting * Use new string methods and `Human` trait for display in errors * Error in publish when next args have MAX_SEQ_NUM with tests * Comments in test * Rename function with get_checked prefix * A little more clippy happy * Refactor `get_expected_skiplink()` (#220) * Refactor `get_expected_skiplink()` Matches current behavior of `skiplink_seq_num()` method * Remove import * Remove comment * Fix tests * Use rev for p2panda-rs version * Group imports * Refactor initialize_db method * Use only one thread for tarpaulin Co-authored-by: Vincent Ahrend <mail@vincentahrend.com> Co-authored-by: Andreas Dzialocha <x12@adz.garden>
- Loading branch information
1 parent
e574ecd
commit 4e514ca
Showing
35 changed files
with
2,718 additions
and
965 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.