Skip to content

feat(script): remove P2SH constructors, retain detection#70

Merged
sgbett merged 1 commit intomasterfrom
feature/54-remove-p2sh-constructors
Feb 12, 2026
Merged

feat(script): remove P2SH constructors, retain detection#70
sgbett merged 1 commit intomasterfrom
feature/54-remove-p2sh-constructors

Conversation

@sgbett
Copy link
Owner

@sgbett sgbett commented Feb 12, 2026

Summary

  • Remove Script.p2sh_lock and Script.p2sh_unlock constructors
  • Remove P2SH address encoding branch from #addresses
  • Remove MAINNET_P2SH_PREFIX / TESTNET_P2SH_PREFIX constants
  • Retain all read-only P2SH capabilities: p2sh?, script_hash, 'scripthash' type
  • Implements "recognise everything, construct only what's valid" principle for P2SH

Test plan

  • P2SH detection specs still pass (p2sh?, script_hash, 'scripthash' type)
  • P2SH address encoding now returns empty array (spec updated)
  • Constructor specs removed (4 specs)
  • Full suite: 920 examples, 0 failures
  • RuboCop clean

Closes #54

🤖 Generated with Claude Code

Remove p2sh_lock, p2sh_unlock constructors and P2SH address encoding
per the protocol philosophy principle: recognise everything, construct
only what is valid on BSV today. P2SH detection (p2sh?, script_hash,
'scripthash' type) is retained for parsing historical outputs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sgbett sgbett merged commit 2a9457c into master Feb 12, 2026
6 checks passed
@sgbett sgbett deleted the feature/54-remove-p2sh-constructors branch February 12, 2026 21:04
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

[Task 2] Script: Remove P2SH constructors, retain detection

1 participant