klaim: reward tak terukur ⊖ pernah jadi sukses-0 (V55/B17): _measure_reward retry reward_from_tx 4x dgn SETTLE_SECONDS=30 (tx baru mendarat belum terindeks Hyperion → None palsu) lalu fallback selisih saldo HANYA delta positif (after > before) — delta 0 ambigu (node balik saldo lama) → None → fee pending + alert KLAIM MENDARAT · REWARD TAK TERUKUR, ⊖ notif KLAIM REWARD SUKSES 0.0000 palsu (kasus 8 Agt: klaim 48c2066f reward 1683.3641 tapi app notif 0.0000, fee tak terkirim) ; reward 0 asli dibuktikan dari isi tx (Decimal 0) ; oracle B17-a delta-0 → pending, B17-b catch-up reward asli ; image claim rebuild + push
This commit is contained in:
1 parent
2f043c20bd
commit
ee4682da00
4 files changed
+73
-11
No files matched your search
+54
-2
@@ -184,14 +184,17 @@ def main():
|
||||
check('V34 fee akhirnya sent', row[5] == 'sent' and row[6] == 'txok')
|
||||
|
||||
# ————— V33: reward 0 → fee skipped; step lanjut ke jadwal —————
|
||||
# Reward 0 asli dibuktikan dari ISI TX (executed tanpa transfer bpay/vpay
|
||||
# → Decimal('0')); selisih saldo 0 TIDAK dianggap reward 0 (B17) — delta
|
||||
# 0 ambigu → jalur tak-terukur.
|
||||
fresh_db('zero')
|
||||
claim.fetch_producer_last_claim = lambda: (
|
||||
claim._utcnow() - timedelta(hours=25)
|
||||
).strftime('%Y-%m-%dT%H:%M:%S')
|
||||
balances = iter([Decimal('100.0000'), Decimal('100.0000')])
|
||||
dist.fetch_balance = lambda: next(balances)
|
||||
dist.fetch_balance = lambda: Decimal('100.0000') # ⊥ dipakai (tx prioritas)
|
||||
claim.build_claim_action = lambda: FakeSigned('txzero')
|
||||
dist.verify_txid = lambda txid: True
|
||||
claim.reward_from_tx = lambda txid: Decimal('0') # genuine zero
|
||||
check('V33 klaim reward 0 → claimed', claim.step() == 'claimed')
|
||||
row = last_claim_row()
|
||||
check('V33 fee 0 → skipped', row[4] == 0.0 and row[5] == 'skipped')
|
||||
@@ -200,6 +203,7 @@ def main():
|
||||
claim._utcnow() - timedelta(hours=20)
|
||||
).strftime('%Y-%m-%dT%H:%M:%S')
|
||||
check('V34 ⊥ fee pending → jadwal (sleep)', claim.step() == 'sleep')
|
||||
claim.reward_from_tx = lambda txid: None
|
||||
|
||||
# ————— V34: klaim timeout tapi mendarat (verify True) → diukur —————
|
||||
fresh_db('landed')
|
||||
@@ -359,6 +363,54 @@ def main():
|
||||
check('V54 reward terukur + tercatat',
|
||||
last_claim_row()[3] == 5.0 and last_claim_row()[2] == 'txR5b')
|
||||
|
||||
# ————— V55/B17: reward_from_tx None + delta 0 → TAK TERUKUR (⊥ sukses-0) —————
|
||||
# Delta saldo 0 (node belum up-date / saldo lama) ⊥ dianggap reward 0;
|
||||
# keduanya gagal mengukur → fee pending + alert KLAIM MENDARAT, ⊖ notif
|
||||
# sukses-0 palsu (kasus Telegram 2026-08-08: klaim mendarat, reward asli
|
||||
# 1683.3641, tapi app notif `KLAIM REWARD SUKSES 0.0000`).
|
||||
fresh_db('zerodelta')
|
||||
claim.fetch_producer_last_claim = lambda: (
|
||||
claim._utcnow() - timedelta(hours=25)
|
||||
).strftime('%Y-%m-%dT%H:%M:%S')
|
||||
claim.reward_from_tx = lambda txid: None # Hyperion belum indeks
|
||||
bal_seq = iter([Decimal('100.0000'), Decimal('100.0000'),
|
||||
Decimal('100.0000'), Decimal('100.0000')])
|
||||
dist.fetch_balance = lambda: next(bal_seq) # delta selalu 0
|
||||
claim.build_claim_action = lambda: FakeSigned('txB17')
|
||||
dist.verify_txid = lambda txid: True
|
||||
notifs = []
|
||||
_orig_nc2 = telegram.notify_claim
|
||||
_orig_ncu2 = telegram.notify_claim_unmeasured
|
||||
telegram.notify_claim_unmeasured = lambda t: notifs.append('unmeasured')
|
||||
telegram.notify_claim = lambda r, f, w: notifs.append('claimed')
|
||||
check('V55 delta 0 → claimed (baris dicatat, ⊖ sukses-0)',
|
||||
claim._try_claim_once() == 'claimed')
|
||||
row = last_claim_row()
|
||||
check('V55 fee pending utk cek manual (⊖ skipped)',
|
||||
row[4] == 0.0 and row[5] == 'pending')
|
||||
check('V55 alert cek manual, ⊖ notif sukses-0',
|
||||
'unmeasured' in notifs and 'claimed' not in notifs)
|
||||
telegram.notify_claim = _orig_nc2
|
||||
telegram.notify_claim_unmeasured = _orig_ncu2
|
||||
|
||||
# ————— V55/B17: reward_from_tx catch-up (None lalu berhasil) —————
|
||||
# Hyperion mengejar indeks tx → reward asli terbaca → fee tercatat
|
||||
# (jalur normal yang menyelamatkan klaim seperti 2026-08-09).
|
||||
fresh_db('catchup')
|
||||
claim.fetch_producer_last_claim = lambda: (
|
||||
claim._utcnow() - timedelta(hours=25)
|
||||
).strftime('%Y-%m-%dT%H:%M:%S')
|
||||
seq = iter([None, None, Decimal('1683.0126')])
|
||||
claim.reward_from_tx = lambda txid: next(seq)
|
||||
dist.fetch_balance = lambda: Decimal('100.0000') # ⊥ dipakai
|
||||
claim.build_claim_action = lambda: FakeSigned('txC')
|
||||
dist.verify_txid = lambda txid: True
|
||||
check('V55 catch-up reward → claimed', claim._try_claim_once() == 'claimed')
|
||||
row = last_claim_row()
|
||||
check('V55 reward asli 1683.0126 + fee 168.3012 pending',
|
||||
row[3] == 1683.0126 and row[4] == 168.3012
|
||||
and row[5] == 'pending' and row[2] == 'txC')
|
||||
|
||||
# ————— V45: reward dari isi tx (bpay+vpay) → prioritas —————
|
||||
fresh_db('txreward')
|
||||
claim.fetch_producer_last_claim = lambda: (
|
||||
|
||||
Reference in new issue
Block a user