diff options
| author | Your Name <you@example.com> | 2026-05-23 05:32:22 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-23 05:32:22 +0530 |
| commit | 5140a30be35aaf3574efce9193549f18524ce46e (patch) | |
| tree | c1146fc161fe787ccabd04558219b7591e207b61 /tests/unit/test_mcp_handler.c | |
| parent | fb8558cbf964fae5a840f8f948b89a0d42045802 (diff) | |
Phase 7: eliminate shims - consumer files use component headers directly
- Deleted standalone shims: session.c/h, cashu.c/h, mining_payment.c/h, firewall.c/h
- Updated captive_portal.c, tollgate_api.c, tollgate_main.c, mcp_handler.c,
cvm_server.c, sw_miner.c, stratum_client.c to include component headers
- Moved tollgate_ip4_canforward_filter() lwIP hook into tollgate_main.c
- Fixed all unit tests to use component API (test_cashu, test_session,
test_mining_payment, test_stratum_proxy, test_session_payment_method,
test_firewall_sandbox, test_mcp_handler)
- Removed deleted source files from Makefile targets
- All 21 unit tests pass, ESP-IDF build passes
Diffstat (limited to 'tests/unit/test_mcp_handler.c')
| -rw-r--r-- | tests/unit/test_mcp_handler.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/test_mcp_handler.c b/tests/unit/test_mcp_handler.c index 05e9e38..61d1a8b 100644 --- a/tests/unit/test_mcp_handler.c +++ b/tests/unit/test_mcp_handler.c | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | #include "test_framework.h" | 1 | #include "test_framework.h" |
| 2 | #include "mcp_handler.h" | 2 | #include "mcp_handler.h" |
| 3 | #include "config.h" | 3 | #include "config.h" |
| 4 | #include "session.h" | 4 | #include "tollgate_core_session.h" |
| 5 | #include "tollgate_core.h" | ||
| 5 | #include "nucula_wallet.h" | 6 | #include "nucula_wallet.h" |
| 6 | #include "cJSON.h" | 7 | #include "cJSON.h" |
| 7 | #include <string.h> | 8 | #include <string.h> |
| @@ -41,15 +42,15 @@ esp_err_t nucula_wallet_melt(const char *bolt11, uint64_t max_fee) { | |||
| 41 | return g_wallet_melt_rc; | 42 | return g_wallet_melt_rc; |
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | static session_t g_test_sessions[SESSION_MAX_CLIENTS]; | 45 | static tg_session_t g_test_sessions[TG_SESSION_MAX_CLIENTS]; |
| 45 | static int g_test_session_count = 0; | 46 | static int g_test_session_count = 0; |
| 46 | 47 | ||
| 47 | session_t *cvm_get_sessions_array(void) { | 48 | tg_session_t *tollgate_core_session_get_array(void) { |
| 48 | return g_test_sessions; | 49 | return g_test_sessions; |
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | int cvm_get_sessions_count(void) { | 52 | int tollgate_core_session_get_array_size(void) { |
| 52 | return SESSION_MAX_CLIENTS; | 53 | return TG_SESSION_MAX_CLIENTS; |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | static void test_mcp_parse_tool(void) | 56 | static void test_mcp_parse_tool(void) |