Commit eaaf4ad
authored
feat(distributed-storage): add ChallengeStore, SQL-like queries, and comprehensive tests (#3)
* test: add comprehensive SudoAction tests
Add tests for:
- Challenge management (AddChallenge, UpdateChallenge, RemoveChallenge)
- Emergency controls (EmergencyPause, Resume)
- Signature verification for sudo operations
- ChallengeContainerConfig validation
- All SudoAction variants signing/serialization
* feat(distributed-storage): add ChallengeStore for per-challenge namespaced storage
- Create challenge_store.rs with ChallengeStore struct wrapping DistributedStore
- Implement namespace isolation via challenge_id prefixing
- Add merkle proof generation for all store/retrieve operations
- Include MerkleProof, MerkleNode types for verifiable data inclusion
- Add ChallengeStorage async trait for abstraction
- Add ChallengeStoreRegistry for managing multiple challenge stores
- Implement state root computation via compute_state_root()
- Add comprehensive tests for all operations
* feat(bittensor-integration): add MockMetagraph for testing
- Add mock.rs module with MockMetagraphBuilder and MockNeuronBuilder
- Provide helpers: hotkey_from_seed, create_validators, create_test_metagraph
- Add test-utils feature for exposing mocks to other crates
- Add comprehensive tests for mock functionality and validator sync logic
* feat(distributed-storage): add SQL-like query capabilities with block indexing
- Add query.rs with QueryBuilder, QueryFilter, QueryResult, QueryCursor types
- Add block-indexed secondary storage for efficient range queries
- Add DistributedStore trait methods: list_before_block, list_after_block,
list_range, count_by_namespace, query, put_with_block
- Implement all query methods for LocalStorage and DhtStorage
- Add comprehensive tests for all new functionality
- Support pagination via cursors and fluent query building
* test(challenge-sdk): add comprehensive ServerChallenge async tests
* test: add comprehensive blockchain state verification tests
Implements 28 tests for:
- Bittensor block linking (5 tests)
- Merkle proof computation and verification (8 tests)
- State hash integrity and verification (7 tests)
- Integration tests including full lifecycle (8 tests)1 parent 7a9ecec commit eaaf4ad
File tree
16 files changed
+6222
-3
lines changed- crates
- bittensor-integration
- src
- challenge-sdk/src
- distributed-storage
- src
- tests
16 files changed
+6222
-3
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
0 commit comments