check-source: include tests, libdir.

And fix the resulting issues.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-02-21 15:15:28 +10:30
parent 7cee3b0f68
commit 20a07d860a
5 changed files with 13 additions and 14 deletions

View File

@@ -96,7 +96,7 @@ check-source: $(LIGHTNINGD_SRC:%=check-src-include-order/%)
check-source: $(LIGHTNINGD_LIB_SRC:%=check-src-include-order/%) check-source: $(LIGHTNINGD_LIB_SRC:%=check-src-include-order/%)
check-source: $(LIGHTNINGD_CLI_SRC:%=check-src-include-order/%) check-source: $(LIGHTNINGD_CLI_SRC:%=check-src-include-order/%)
check-source: $(LIGHTNINGD_HEADERS_NOGEN:%=check-hdr-include-order/%) check-source: $(LIGHTNINGD_HEADERS_NOGEN:%=check-hdr-include-order/%)
check-source-bolt: $(LIGHTNINGD_SRC:%=bolt-check/%) $(LIGHTNINGD_HEADERS_NOGEN:%=bolt-check/%) check-source-bolt: $(LIGHTNINGD_SRC:%=bolt-check/%) $(LIGHTNINGD_LIB_SRC:%=bolt-check/%) $(LIGHTNINGD_HEADERS_NOGEN:%=bolt-check/%)
check-whitespace: $(LIGHTNINGD_SRC:%=check-whitespace/%) $(LIGHTNINGD_HEADERS_NOGEN:%=check-whitespace/%) $(LIGHTNINGD_LIB_SRC:%=check-whitespace/%) $(LIGHTNINGD_LIB_HEADERS:%=check-whitespace/%) check-whitespace: $(LIGHTNINGD_SRC:%=check-whitespace/%) $(LIGHTNINGD_HEADERS_NOGEN:%=check-whitespace/%) $(LIGHTNINGD_LIB_SRC:%=check-whitespace/%) $(LIGHTNINGD_LIB_HEADERS:%=check-whitespace/%)

View File

@@ -35,3 +35,4 @@ lightningd-test-shutdown-2: lightningd-test-2-basic\ --reconnect
lightningd-blackbox-tests: lightningd-test-shutdown-0 #lightningd-test-shutdown-1 lightningd-test-shutdown-2 lightningd-blackbox-tests: lightningd-test-shutdown-0 #lightningd-test-shutdown-1 lightningd-test-shutdown-2
check-source-bolt: $(LIGHTNINGD_TEST_SRC:%=bolt-check/%) check-source-bolt: $(LIGHTNINGD_TEST_SRC:%=bolt-check/%)
check-whitespace: $(LIGHTNINGD_TEST_SRC:%=check-whitespace/%)

View File

@@ -109,11 +109,10 @@ static const struct htlc **setup_htlcs(const tal_t *ctx)
htlc->msatoshi = 4000000; htlc->msatoshi = 4000000;
break; break;
} }
if (i == 0 || i == 1 || i == 4) { if (i == 0 || i == 1 || i == 4) {
/* direction: remote->local */ /* direction: remote->local */
} else { } else {
/* direction: local->remote */ /* direction: local->remote */
htlc->state = SENT_ADD_ACK_REVOCATION; htlc->state = SENT_ADD_ACK_REVOCATION;
@@ -372,7 +371,7 @@ int main(void)
/* BOLT #3: /* BOLT #3:
* *
* # Appendix C: Commitment and HTLC Transaction Test Vectors * # Appendix C: Commitment and HTLC Transaction Test Vectors
* *
* In the following: * In the following:
* - we consider *local* transactions, which implies that all payments * - we consider *local* transactions, which implies that all payments
* to *local* are delayed * to *local* are delayed
@@ -383,11 +382,11 @@ int main(void)
* *
* - transaction signatures are all deterministic, using * - transaction signatures are all deterministic, using
* RFC6979 (using HMAC-SHA256) * RFC6979 (using HMAC-SHA256)
* *
* We start by defining common basic parameters for each test vector: * We start by defining common basic parameters for each test vector:
* the HTLCs are not used for the first "simple commitment tx with no * the HTLCs are not used for the first "simple commitment tx with no
* HTLCs" test. * HTLCs" test.
* *
* funding_tx_id: 8984484a580b825b9972d7adb15050b3ab624ccd731946b3eeddb92f4e7ef6be * funding_tx_id: 8984484a580b825b9972d7adb15050b3ab624ccd731946b3eeddb92f4e7ef6be
* funding_output_index: 0 * funding_output_index: 0
* funding_amount_satoshi: 10000000 * funding_amount_satoshi: 10000000
@@ -412,7 +411,7 @@ int main(void)
* it's not required for this test. They're included here for * it's not required for this test. They're included here for
* completeness and in case someone wants to reproduce the test * completeness and in case someone wants to reproduce the test
* vectors themselves: * vectors themselves:
* *
* INTERNAL: remote_funding_privkey: 1552dfba4f6cf29a62a0af13c8d6981d36d0ef8d61ba10fb0fe90da7634d7e130101 * INTERNAL: remote_funding_privkey: 1552dfba4f6cf29a62a0af13c8d6981d36d0ef8d61ba10fb0fe90da7634d7e130101
* INTERNAL: local_payment_basepoint_secret: 111111111111111111111111111111111111111111111111111111111111111101 * INTERNAL: local_payment_basepoint_secret: 111111111111111111111111111111111111111111111111111111111111111101
* INTERNAL: local_revocation_basepoint_secret: 222222222222222222222222222222222222222222222222222222222222222201 * INTERNAL: local_revocation_basepoint_secret: 222222222222222222222222222222222222222222222222222222222222222201
@@ -533,7 +532,7 @@ int main(void)
abort(); abort();
printf("local_funding_pubkey: %s\n", printf("local_funding_pubkey: %s\n",
type_to_string(tmpctx, struct pubkey, &local_funding_pubkey)); type_to_string(tmpctx, struct pubkey, &local_funding_pubkey));
if (!pubkey_from_privkey(&x_remote_funding_privkey, &remote_funding_pubkey)) if (!pubkey_from_privkey(&x_remote_funding_privkey, &remote_funding_pubkey))
abort(); abort();
printf("remote_funding_pubkey: %s\n", printf("remote_funding_pubkey: %s\n",
@@ -818,8 +817,8 @@ int main(void)
feerate_per_kw, feerate_per_kw,
htlc_map); htlc_map);
break; break;
} }
/* No memory leaks please */ /* No memory leaks please */
secp256k1_context_destroy(secp256k1_ctx); secp256k1_context_destroy(secp256k1_ctx);
tal_free(tmpctx); tal_free(tmpctx);

View File

@@ -53,7 +53,6 @@ int main(void)
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
| SECP256K1_CONTEXT_SIGN); | SECP256K1_CONTEXT_SIGN);
/* BOLT #3: /* BOLT #3:
* *
* Block 1 coinbase transaction: 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0100f2052a010000001976a9143ca33c2e4446f4a305f23c80df8ad1afdcf652f988ac00000000 * Block 1 coinbase transaction: 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff0100f2052a010000001976a9143ca33c2e4446f4a305f23c80df8ad1afdcf652f988ac00000000
@@ -77,7 +76,7 @@ int main(void)
/* BOLT #3: /* BOLT #3:
* *
* The funding transaction is paid to the following keys: * The funding transaction is paid to the following keys:
* *
* local_funding_pubkey: 023da092f6980e58d2c037173180e9a465476026ee50f96695963e8efe436f54eb * local_funding_pubkey: 023da092f6980e58d2c037173180e9a465476026ee50f96695963e8efe436f54eb
* remote_funding_pubkey: 030e9f7b623d2ccc7c9bd44d66d5ce21ce504c0acf6385a132cec6d3c39fa711c1 * remote_funding_pubkey: 030e9f7b623d2ccc7c9bd44d66d5ce21ce504c0acf6385a132cec6d3c39fa711c1
*/ */

View File

@@ -23,7 +23,7 @@ int main(void)
{ {
struct privkey base_secret, per_commitment_secret, privkey; struct privkey base_secret, per_commitment_secret, privkey;
struct pubkey base_point, per_commitment_point, pubkey, pubkey2; struct pubkey base_point, per_commitment_point, pubkey, pubkey2;
tmpctx = tal_tmpctx(NULL); tmpctx = tal_tmpctx(NULL);
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
| SECP256K1_CONTEXT_SIGN); | SECP256K1_CONTEXT_SIGN);