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>
25 lines
690 B
Python
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)
|