From 78dd599277b8e8b2ddc39a4ae710ec91d737272e Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 17 May 2026 04:21:39 +0530 Subject: Phase 4: TollGate client detection + auto-payment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New tollgate_client.c/h: detect upstream TollGate (kind=10021), auto-pay via nucula wallet, session monitoring with 20% renewal - State machine: IDLE→DETECTING→NEEDS_PAY→PAYING→PAID→RENEWING - Blocking: upstream payment before local services start - Synchronous wallet init (was async task) - Client config: enabled, steps_to_buy, renewal_threshold_pct - Updated PLAN.md with Phases 4-7 (client, payout, bytes, CVM) - Updated CHECKLIST.md with all new phase items - 30 new unit tests (all passing), 116 total --- tests/unit/stubs/esp_err.h | 1 + tests/unit/stubs/nucula_wallet.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/unit/stubs/nucula_wallet.h (limited to 'tests/unit/stubs') diff --git a/tests/unit/stubs/esp_err.h b/tests/unit/stubs/esp_err.h index 9bedb72..2a8e216 100644 --- a/tests/unit/stubs/esp_err.h +++ b/tests/unit/stubs/esp_err.h @@ -12,6 +12,7 @@ typedef int esp_err_t; #define ESP_ERR_INVALID_ARG 0x102 #define ESP_ERR_NO_MEM 0x101 #define ESP_ERR_NOT_FOUND 0x104 +#define ESP_ERR_INVALID_STATE 0x103 static inline const char *esp_err_to_name(esp_err_t err) { (void)err; return "ESP_OK"; } diff --git a/tests/unit/stubs/nucula_wallet.h b/tests/unit/stubs/nucula_wallet.h new file mode 100644 index 0000000..260ec35 --- /dev/null +++ b/tests/unit/stubs/nucula_wallet.h @@ -0,0 +1,17 @@ +#ifndef STUBS_NUCULA_WALLET_H +#define STUBS_NUCULA_WALLET_H + +#include "esp_err.h" +#include +#include + +esp_err_t nucula_wallet_init(const char *mint_url); +esp_err_t nucula_wallet_receive(const char *token_str); +esp_err_t nucula_wallet_send(uint64_t amount_sat, char *token_out, size_t token_out_size); +uint64_t nucula_wallet_balance(void); +int nucula_wallet_proof_count(void); +char *nucula_wallet_proofs_json(void); +esp_err_t nucula_wallet_swap_all(void); +void nucula_wallet_print_status(void); + +#endif -- cgit v1.2.3