-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split input output note register structs (#199)
* split input notes * make enum for notes tables * rename recipients variable and add more NoteTable uses * run fmt * change to_string for to_hex * correct nullable fields and reorder fields * remove unnecesarry note filter * remove unnecessary commit_height field * move related rows into metadata row for notes * remove dbg statements * switch to_string for to_hex * Revert "move related rows into metadata row for notes" This reverts commit bf46c0a. * restore filtering by pending notes * store grouped json fields * add json fields with serialization/deserialization I still have pending polishing the changes (abstracting some deserialization and removing debugs, etc.) and we should also add some kind of validation as well as having the proper NULL / NOT NULL columns (now everything is nullable) * remove dbg calls and set nullable/non-nullable cols accordingly * apply clippy suggestion * add helper functions to work with json values returned as strings * add documentation for handling json with sqlite * fix incorrect function use to fetch output notes * ignore doc tests * add json validity constraints * use structs to represent json columns * remove dbg statements * use propper serialization * use existing NoteMetadata instead of NoteRecordMetadata * also remove NoteRecordInclusionProof and use NoteInclusionProof instead * add implementations for output notes * change input note record struct TODO: fix tests * Fix test failures There were two different kind of errors: * When we queried for less fields than what parse_input_notes_columns expected (this happened on the function to get peding input note nullifiers) * When we serialized the note status. Apparently serde serializes the note as `\"Variant\"` instead of `variant`. * update doc comments * cleanup struct * remove dbg statements * fix serialization for output notes * change from to tryfrom for notestatus * move note record structs to its own module * remove todo comment * remove quotes from note status
- Loading branch information
Showing
16 changed files
with
720 additions
and
254 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
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
Oops, something went wrong.