From eeba74a4a1c011e85e33dea4252b381e35a64ea4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 13:21:25 +0530 Subject: feat: multi-mint wallet with health tracking, WPA auto-detect, display gating Squash merge of feature/multi-mint-support (21 commits): Multi-mint wallet: - Accept payments from 4 mints: minibits, coinos, 21mint, lnvoltz - Periodic health probing (300s interval, 3 recovery threshold) - Multi-wallet init with nucula_wallet_init_multi() - /mints and /wallet API endpoints WPA auto-detect: - wifi_auth_mode config field (default WPA2, supports WPA3) - Runtime mapping to wifi_auth_mode_t in STA config Display gating: - display_enabled config field (default true) - Guards display_init/display_update per-board Bug fixes: - 3s delay before service start prevents lwip mem_free assertion - Real npub in discovery (identity_get()->npub_hex) - Health probe interval 300s (production value) - Duplicate services_start_task call removed - UTF-8 arrow replaced with ASCII in log message Tests: 61+14 unit tests passing, firmware builds clean --- tests/unit/stubs/freertos/FreeRTOS.h | 2 +- tests/unit/stubs/freertos/semphr.h | 7 ++++++ tests/unit/stubs/mint_health.h | 44 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 tests/unit/stubs/freertos/semphr.h create mode 100644 tests/unit/stubs/mint_health.h (limited to 'tests/unit/stubs') diff --git a/tests/unit/stubs/freertos/FreeRTOS.h b/tests/unit/stubs/freertos/FreeRTOS.h index 41426c8..2d2b967 100644 --- a/tests/unit/stubs/freertos/FreeRTOS.h +++ b/tests/unit/stubs/freertos/FreeRTOS.h @@ -7,7 +7,7 @@ static inline uint32_t xTaskGetTickCount(void) { return 0; } static inline void vTaskDelay(uint32_t ticks) { (void)ticks; } #define pdMS_TO_TICKS(ms) ((ms) / 10) #define portTICK_PERIOD_MS 10 -#define configTICK_RATE_HZ 100 #define portMAX_DELAY 0xFFFFFFFF +#define pdTRUE 1 #endif diff --git a/tests/unit/stubs/freertos/semphr.h b/tests/unit/stubs/freertos/semphr.h new file mode 100644 index 0000000..0389b11 --- /dev/null +++ b/tests/unit/stubs/freertos/semphr.h @@ -0,0 +1,7 @@ +#ifndef STUBS_FREERTOS_SEMPHR_H +#define STUBS_FREERTOS_SEMPHR_H + +#include "FreeRTOS.h" +#include "task.h" + +#endif diff --git a/tests/unit/stubs/mint_health.h b/tests/unit/stubs/mint_health.h new file mode 100644 index 0000000..7248042 --- /dev/null +++ b/tests/unit/stubs/mint_health.h @@ -0,0 +1,44 @@ +#ifndef MINT_HEALTH_H +#define MINT_HEALTH_H + +#include +#include + +#define MINT_HEALTH_MAX 8 +#define MINT_HEALTH_PROBE_INTERVAL_S 300 +#define MINT_HEALTH_PROBE_TIMEOUT_MS 15000 +#define MINT_HEALTH_RECOVERY_THRESHOLD 3 + +typedef struct { + char url[256]; + bool reachable; + uint8_t consecutive_successes; + int64_t last_probe_ms; + int last_http_status; +} mint_status_t; + +typedef void (*mint_health_changed_cb)(void); + +static inline bool mint_health_is_reachable(const char *url) { + (void)url; + return true; +} + +static inline void mint_health_mark_unreachable(const char *url) { + (void)url; +} + +static inline esp_err_t mint_health_init(const char urls[][256], int count) { + (void)urls; (void)count; return 0; +} + +static inline void mint_health_start(void) {} +static inline void mint_health_stop(void) {} +static inline const mint_status_t *mint_health_get_all(int *out_count) { + *out_count = 0; return NULL; +} +static inline void mint_health_register_callback(mint_health_changed_cb cb) { + (void)cb; +} + +#endif -- cgit v1.2.3