skills update; USER ACCOUNT system! Alpha!

This commit is contained in:
D.Popov
2026-07-03 19:22:39 +03:00
parent 5179806a67
commit 7caf12980a
14 changed files with 1260 additions and 11 deletions

View File

@@ -103,6 +103,22 @@ def test_restart_persistence(tmp_path):
assert reloaded.snapshot()["protocol_cut"] == pytest.approx(0.02 * 0.10)
def test_tracker_enables_billing_with_default_db_when_requested(tmp_path, monkeypatch):
from meshnet_tracker.billing import DEFAULT_BILLING_DB_PATH
monkeypatch.chdir(tmp_path)
tracker = TrackerServer(enable_billing=True)
port = tracker.start()
try:
summary = json.loads(
urllib.request.urlopen(f"http://127.0.0.1:{port}/v1/billing/summary").read()
)
assert "protocol_cut" in summary
finally:
tracker.stop()
assert (tmp_path / DEFAULT_BILLING_DB_PATH).exists()
def test_event_replication_converges_and_dedupes():
leader = BillingLedger(starting_credit=1.0, default_price_per_1k=0.02)
follower = BillingLedger(starting_credit=1.0, default_price_per_1k=0.02)