diff options
| author | Your Name <you@example.com> | 2026-05-23 06:24:33 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-23 06:24:33 +0530 |
| commit | 0642900ae44d84cfe24abe6911dbed4cd31ab8ad (patch) | |
| tree | 01f960d54819133fe185ffe8d559bca9bdcf6bd9 /tests/unit | |
| parent | 57e363fd30ef7715ac1dfb1484b8375e06160e1c (diff) | |
Phase 8a-8b: extract beacon_price and market into component
- tollgate_core_beacon.c/h: pure logic (hash_mint, hash_npub, build_ie)
with platform-agnostic tollgate_beacon_config_t input struct
- tollgate_core_market.c/h: market table logic (parse_ie, find_cheapest,
update_ssid) with platform callbacks for time
- main/beacon_price.c: thin shim delegates to component, WiFi IE start/stop
- main/market.h: typedef aliases to component types
- All 21 unit tests pass, ESP-IDF build passes
- Hardware smoke test: 5/6 pass (AP, portal, grant/revoke, firewall)
- Market scanner discovers other TollGates via vendor IEs on hardware
Diffstat (limited to 'tests/unit')
| -rw-r--r-- | tests/unit/Makefile | 12 | ||||
| -rwxr-xr-x | tests/unit/test_beacon_price | bin | 35592 -> 37680 bytes | |||
| -rwxr-xr-x | tests/unit/test_market | bin | 49360 -> 58064 bytes |
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit/Makefile b/tests/unit/Makefile index 3890243..9347516 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile | |||
| @@ -69,8 +69,8 @@ TG_CORE_OBJS_CFLAGS := -include stubs/mint_health.h -include stubs/esp_netif.h - | |||
| 69 | test_session: test_session.c $(TG_CORE_SRC)/tollgate_core_cashu.c $(TG_CORE_SRC)/tollgate_core_session.c $(TG_CORE_SRC)/tollgate_core_firewall.c $(TG_CORE_SRC)/tollgate_core.c $(TG_CORE_SRC)/tollgate_core_mining.c $(TG_CORE_SRC)/tollgate_core_dns.c $(TG_CORE_SRC)/tollgate_core_stratum_proxy.c | 69 | test_session: test_session.c $(TG_CORE_SRC)/tollgate_core_cashu.c $(TG_CORE_SRC)/tollgate_core_session.c $(TG_CORE_SRC)/tollgate_core_firewall.c $(TG_CORE_SRC)/tollgate_core.c $(TG_CORE_SRC)/tollgate_core_mining.c $(TG_CORE_SRC)/tollgate_core_dns.c $(TG_CORE_SRC)/tollgate_core_stratum_proxy.c |
| 70 | $(CC) $(CFLAGS) $(TG_CORE_OBJS_CFLAGS) $^ -o $@ $(LDFLAGS) | 70 | $(CC) $(CFLAGS) $(TG_CORE_OBJS_CFLAGS) $^ -o $@ $(LDFLAGS) |
| 71 | 71 | ||
| 72 | test_tollgate_client: test_tollgate_client.c $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c | 72 | test_tollgate_client: test_tollgate_client.c $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c $(TG_CORE_SRC)/tollgate_core_beacon.c $(TG_CORE_SRC)/tollgate_core_market.c |
| 73 | $(CC) $(CFLAGS) -I $(REPO_ROOT)/main $< $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c -o $@ $(LDFLAGS) | 73 | $(CC) $(CFLAGS) -I $(REPO_ROOT)/main $< $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c $(TG_CORE_SRC)/tollgate_core_beacon.c $(TG_CORE_SRC)/tollgate_core_market.c -o $@ $(LDFLAGS) |
| 74 | 74 | ||
| 75 | test_lnurl_pay: test_lnurl_pay.c | 75 | test_lnurl_pay: test_lnurl_pay.c |
| 76 | $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) | 76 | $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) |
| @@ -90,11 +90,11 @@ test_cvm_server: test_cvm_server.c | |||
| 90 | test_mint_health: test_mint_health.c $(REPO_ROOT)/main/mint_health.c | 90 | test_mint_health: test_mint_health.c $(REPO_ROOT)/main/mint_health.c |
| 91 | $(CC) -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-sign-compare -std=gnu17 -g -O0 -DTEST_HOST -include stubs/esp_err.h -I $(REPO_ROOT)/main -I stubs -I $(SECP256K1_INC) -I $(SECP256K1_CFG) -I /usr/include/cjson $< $(REPO_ROOT)/main/mint_health.c -o $@ $(LDFLAGS) | 91 | $(CC) -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-sign-compare -std=gnu17 -g -O0 -DTEST_HOST -include stubs/esp_err.h -I $(REPO_ROOT)/main -I stubs -I $(SECP256K1_INC) -I $(SECP256K1_CFG) -I /usr/include/cjson $< $(REPO_ROOT)/main/mint_health.c -o $@ $(LDFLAGS) |
| 92 | 92 | ||
| 93 | test_beacon_price: test_beacon_price.c $(REPO_ROOT)/main/beacon_price.c | 93 | test_beacon_price: test_beacon_price.c $(REPO_ROOT)/main/beacon_price.c $(TG_CORE_SRC)/tollgate_core_beacon.c |
| 94 | $(CC) $(CFLAGS) -I $(REPO_ROOT)/main $< $(REPO_ROOT)/main/beacon_price.c -o $@ $(LDFLAGS) | 94 | $(CC) $(CFLAGS) -I $(REPO_ROOT)/main $< $(REPO_ROOT)/main/beacon_price.c $(TG_CORE_SRC)/tollgate_core_beacon.c -o $@ $(LDFLAGS) |
| 95 | 95 | ||
| 96 | test_market: test_market.c $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c | 96 | test_market: test_market.c $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c $(TG_CORE_SRC)/tollgate_core_beacon.c $(TG_CORE_SRC)/tollgate_core_market.c |
| 97 | $(CC) $(CFLAGS) -I $(REPO_ROOT)/main $< $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c -o $@ $(LDFLAGS) | 97 | $(CC) $(CFLAGS) -I $(REPO_ROOT)/main $< $(REPO_ROOT)/main/market.c $(REPO_ROOT)/main/beacon_price.c $(TG_CORE_SRC)/tollgate_core_beacon.c $(TG_CORE_SRC)/tollgate_core_market.c -o $@ $(LDFLAGS) |
| 98 | 98 | ||
| 99 | test_mining_payment: test_mining_payment.c $(TG_CORE_SRC)/tollgate_core_mining.c $(TG_CORE_SRC)/tollgate_core.c $(TG_CORE_SRC)/tollgate_core_session.c $(TG_CORE_SRC)/tollgate_core_firewall.c $(TG_CORE_SRC)/tollgate_core_cashu.c $(TG_CORE_SRC)/tollgate_core_dns.c $(TG_CORE_SRC)/tollgate_core_stratum_proxy.c | 99 | test_mining_payment: test_mining_payment.c $(TG_CORE_SRC)/tollgate_core_mining.c $(TG_CORE_SRC)/tollgate_core.c $(TG_CORE_SRC)/tollgate_core_session.c $(TG_CORE_SRC)/tollgate_core_firewall.c $(TG_CORE_SRC)/tollgate_core_cashu.c $(TG_CORE_SRC)/tollgate_core_dns.c $(TG_CORE_SRC)/tollgate_core_stratum_proxy.c |
| 100 | $(CC) $(CFLAGS) $(TG_CORE_OBJS_CFLAGS) $^ -o $@ $(LDFLAGS) | 100 | $(CC) $(CFLAGS) $(TG_CORE_OBJS_CFLAGS) $^ -o $@ $(LDFLAGS) |
diff --git a/tests/unit/test_beacon_price b/tests/unit/test_beacon_price index 5e4bf90..ff76ae6 100755 --- a/tests/unit/test_beacon_price +++ b/tests/unit/test_beacon_price | |||
| Binary files differ | |||
diff --git a/tests/unit/test_market b/tests/unit/test_market index d68ab15..49ccad4 100755 --- a/tests/unit/test_market +++ b/tests/unit/test_market | |||
| Binary files differ | |||