B5: real deposits on the ORM, Electrum scan with quorum and merkle proof, configurable threshold (DEP-20..23, ELC-31)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 5.5 committed 2026-11-16 16:09:36 +01:00
1 parent f1d09075a1
commit 2acd4ccd1c
21 files changed
+1223 -49

No files matched your search

+24 -1
View File
@@ -5,7 +5,7 @@ from django.contrib import admin
from django.db import transaction
from . import audit
from .models import AuditEntry, ChainTransaction, Movement, Participation, Report, Round
from .models import AuditEntry, ChainTransaction, LotteryConfig, Movement, Participation, Report, Round
class ReadOnlyAdmin(admin.ModelAdmin):
@@ -75,3 +75,26 @@ class ReportAdmin(admin.ModelAdmin):
obj.save(update_fields=["status", "status_changed_at"])
audit.record("report_status_changed", actor=request.user, subject_type="report", subject_id=obj.pk,
payload={"from": before, "to": obj.status})
@admin.register(LotteryConfig)
class LotteryConfigAdmin(admin.ModelAdmin):
"""The operational parameters (DAT-77). The three pause switches are not here: they go through the console's
commands, which ask for a reason (WEB-43). A change is audited with what changed."""
fields = ("fee_address", "bet_amount_sats", "round_duration_seconds", "round_cooldown_seconds",
"draw_confirmations", "deposit_confirmations", "max_round_pool_sats")
def has_add_permission(self, request):
return False
def has_delete_permission(self, request, obj=None):
return False
def save_model(self, request, obj, form, change):
changes = {name: [form.initial.get(name), getattr(obj, name)] for name in form.changed_data}
with transaction.atomic():
super().save_model(request, obj, form, change)
if changes:
audit.record("config_changed", actor=request.user, subject_type="config", subject_id=obj.pk,
payload={"changed": changes})