test(bridge_api): add 67 unit tests for Bridge API [T10]#6326
Open
waefrebeorn wants to merge 45 commits into
Open
test(bridge_api): add 67 unit tests for Bridge API [T10]#6326waefrebeorn wants to merge 45 commits into
waefrebeorn wants to merge 45 commits into
Conversation
Adds max_length parameter to _clean_string_field and caps all user input fields in POST route handlers: - /lock: sender_wallet(128), target_wallet(128), tx_hash(128), receipt_signature(256) - /confirm: proof_ref(256), notes(1024) - /release: release_tx(128), notes(1024) Prevents storage of arbitrarily large strings in bridge_ledger DB.
…s + Row M error handling + Row T test gaps + Row E infrastructure
…debase scan - Vaulted: A1-A14, B1-B5, C1-C16, D1, A15-A41, S1-S19, M1-M9 (47 PRs) - Added Row F (Form-not-function): 85 stub/form gaps from codebase scan - Added Row T (Test coverage): 85 untested files mapped - Added Rows M, S, D, E, H for remaining 72 cells - README: added bounty badge + Bounty Bug Hunt section - Total target: 400 cells (103 vaulted + 297 active)
F6: bare 'except Exception: pass' in inline query miners handler F7: bare 'except Exception: pass' in inline query epoch handler Both now log a warning with exc_info=True so silent failures are observable without changing the fallthrough behaviour. Also: - Mark F3-F5 as FALSE POSITIVES (explorer-api pass is intentional, WalletCheckError exception class is standard Python) - Update board: 107/400 cells vaulted, 49 PRs, 290 fresh gaps
Covers 997-line module: - Enums (BridgeDirection, BridgeStatus, LockType, LockStatus) - 4 tests - Dataclasses (BridgeTransferRequest, ValidationResult) - 2 tests - validate_bridge_request (full pipeline: valid, missing, direction, chain, address, amount, memo, bridge_type) - 15 tests - validate_chain_address_format (rustchain, solana, ergo, base) - 12 tests - generate_bridge_tx_hash (deterministic, 32-char) - 3 tests - check_miner_balance (empty, sufficient, insufficient, pending debits) - 4 tests - create_bridge_transfer (create, amount conversion, tx_hash, reject) - 4 tests - get_bridge_transfer_by_hash (found, not found) - 2 tests - list_bridge_transfers (empty, list, direction filter) - 3 tests - void_bridge_transfer (void, nonexistent) - 2 tests - update_external_confirmation - 1 test - _parse_non_negative_int_arg - 5 tests - init_bridge_schema - 2 tests - Fallback module defaults - 5 tests 67 tests, all pass. Coverage: 0% to covered. RTC: rtc17c0d21f04f6f65c1a85c0aeb5d4a305d57531096
waefrebeorn
added a commit
to waefrebeorn/Rustchain
that referenced
this pull request
May 25, 2026
…approvals (113/400 cells, 55 PRs, 19 jaxint-approved)
jaxint
reviewed
May 25, 2026
Contributor
jaxint
left a comment
There was a problem hiding this comment.
Great work on this PR! The code looks clean and well-structured. Thanks for contributing to RustChain! 🦀
jaxint
approved these changes
May 25, 2026
Contributor
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Great work on this PR. 🚀
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.
T10 — bridge_api.py test coverage (HIGH criticality)
67 unit tests for
node/bridge_api.py(997 lines) — was 0% coverage, now covered.Test categories:
All 67 tests pass ✅
RTC Wallet: rtc17c0d21f04f6f65c1a85c0aeb5d4a305d57531096