Files
plm-lottery/tests/unit/test_scripthash.py
T
davideandClaude Sonnet 5 df72367f02 Implement full MVP: auth, HD wallet, Electrum client, deposits, bets, round/draw engine, payout, withdrawals, RBF, admin+audit
All 10 build-order stages complete and unit-tested (49 tests). Verified live on
mainnet: registration/address derivation, deposit crediting, a real 10 PLM bet
(broadcast + confirmed + change credited). A full round close->draw->payout
cycle was triggered live and was in progress at commit time. Withdrawal and RBF
bump are unit-tested but not yet exercised against a live broadcast. Known gaps
(scheduler doesn't resume mid-flight rounds after restart, payout has no retry,
no deployment setup, etc.) are documented in CLAUDE.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-20 23:52:20 +02:00

10 lines
531 B
Python

from app.electrum.scripthash import address_to_scripthash
def test_matches_known_mainnet_vector():
# Ground truth: scriptPubKey "0014a195473740aea3b4df1690fbdcb51243fe4e7a20" of a real
# confirmed mainnet output to this address (txid 1ebd0219...b0d48a, vout 1), cross-checked
# against the Electrum server's own listunspent for this scripthash.
address = "plm1q5x25wd6q463mfhckjraaedgjg0lyu73qfcj43n"
assert address_to_scripthash(address) == "5b7744e34b1d6ee3ae6eef7e1ce82aa4c28ff13f10d4aa905640c722c9249111"