mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
lightningd: change config-dir from plugin / wallet / hsm POV into <network> subdir
Changelog-changed: .lightningd plugins and files moved into <network>/ subdir Changelog-changed: WARNING: If you don't have a config file, you now may need to specify the network to lightning-cli Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -15,6 +15,7 @@ int test_connect(int sockfd, const struct sockaddr *addr,
|
||||
socklen_t addrlen);
|
||||
int test_getpid(void);
|
||||
int test_printf(const char *format, ...);
|
||||
int test_chdir(const char *path);
|
||||
|
||||
#define main test_main
|
||||
#define read test_read
|
||||
@@ -22,6 +23,7 @@ int test_printf(const char *format, ...);
|
||||
#define connect test_connect
|
||||
#define getpid test_getpid
|
||||
#define printf test_printf
|
||||
#define chdir test_chdir
|
||||
|
||||
#include "../lightning-cli.c"
|
||||
#undef main
|
||||
@@ -79,6 +81,11 @@ int test_printf(const char *fmt UNUSED, ...)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int test_chdir(const char *path)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *response;
|
||||
static size_t response_off, max_read_return;
|
||||
|
||||
@@ -140,5 +147,7 @@ int main(int argc UNUSED, char *argv[])
|
||||
max_read_return = -1;
|
||||
assert(test_main(3, fake_argv) == 0);
|
||||
tal_free(response);
|
||||
assert(!taken_any());
|
||||
take_cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ int test_connect(int sockfd, const struct sockaddr *addr,
|
||||
int test_getpid(void);
|
||||
int test_printf(const char *format, ...);
|
||||
int test_fputc(int c, FILE *stream);
|
||||
int test_chdir(const char *path);
|
||||
|
||||
#define main test_main
|
||||
#define read test_read
|
||||
@@ -25,6 +26,7 @@ int test_fputc(int c, FILE *stream);
|
||||
#define getpid test_getpid
|
||||
#define printf test_printf
|
||||
#define fputc test_fputc
|
||||
#define chdir test_chdir
|
||||
|
||||
#include "../lightning-cli.c"
|
||||
#undef main
|
||||
@@ -106,6 +108,11 @@ int test_fputc(int c, FILE *stream)
|
||||
return (unsigned)c;
|
||||
}
|
||||
|
||||
int test_chdir(const char *path)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc UNUSED, char *argv[])
|
||||
{
|
||||
setup_locale();
|
||||
@@ -114,7 +121,6 @@ int main(int argc UNUSED, char *argv[])
|
||||
|
||||
output = tal_strdup(NULL, "");
|
||||
assert(test_main(3, fake_argv) == 0);
|
||||
assert(!taken_any());
|
||||
|
||||
assert(streq(output, "channels=\n"
|
||||
"\n"
|
||||
@@ -130,6 +136,7 @@ int main(int argc UNUSED, char *argv[])
|
||||
"num_channels=1\n"
|
||||
"num_connected=1\n"));
|
||||
tal_free(output);
|
||||
assert(!taken_any());
|
||||
take_cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user