test(dkg): add comprehensive unit tests for DkgOutput type#71
Open
refcell wants to merge 1 commit into
Open
Conversation
- Add 15 tests covering save/load roundtrip, exists checks, error cases - Tests verify file persistence, JSON validation, hex encoding/decoding - Tests edge cases: missing files, invalid JSON, invalid hex, empty keys - Add tempfile dev-dependency for temporary directory testing
faddat
added a commit
that referenced
this pull request
May 30, 2026
* Implement mempool subscriptions * Emit TxEvicted from TransactionPool::remove() Address review feedback on PR #71: add a production emission point for MempoolEvent::TxEvicted when transactions are explicitly removed from the pool. - Introduce remove_with_reason() that emits TxEvicted with a caller- supplied reason string, then delegate remove() to it with reason "removed" - Add tests verifying TxEvicted is broadcast on remove() and remove_with_reason() - Confirm try_recv() is correct for futures-channel 0.3.32 (try_next() is deprecated in this version; try_recv() returns Result<T, _>) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add changelog for PR #71 pending/mempool subscriptions Detailed changelog documenting the new eth_subscribe and kora_subscribe WebSocket subscription endpoints, MempoolEvent lifecycle types, and the broadcast channel architecture wiring RPC, txpool, and reporters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(reporters): include block timestamp in mempool test fixture Agent-Logs-Url: https://github.com/Nunchi-trade/daeji/sessions/31652c6a-c886-4b8f-8717-beda8779b714 Co-authored-by: faddat <7142025+faddat@users.noreply.github.com> --------- Co-authored-by: will pankiewicz <will@macbook.local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: faddat <7142025+faddat@users.noreply.github.com>
faddat
pushed a commit
that referenced
this pull request
May 30, 2026
Resolve merge conflicts from main branch (PRs #69-#78) while preserving PR #72's txpool eviction, cleanup, and txpool_* RPC namespace features. Conflict resolutions: - server.rs: Keep both txpool field/methods (PR #72) and rate limiting, subscriptions, connection limits (PRs #71, #74). Merged imports and Debug impls to include all fields. - runner.rs: Keep txpool cleanup spawning (PR #72) alongside configurable params, archive recovery, strategy threading, and timestamp support from main. Restored Clock import needed for sleep in txpool cleanup. Removed unused Sequential import. - txpool/ordering.rs: Keep PR #72's gas-price-based replacement logic for queued transactions, updated to use main's next_pending_nonce() method for nonce gap detection. - txpool/pool.rs: Keep PR #72's ordered_tx_id() for build exclusions with main's saturating_add for overflow safety. Fixed test that used TxId(hash) directly (main's pattern) to use ordered_tx_id() (PR #72's pattern), and differentiated gas prices for cross-sender test data to avoid TxId collisions from identical envelope encodings. - txpool.rs: Fixed v field type from U64 to U256 to match main's updated RpcTransaction type definition. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
faddat
pushed a commit
that referenced
this pull request
May 30, 2026
Resolve conflict in runner.rs: keep pending_tx_broadcast and mempool_broadcast from PR #71 alongside the genesis-seeded block_index from this branch. Apply fmt fixes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
faddat
pushed a commit
that referenced
this pull request
May 30, 2026
Resolve conflicts between PR #71 (pending_tx_broadcast/mempool_broadcast subscriptions) and PR #72 (txpool eviction + RPC). Both feature sets are retained: server structs carry txpool, pending_tx_broadcast, and mempool_broadcast fields; the transaction pool gains event broadcasting alongside eviction logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DkgOutputtype in thekora-dkgcratetempfiledev-dependency for temporary directory testingTest Coverage
test_dkg_output_save_and_load_roundtriptest_dkg_output_exists_*exists()with various file statestest_dkg_output_load_*test_dkg_output_clone/debugtest_serde_json_error_conversionFrom<serde_json::Error>impltest_dkg_output_save_creates_pretty_json