Skip to content

Fix duplicate keys in CODE_OPS dictionary #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JAGADISHSUNILPEDNEKAR
Copy link
Contributor

Issue

The script.py file contained duplicate keys in the CODE_OPS dictionary:

  • b"\xb1" had mappings to both "OP_NOP2" and "OP_CHECKLOCKTIMEVERIFY"
  • b"\xb2" had mappings to both "OP_NOP3" and "OP_CHECKSEQUENCEVERIFY"

This is problematic because Python dictionaries only keep the last value for each duplicate key, which could lead to confusion and potential bugs.

Changes

  • Removed the duplicate keys in the CODE_OPS dictionary
  • Kept the more descriptive operation names (CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY)
  • Added comments to clarify that these opcodes are aliases

Testing

All tests pass with both unittest and pytest.

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.

1 participant