Files
davideandClaude Sonnet 5.5 f1e6ad29ab Remove dead code left by the other coins
GENESIS_ACTIVATION and is_unspendable_genesis (always legacy for Palladium),
script matching helpers and ScriptPubKey.TO_*_OPS, Deserializer._read_be_uint16,
the unused Coin.CHUNK_SIZE and ENCODE_CHECK, the name-index fallback of the
local RPC 'query' command, and stale comments about other coins.

Block processing and the db format are unchanged: a fresh sync gives the same
history as before. STATIC_BLOCK_HEADERS and the dynamic header code in db.py
are left, being generic functionality that would need wider changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 16:25:58 +02:00

25 lines
690 B
Python

import pytest
from electrumx.lib.script import OpCodes, is_unspendable_legacy
@pytest.mark.parametrize("script", (
bytes([OpCodes.OP_RETURN]),
bytes([OpCodes.OP_RETURN]) + bytes([2, 28, 50]),
bytes([OpCodes.OP_0, OpCodes.OP_RETURN]),
bytes([OpCodes.OP_0, OpCodes.OP_RETURN]) + bytes([2, 28, 50]),
))
def test_op_return(script):
assert is_unspendable_legacy(script)
@pytest.mark.parametrize("script", (
bytes([]),
bytes([OpCodes.OP_1, OpCodes.OP_RETURN]) + bytes([2, 28, 50]),
bytes([OpCodes.OP_0]),
bytes([OpCodes.OP_0, OpCodes.OP_1]),
bytes([OpCodes.OP_HASH160]),
))
def test_not_op_return(script):
assert not is_unspendable_legacy(script)