Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mf/add association txn types (deso-protocol#420)
* Add associations txn type. * Add put and delete badger operations for associations. * Split into CREATE and DELETE txn types. * Add metadata validations. * Add connect create associations logic. * Add connect delete association txns. * Add disconnect logic. * Add db adapter. * Add badger getter queries. * Add flush logic. * Add postgres associations data types. * Add postgres flush operations. * Fix tabs. * Add postgres getter queries. * Add blockchain.go create txn funcs. * Add association tx index structs. * Add byte encoders. * Dont error if dont find association in pg queries. * Populate association tx index metadata. * Add funcs to decode associations from bytes. * Add create user association validation tests. * Add delete user association validation tests. * Refactor + consolidate association test helpers. * Add happy path test for creating + deleting user association. * Add post association tests. * Get tests working on postgres. * Add query funcs to find associations by attributes. * Add postgres api queries. * Add badger query for associations. * Test wildcard user association matching. * Add post association wildcard query helpers. * Add post association query api tests. * Make AssociationType case-insensitive. * Fix failing CI test. * Run tests twice. Once flushing. Once all in mempool. * Fix failing CI. * Retrigger CI. * Add first failed test query. * Improve mempool association querying test coverage. * Improve test coverage moar. * Improve test coverage moar moar. * Touch-ups. * Move back inline comment to fix gofmt. * Run associations postgres tests in CI. * Fail retrieving associations if no query params are set. * Add AssociationTypePrefix and AssociationValuePrefix. * Return nil in get association by ID if association was deleted. * Dont include deleted associations in get by attributes query. * Rename indices. * Add AppUserPKID field. * Add tests for app user pkid querying. * Store ExtraData on AssociationEntries. * Rename AppUserPKID to AppPKID. * Add function to count matching association entries. * Fix gofmt issue. * Add tests for counting user associations. * Add count post associations tests. * Return new and deleted utxo association entries from helper. * Fix go fmt. * Add more association info to tx index. * Address some PR feedback. * Switch association type/value from strings to byte slices. * Fix failing postgres tests. * Move comparison of association types into helper func. * Add association type postgres indices. * Address some PR review feedback. * Add makefile helper to go-fmt code. * Add association encoder migrations. * Mf/add advanced querying for associations (deso-protocol#430) * Add advanced querying for associations. * Add tests for limit, offset, order user association queries. * Fix go-fmt issues. * Add tests for limit, order, offset queries for post associations. * Fix sort descending querying. * Dont limit, offset, order count queries. * Add generic set struct. * Convert Limit from uint64 to int. * Use sets instead of maps when possible. * Address some PR review comments. * Pass sets as pointers. * Address some of PR review feedback. * Fix gofmt issue. * Rename utxo association variables. * Address some PR review feedback. * Better error messages for invalid query params. * Simplify advanced query for associations by filtering out ALL associationIds when going to the db (deso-protocol#432) * Simplify advanced query for associations by filtering out ALL associationIds when going to the db * Validate LastSeenAssociationID exists. (deso-protocol#433) Co-authored-by: Matt Foley <[email protected]> Co-authored-by: Lazy Nina <[email protected]> * Mf/add associations derived key spending limits (deso-protocol#435) * Add association derived key spending limits. * Add validation for derived key spending limit during txn connect. * Fix failing test. * Start adding test for associations spending limits. * Update tests. * Fix go-fmt. * Simplify use of utxo view in association derived key test. * Dont reuse utxo view. * Add more tests. * Set spending limit count properly. * Add spending limit operation type ANY. * Add more block height guards. * Fix failing test with new encoding pattern. * add range apply as faster way to iterate over elements in set (deso-protocol#434) * Add advanced querying for associations. * Add tests for limit, offset, order user association queries. * Fix go-fmt issues. * Add tests for limit, order, offset queries for post associations. * Fix sort descending querying. * Dont limit, offset, order count queries. * Add generic set struct. * Convert Limit from uint64 to int. * Use sets instead of maps when possible. * Address some PR review comments. * Pass sets as pointers. * Address some of PR review feedback. * Fix gofmt issue. * Rename utxo association variables. * Address some PR review feedback. * Better error messages for invalid query params. * Simplify advanced query for associations by filtering out ALL associationIds when going to the db * Validate LastSeenAssociationID exists. (deso-protocol#433) * add range apply as faster way to iterate over elements in set * fix gofmt errors * get rid of ToOrderedSlice so we can make the hash set more space efficient * run gofmt * add return to inner func in DBGetPostAssociationsByAttributes * add RangeMap function * don't use pointers in set * rename to ForEach and Map * Query postgres with values instead of pointers. * Fix go-fmt. * remove map function from set Co-authored-by: mattfoley8 <[email protected]> Co-authored-by: Matt Foley <[email protected]> Co-authored-by: Lazy Nina <> * Dont pull deleted associations from the db. (deso-protocol#438) * Dont pull deleted associations from the db. * Remove whitespace. * Update comment. * Update comments more. * Ln/add map set func (deso-protocol#439) * Add map set function * add map set function * add error test for map set function * fix typo Co-authored-by: Lazy Nina <> * Dont pass ExtraData for delete association txns. * Revert "Dont pass ExtraData for delete association txns." This reverts commit 9dfbf3b. * validate association type and value does not contain null terminator (deso-protocol#443) * Validate Association types and values do not contain null terminator: * add test cases * Refactor validation of app public key * add function to check for existence of public key + pkid * Diamondhands/associations review (deso-protocol#442) * Improve snapshot and hypersync comments (deso-protocol#440) * Improve snapshot and hypersync comments * piotr's two cents Co-authored-by: Piotr Nojszewski <[email protected]> * Add associations txn type. * Add put and delete badger operations for associations. * Split into CREATE and DELETE txn types. * Add metadata validations. * Add connect create associations logic. * Add connect delete association txns. * Add disconnect logic. * Add db adapter. * Add badger getter queries. * Add flush logic. * Add postgres associations data types. * Add postgres flush operations. * Fix tabs. * Add postgres getter queries. * Add blockchain.go create txn funcs. * Add association tx index structs. * Add byte encoders. * Dont error if dont find association in pg queries. * Populate association tx index metadata. * Add funcs to decode associations from bytes. * Add create user association validation tests. * Add delete user association validation tests. * Refactor + consolidate association test helpers. * Add happy path test for creating + deleting user association. * Add post association tests. * Get tests working on postgres. * Add query funcs to find associations by attributes. * Add postgres api queries. * Add badger query for associations. * Test wildcard user association matching. * Add post association wildcard query helpers. * Add post association query api tests. * Make AssociationType case-insensitive. * Fix failing CI test. * Run tests twice. Once flushing. Once all in mempool. * Fix failing CI. * Add first failed test query. * Improve mempool association querying test coverage. * Improve test coverage moar. * Improve test coverage moar moar. * Touch-ups. * Move back inline comment to fix gofmt. * Run associations postgres tests in CI. * Fail retrieving associations if no query params are set. * Add AssociationTypePrefix and AssociationValuePrefix. * Return nil in get association by ID if association was deleted. * Dont include deleted associations in get by attributes query. * Rename indices. * Add AppUserPKID field. * Add tests for app user pkid querying. * Store ExtraData on AssociationEntries. * Rename AppUserPKID to AppPKID. * Add function to count matching association entries. * Fix gofmt issue. * Add tests for counting user associations. * Add count post associations tests. * Return new and deleted utxo association entries from helper. * Fix go fmt. * Add more association info to tx index. * Address some PR feedback. * Switch association type/value from strings to byte slices. * Fix failing postgres tests. * Move comparison of association types into helper func. * Add association type postgres indices. * Address some PR review feedback. * Add makefile helper to go-fmt code. * Add association encoder migrations. * Mf/add advanced querying for associations (deso-protocol#430) * Add advanced querying for associations. * Add tests for limit, offset, order user association queries. * Fix go-fmt issues. * Add tests for limit, order, offset queries for post associations. * Fix sort descending querying. * Dont limit, offset, order count queries. * Add generic set struct. * Convert Limit from uint64 to int. * Use sets instead of maps when possible. * Address some PR review comments. * Pass sets as pointers. * Address some of PR review feedback. * Fix gofmt issue. * Rename utxo association variables. * Address some PR review feedback. * Better error messages for invalid query params. * Simplify advanced query for associations by filtering out ALL associationIds when going to the db (deso-protocol#432) * Simplify advanced query for associations by filtering out ALL associationIds when going to the db * Validate LastSeenAssociationID exists. (deso-protocol#433) Co-authored-by: Matt Foley <[email protected]> Co-authored-by: Lazy Nina <[email protected]> * Mf/add associations derived key spending limits (deso-protocol#435) * Add association derived key spending limits. * Add validation for derived key spending limit during txn connect. * Fix failing test. * Start adding test for associations spending limits. * Update tests. * Fix go-fmt. * Simplify use of utxo view in association derived key test. * Dont reuse utxo view. * Add more tests. * Set spending limit count properly. * Add spending limit operation type ANY. * Add more block height guards. * Fix failing test with new encoding pattern. * add range apply as faster way to iterate over elements in set (deso-protocol#434) * Add advanced querying for associations. * Add tests for limit, offset, order user association queries. * Fix go-fmt issues. * Add tests for limit, order, offset queries for post associations. * Fix sort descending querying. * Dont limit, offset, order count queries. * Add generic set struct. * Convert Limit from uint64 to int. * Use sets instead of maps when possible. * Address some PR review comments. * Pass sets as pointers. * Address some of PR review feedback. * Fix gofmt issue. * Rename utxo association variables. * Address some PR review feedback. * Better error messages for invalid query params. * Simplify advanced query for associations by filtering out ALL associationIds when going to the db * Validate LastSeenAssociationID exists. (deso-protocol#433) * add range apply as faster way to iterate over elements in set * fix gofmt errors * get rid of ToOrderedSlice so we can make the hash set more space efficient * run gofmt * add return to inner func in DBGetPostAssociationsByAttributes * add RangeMap function * don't use pointers in set * rename to ForEach and Map * Query postgres with values instead of pointers. * Fix go-fmt. * remove map function from set Co-authored-by: mattfoley8 <[email protected]> Co-authored-by: Matt Foley <[email protected]> Co-authored-by: Lazy Nina <> * Dont pull deleted associations from the db. (deso-protocol#438) * Dont pull deleted associations from the db. * Remove whitespace. * Update comment. * Update comments more. * Ln/add map set func (deso-protocol#439) * Add map set function * add map set function * add error test for map set function * fix typo Co-authored-by: Lazy Nina <> * Dont pass ExtraData for delete association txns. * Revert "Dont pass ExtraData for delete association txns." This reverts commit 9dfbf3b. * Minor touchups * gofmt * add comments on db prefixes to specify value types * gofmt Co-authored-by: Piotr Nojszewski <[email protected]> Co-authored-by: mattfoley8 <[email protected]> Co-authored-by: Matt Foley <[email protected]> Co-authored-by: Lazy Nina <[email protected]> Co-authored-by: Lazy Nina <> Co-authored-by: Lazy Nina <[email protected]> Co-authored-by: diamondhands0 <[email protected]> Co-authored-by: Piotr Nojszewski <[email protected]>
- Loading branch information