Commit Graph

6 Commits

Author SHA1 Message Date
idky137 9b91d4bc0e
change(tests): Remove Matches on Network From Tests (#8295)
* added functions for fetching block vectors

* inserted new network methods for vector fetching into zebra-chain

* changed tag back to test/feature=branch

* changed tag back to test/feature=branch

* changed tag back to test/feature=branch

* changed feature tag to proptest-impl, started implementing in zebra-consensus tests

* adding methods to zebra-consensus, lifetime error in src/transaction/tests.rs, needs refactoring

* finished adding methods to zebra-consensus

* finished adding new methods to zebrad

* added new methods to zebra-rpc and zebra-scan

* finished removing statements matching on Network from tests

* updated new error message

* changed get_block_bytes() and get_block_sapling_roots_bytes to return option and removed serialization error types as per requested changes in PR review

* removed match statements from zebra_chain::transaction::arbitrary::test_transactions() and new zebra-grpc tests

* moved zebra-chain::test_utils to zebra-chain::test

* removed get_ prefix from getter methods

* renamed zebra-chain::test to zebra-chain::tests

* renamed zebra-chain::test to zebra-chain::tests

* fixed clippy warnings

* changed block_map to return clone
2024-03-05 09:12:25 -05:00
Arya 80827f5294
add(scan): Implement `DeleteKeys` `ScanService` request (#8217)
* handle RemoveKeys command in ScanTask

* implements DeleteKeys request

* uses spawn_blocking and updates comments

* removes spawn_init fn

* adds test for new Storage method

* adds fake_sapling_results helper function

* adds test for scan service DeleteKeys request

* adds TODO for unwrap_or_clone

* checks the keys sent to the scan task for removal

* moves message processing to its own function

* adds a timeout for the scanner task response

* hide mock() methods behind cfg(test) or feature

* adds MAX_REQUEST_KEYS constant

* updates test to insert and delete results for a second key

* Update zebra-scan/src/init.rs

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>

* test that the expected number of results are in the db

* fix unused import lint

* fixes unused imports

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2024-01-31 19:34:24 +00:00
teor a14cb40c1f
test: Add progress markers to the snapshot tests (#8106)
* Add progress tracking markers to snapshot tests

* Simplify sapling_keys_and_last_scanned_heights()
2023-12-14 21:32:09 +00:00
Marek 22852bc81d
change(state): Allow opening the database in a read-only mode (#8079)
* Allow opening the database read-only mode

* Update zebra-scan/src/storage/db.rs

Co-authored-by: teor <teor@riseup.net>

* Refactor skipping database upgrades

* Fix errors caused by the merge

* Add new argument in new_test_storage()

* Simplify test storage code

* Fix importing the `new_test_storate` fn

---------

Co-authored-by: teor <teor@riseup.net>
2023-12-13 21:54:00 +00:00
teor 9ace6f8a4e
test(scan): Add typed database format snapshots to the scanner (#8083)
* Refactor test data into functions

* Add a typed snapshot test for scanner storage

* Use standard hex serialization with SaplingScannedResult

* Simplify transaction::Hash hex serialization

* Sort HashMaps before snapshotting

* Add typed snapshot data
2023-12-12 22:34:59 +00:00
teor 3318eaaa22
test(scan): Add raw database format snapshots to the scanner (#8075)
* Make some scanner storage methods more flexible

* Move tests to a submodule and expose test functions and constants

* Make scanner functions clearer and easier to use

* Simplify state snapshot test code

* Add raw data snapshot tests for the scanner

* Add snapshots

* Fix import path

* Fix import conditional compilation

* fix imports

* fix imports 2

* Put read and write db exports together

* Remove confusing IntoDisk/FromDisk impl

* Fix an incorrect unused method that could panic

* Delete a test that is no longer valid

---------

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2023-12-12 07:45:12 +00:00