feat(tips): stage 3 — attach-funding + funding-verification worker (money-in)

- attach_funding_to_tip: atomic guarded UPDATE (COALESCE + CASE), idempotent on
  same txid, 400 on a different txid; non-drafts land pending_confirmation so the
  verifier (not the caller) owns the ->pending transition.
- worker (src/tips/confirmation.rs): XMR/WOW confirmation counting via LWS;
  amount verification for BTC/LTC (Electrum full history, confirmed-only) +
  XMR/WOW (classify_funding_amount, separate-then-subtract net). Verified->pending,
  Short->funding_mismatch; Unfunded/Drained/LwsError never mutate status (outage-
  safe). Spawned behind FEATURE_TIPS on a 60s loop w/ catch_unwind guard.
- POST /tips/social/:id/attach-funding endpoint + openapi.
- 5 DB tests + 6 classify unit tests; build clean.
This commit is contained in:
jwinterm
2026-07-10 14:53:46 -04:00
parent f3d6be95b8
commit b63cac19e2
8 changed files with 1058 additions and 0 deletions
+2
View File
@@ -72,6 +72,7 @@ use utoipa::OpenApi;
crate::api::tips::get_sent_social_tips,
crate::api::tips::get_public_social_tip,
crate::api::tips::cancel_social_tip,
crate::api::tips::attach_funding,
),
components(schemas(
crate::api::health::HealthResponse,
@@ -168,6 +169,7 @@ use utoipa::OpenApi;
crate::api::tips::SocialTipsResponse,
crate::api::tips::PublicTipInfo,
crate::api::tips::CancelTipResponse,
crate::api::tips::AttachFundingRequest,
)),
tags(
(name = "system", description = "Service health and metadata."),