V40-V43: band umur vote (BARU/VALID/KADALUARSA, scan simpan semua umur) → REVOTE = VALID langsung (V42) → tag mint 1-hari + badge VOTE ULANG SEGERA (V43) ; klaim recovery jendela lewat + parse respons dict rows (B7/B8) ; backend mysql test_mariadb ; oracle test_dashboard/distribute/get_voters/mariadb ; images web/scan/dist/claim rebuild + push

This commit is contained in:
proitlab committed 2026-08-07 12:07:34 +07:00
1 parent af9a0291b9
commit 81ec6bdfe7
17 files changed
+914 -148

No files matched your search

+26 -7
View File
@@ -1,9 +1,10 @@
"""Uji verifikasi klaim reward BP (oracle §V32..V34).
`./venv/bin/python test_claim.py` harus exit 0. Memakai DB sementara + mock
jaringan/pyntelope — ⊥ klaim nyata. Verifikasi: jendela klaim (V32), math fee
(V33), siklus penuh klaim→fee, retry fee, resume, reward 0 → skipped, klaim
yang mendarat walau timeout (V34).
jaringan/pyntelope — ⊥ klaim nyata. Verifikasi: jendela klaim (V32), parse
respons `get_table_rows` bentuk asli `{rows:[...]}` + recovery window lewat,
math fee (V33), siklus penuh klaim→fee, retry fee, resume, reward 0 →
skipped, klaim yang mendarat walau timeout (V34).
"""
import os
@@ -82,14 +83,32 @@ def main():
check('V32 parse kosong → None', claim.parse_claim_time(None) is None)
check('V32 parse sampah → None', claim.parse_claim_time('x') is None)
# ————— V32: next_window = last_claim_time + 24 jam —————
# ————— V32: fetch_producer_last_claim — bentuk asli get_table_rows —————
claim._post_json = lambda url, payload: {
'rows': [{'last_claim_time': '2026-08-05T07:01:44.500'}],
'more': False, 'next_key': ''}
check('V32 parse respons asli {rows:[...]} → waktu',
claim.fetch_producer_last_claim() == '2026-08-05T07:01:44.500')
claim._post_json = lambda url, payload: {'rows': [], 'more': False,
'next_key': ''}
check('V32 rows kosong → None',
claim.fetch_producer_last_claim() is None)
claim._post_json = lambda url, payload: {}
check('V32 respons tak dikenal → None (⊥ crash)',
claim.fetch_producer_last_claim() is None)
# ————— V32: next_window = last + 24 jam; lewat → klaim segera —————
claim.fetch_producer_last_claim = lambda: '2026-08-05T07:01:44.500'
now = datetime(2026, 8, 6, 12, 0, 0)
check('V32 jendela = last + 24 jam',
claim.next_window(now) == datetime(2026, 8, 6, 7, 1, 44, 500000))
claim.next_window(datetime(2026, 8, 6, 5, 0, 0))
== datetime(2026, 8, 6, 7, 1, 44, 500000))
check('V32 window lewat (≥24 jam) → now (recovery, ⊥ deadlock)',
claim.next_window(datetime(2026, 8, 6, 12, 0, 0))
== datetime(2026, 8, 6, 12, 0, 0))
claim.fetch_producer_last_claim = lambda: None
check('V32 tanpa last → now (langsung coba)',
claim.next_window(now) == now)
claim.next_window(datetime(2026, 8, 6, 12, 0, 0))
== datetime(2026, 8, 6, 12, 0, 0))
# ————— V32/V33: siklus penuh — klaim → catat → fee terkirim —————
fresh_db('cycle')