Skip to content

feat(script): add data push and stack manipulation opcodes#64

Merged
sgbett merged 1 commit intomasterfrom
feature/58-data-push-stack-ops
Feb 12, 2026
Merged

feat(script): add data push and stack manipulation opcodes#64
sgbett merged 1 commit intomasterfrom
feature/58-data-push-stack-ops

Conversation

@sgbett
Copy link
Owner

@sgbett sgbett commented Feb 12, 2026

Summary

  • Implement interpreter execution loop with two-script sequential execution, alt stack clearing between scripts, and final stack truthiness check
  • Add all data push operations: OP_0, OP_1..16, OP_1NEGATE, PUSHDATA1/2/4
  • Add 19 stack manipulation opcodes: DUP, 2DUP, 3DUP, DROP, 2DROP, SWAP, 2SWAP, ROT, 2ROT, OVER, 2OVER, NIP, TUCK, PICK, ROLL, DEPTH, IFDUP, TOALTSTACK, FROMALTSTACK

Closes #58

Test plan

  • 56 new examples across 3 spec files (data_push, stack_ops, interpreter execution loop)
  • RuboCop clean (0 offences across all 103 files)
  • Full suite passes (768 examples, 0 failures)

🤖 Generated with Claude Code

Implement interpreter execution loop with two-script sequential
execution and opcode dispatch. Add all data push operations (OP_0,
OP_1..16, OP_1NEGATE, PUSHDATA1/2/4) and 19 stack manipulation
opcodes (DUP, DROP, SWAP, ROT, PICK, ROLL, OVER, NIP, TUCK, etc.).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 85.12397% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/bsv/script/interpreter/interpreter.rb 70.00% 18 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sgbett sgbett merged commit f1804b7 into master Feb 12, 2026
7 checks passed
@sgbett sgbett deleted the feature/58-data-push-stack-ops branch February 12, 2026 16:33
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] Data push + stack manipulation opcodes

1 participant