Skip to content

Add tests for PSBT security analysis tools#26

Closed
ThomsenDrake wants to merge 1 commit intoBortlesboat:mainfrom
ThomsenDrake:psbt-security-tests-v2
Closed

Add tests for PSBT security analysis tools#26
ThomsenDrake wants to merge 1 commit intoBortlesboat:mainfrom
ThomsenDrake:psbt-security-tests-v2

Conversation

@ThomsenDrake
Copy link
Copy Markdown
Contributor

Summary

Add TestPSBTSecurity test class with 17 tests covering:

  • Error handling: invalid hex, wrong magic, empty input, raw Bitcoin tx
  • Tool wrappers: analyze_psbt_security and explain_inscription_listing_security (JSON and str returns)
  • Helper functions: _psbt_read_varint roundtrip, _psbt_is_2of2_multisig (valid/invalid/wrong length)
  • BIP 174 PSBT parsing: magic bytes, empty map, sighash type constants

Issue Reference

Fixes #8: Add tests for PSBT security analysis tool (safety-critical, handles user funds)

Testing

All 17 tests pass locally. This PR also verifies the 141 existing tests continue to pass.

PR Type

  • Tests

Add TestPSBTSecurity test class with 17 tests covering:
- Error handling: invalid hex, wrong magic, empty input, raw Bitcoin tx
- Tool wrappers: analyze_psbt_security and explain_inscription_listing_security JSON/str returns
- Helper functions: _psbt_read_varint roundtrip, _psbt_is_2of2_multisig (valid/invalid/wrong length)
- BIP 174 PSBT parsing: magic bytes, empty map, sighash type constants

Issue Bortlesboat#8: Add tests for PSBT security analysis tool (safety-critical, handles user funds)
@Bortlesboat
Copy link
Copy Markdown
Owner

Closing this as superseded by #31, which consolidates the open backlog work into one maintainer sweep. Thank you for the contribution and the concrete issue coverage here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for PSBT security analysis tool

2 participants