common: rename decode_short_channel_ids.{c,h} to decode_array.{c.h}

This encoding scheme is no longer just used for short_channel_ids, so make
the names more generic.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-09-27 09:32:34 +09:30
parent aa9024db51
commit 722b4942ed
11 changed files with 36 additions and 36 deletions

View File

@@ -2,7 +2,7 @@
#include <bitcoin/short_channel_id.h>
#include <ccan/err/err.h>
#include <ccan/str/hex/hex.h>
#include <common/decode_short_channel_ids.h>
#include <common/decode_array.h>
#include <common/utils.h>
#include <stdio.h>
#include <wire/wire.h>
@@ -41,9 +41,9 @@ int main(int argc, char *argv[])
if (!hex_decode(argv[1], strlen(argv[1]), &encoding, sizeof(encoding)))
errx(1, "Expected single hex byte not %s", argv[1]);
if (encoding == SHORTIDS_UNCOMPRESSED)
if (encoding == ARR_UNCOMPRESSED)
printf("%02x%s\n", encoding, tal_hex(NULL, data));
else if (encoding == SHORTIDS_ZLIB) {
else if (encoding == ARR_ZLIB) {
/* https://www.zlib.net/zlib_tech.html:
* the only expansion is an overhead of five bytes per 16 KB
* block (about 0.03%), plus a one-time overhead of six bytes