diff options
| author | Your Name <you@example.com> | 2026-05-19 14:34:12 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 14:34:12 +0530 |
| commit | 55917e09b186c44afc53fc0dd2d3635b34febcd8 (patch) | |
| tree | 62e07abecb50ec2c392f7b82df0eb6d50806fa4c /tests | |
| parent | e366ceb336550a72c76efea4c98a2a08cca27bce (diff) | |
fix: resolve merge conflicts + test build fixes
- config.h: remove duplicate nostr_sync fields
- Makefile: add mint_health stub for test_session_payment_method
- test_tollgate_client_mining: inline market_t stub to avoid dependency cascade
- CMakeLists: add negentropy_adapter.c + esp_littlefs + negentropy REQUIRES
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/Makefile | 2 | ||||
| -rw-r--r-- | tests/unit/stubs/market.h | 21 | ||||
| -rwxr-xr-x | tests/unit/test_beacon_price | bin | 34808 -> 35744 bytes | |||
| -rwxr-xr-x | tests/unit/test_cvm_server | bin | 45720 -> 45712 bytes | |||
| -rwxr-xr-x | tests/unit/test_firewall_sandbox | bin | 30576 -> 30568 bytes | |||
| -rwxr-xr-x | tests/unit/test_geohash | bin | 20784 -> 20776 bytes | |||
| -rwxr-xr-x | tests/unit/test_identity | bin | 297888 -> 297872 bytes | |||
| -rwxr-xr-x | tests/unit/test_lightning_payout | bin | 20552 -> 20552 bytes | |||
| -rwxr-xr-x | tests/unit/test_lnurl_pay | bin | 21312 -> 21304 bytes | |||
| -rwxr-xr-x | tests/unit/test_market | bin | 48240 -> 49456 bytes | |||
| -rwxr-xr-x | tests/unit/test_mcp_handler | bin | 64152 -> 64496 bytes | |||
| -rwxr-xr-x | tests/unit/test_mining_payment | bin | 28672 -> 28664 bytes | |||
| -rwxr-xr-x | tests/unit/test_nip04 | bin | 298784 -> 298776 bytes | |||
| -rwxr-xr-x | tests/unit/test_session_payment_method | bin | 54008 -> 54680 bytes | |||
| -rwxr-xr-x | tests/unit/test_stratum_proxy | bin | 40752 -> 40744 bytes | |||
| -rwxr-xr-x | tests/unit/test_tollgate_client | bin | 52968 -> 73336 bytes | |||
| -rwxr-xr-x | tests/unit/test_tollgate_client_mining | bin | 47224 -> 48448 bytes | |||
| -rw-r--r-- | tests/unit/test_tollgate_client_mining.c | 8 |
18 files changed, 30 insertions, 1 deletions
diff --git a/tests/unit/Makefile b/tests/unit/Makefile index edff73c..b0b6922 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile | |||
| @@ -97,7 +97,7 @@ test_stratum_proxy: test_stratum_proxy.c $(REPO_ROOT)/main/stratum_proxy.c $(REP | |||
| 97 | $(CC) $(CFLAGS) $< $(REPO_ROOT)/main/stratum_proxy.c $(REPO_ROOT)/main/mining_payment.c -o $@ $(LDFLAGS) | 97 | $(CC) $(CFLAGS) $< $(REPO_ROOT)/main/stratum_proxy.c $(REPO_ROOT)/main/mining_payment.c -o $@ $(LDFLAGS) |
| 98 | 98 | ||
| 99 | test_session_payment_method: test_session_payment_method.c $(REPO_ROOT)/main/session.c $(REPO_ROOT)/main/cashu.c | 99 | test_session_payment_method: test_session_payment_method.c $(REPO_ROOT)/main/session.c $(REPO_ROOT)/main/cashu.c |
| 100 | $(CC) $(CFLAGS) $< $(REPO_ROOT)/main/session.c $(REPO_ROOT)/main/cashu.c -o $@ $(LDFLAGS) | 100 | $(CC) $(CFLAGS) -include stubs/mint_health.h $< $(REPO_ROOT)/main/session.c $(REPO_ROOT)/main/cashu.c -o $@ $(LDFLAGS) |
| 101 | 101 | ||
| 102 | test_tollgate_client_mining: test_tollgate_client_mining.c | 102 | test_tollgate_client_mining: test_tollgate_client_mining.c |
| 103 | $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) | 103 | $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) |
diff --git a/tests/unit/stubs/market.h b/tests/unit/stubs/market.h new file mode 100644 index 0000000..b81564d --- /dev/null +++ b/tests/unit/stubs/market.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #ifndef STUBS_MARKET_H | ||
| 2 | #define STUBS_MARKET_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | #include <stdbool.h> | ||
| 6 | |||
| 7 | typedef struct { | ||
| 8 | uint8_t bssid[6]; | ||
| 9 | int8_t rssi; | ||
| 10 | uint16_t price_per_step; | ||
| 11 | uint32_t step_size; | ||
| 12 | uint8_t metric; | ||
| 13 | uint8_t mint_hash[4]; | ||
| 14 | uint8_t npub_hash[4]; | ||
| 15 | int64_t discovered_ms; | ||
| 16 | } market_t; | ||
| 17 | |||
| 18 | static inline const market_t *market_get(void) { return NULL; } | ||
| 19 | static inline int market_find_cheapest(void) { return -1; } | ||
| 20 | |||
| 21 | #endif | ||
diff --git a/tests/unit/test_beacon_price b/tests/unit/test_beacon_price index 47efd2b..a9f6357 100755 --- a/tests/unit/test_beacon_price +++ b/tests/unit/test_beacon_price | |||
| Binary files differ | |||
diff --git a/tests/unit/test_cvm_server b/tests/unit/test_cvm_server index bd5e735..ea327b7 100755 --- a/tests/unit/test_cvm_server +++ b/tests/unit/test_cvm_server | |||
| Binary files differ | |||
diff --git a/tests/unit/test_firewall_sandbox b/tests/unit/test_firewall_sandbox index 4b85357..3e2895b 100755 --- a/tests/unit/test_firewall_sandbox +++ b/tests/unit/test_firewall_sandbox | |||
| Binary files differ | |||
diff --git a/tests/unit/test_geohash b/tests/unit/test_geohash index 46d0e6f..dc5045f 100755 --- a/tests/unit/test_geohash +++ b/tests/unit/test_geohash | |||
| Binary files differ | |||
diff --git a/tests/unit/test_identity b/tests/unit/test_identity index d0ff402..aa5e359 100755 --- a/tests/unit/test_identity +++ b/tests/unit/test_identity | |||
| Binary files differ | |||
diff --git a/tests/unit/test_lightning_payout b/tests/unit/test_lightning_payout index caa9626..b10888c 100755 --- a/tests/unit/test_lightning_payout +++ b/tests/unit/test_lightning_payout | |||
| Binary files differ | |||
diff --git a/tests/unit/test_lnurl_pay b/tests/unit/test_lnurl_pay index 1345004..1f16293 100755 --- a/tests/unit/test_lnurl_pay +++ b/tests/unit/test_lnurl_pay | |||
| Binary files differ | |||
diff --git a/tests/unit/test_market b/tests/unit/test_market index 9823080..a386530 100755 --- a/tests/unit/test_market +++ b/tests/unit/test_market | |||
| Binary files differ | |||
diff --git a/tests/unit/test_mcp_handler b/tests/unit/test_mcp_handler index be992f6..e98f2c3 100755 --- a/tests/unit/test_mcp_handler +++ b/tests/unit/test_mcp_handler | |||
| Binary files differ | |||
diff --git a/tests/unit/test_mining_payment b/tests/unit/test_mining_payment index 015deaf..36d80d3 100755 --- a/tests/unit/test_mining_payment +++ b/tests/unit/test_mining_payment | |||
| Binary files differ | |||
diff --git a/tests/unit/test_nip04 b/tests/unit/test_nip04 index daf5e16..cb52040 100755 --- a/tests/unit/test_nip04 +++ b/tests/unit/test_nip04 | |||
| Binary files differ | |||
diff --git a/tests/unit/test_session_payment_method b/tests/unit/test_session_payment_method index 94c7134..b66a9d7 100755 --- a/tests/unit/test_session_payment_method +++ b/tests/unit/test_session_payment_method | |||
| Binary files differ | |||
diff --git a/tests/unit/test_stratum_proxy b/tests/unit/test_stratum_proxy index 608835f..de88ff6 100755 --- a/tests/unit/test_stratum_proxy +++ b/tests/unit/test_stratum_proxy | |||
| Binary files differ | |||
diff --git a/tests/unit/test_tollgate_client b/tests/unit/test_tollgate_client index b56a6f0..8e451c4 100755 --- a/tests/unit/test_tollgate_client +++ b/tests/unit/test_tollgate_client | |||
| Binary files differ | |||
diff --git a/tests/unit/test_tollgate_client_mining b/tests/unit/test_tollgate_client_mining index 64b99dd..1aead58 100755 --- a/tests/unit/test_tollgate_client_mining +++ b/tests/unit/test_tollgate_client_mining | |||
| Binary files differ | |||
diff --git a/tests/unit/test_tollgate_client_mining.c b/tests/unit/test_tollgate_client_mining.c index e270864..efe543e 100644 --- a/tests/unit/test_tollgate_client_mining.c +++ b/tests/unit/test_tollgate_client_mining.c | |||
| @@ -14,6 +14,14 @@ const tollgate_config_t *tollgate_config_get(void) { | |||
| 14 | uint64_t nucula_wallet_balance(void) { return 100; } | 14 | uint64_t nucula_wallet_balance(void) { return 100; } |
| 15 | esp_err_t nucula_wallet_send(uint64_t a, char *b, size_t c) { (void)a; (void)b; (void)c; return ESP_OK; } | 15 | esp_err_t nucula_wallet_send(uint64_t a, char *b, size_t c) { (void)a; (void)b; (void)c; return ESP_OK; } |
| 16 | 16 | ||
| 17 | #define TOLLGATE_IE_GEOHASH_MAX 9 | ||
| 18 | #define MARKET_MAX_ENTRIES 10 | ||
| 19 | typedef struct { uint8_t bssid[6]; char ssid[33]; int8_t rssi; uint16_t price_per_step; uint32_t step_size; uint8_t metric; uint8_t mint_hash[4]; uint8_t npub_hash[4]; char geohash[10]; int64_t discovered_ms; bool valid; } market_entry_t; | ||
| 20 | typedef struct { market_entry_t entries[MARKET_MAX_ENTRIES]; int count; int64_t last_scan_ms; bool scanning; int consecutive_failures; } market_t; | ||
| 21 | static inline const market_t *market_get(void) { static market_t m = {0}; return &m; } | ||
| 22 | static inline int market_find_cheapest(void) { return -1; } | ||
| 23 | #define MARKET_H | ||
| 24 | |||
| 17 | #include "freertos/FreeRTOS.h" | 25 | #include "freertos/FreeRTOS.h" |
| 18 | 26 | ||
| 19 | #include "../../main/tollgate_client.c" | 27 | #include "../../main/tollgate_client.c" |