aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.test.include
diff options
context:
space:
mode:
authorGleb Naumenko <naumenko.gs@gmail.com>2019-12-24 13:18:44 -0500
committerGleb Naumenko <naumenko.gs@gmail.com>2019-12-25 08:59:08 -0500
commitec45646de9e62b3d42c85716bfeb06d8f2b507dc (patch)
tree2d3717818d8ea1b9a53f9b53af2390f7aee9ac21 /src/Makefile.test.include
parent8feb4e4b667361bf23344149c01594abebd56fdb (diff)
downloadbitcoin-ec45646de9e62b3d42c85716bfeb06d8f2b507dc.tar.xz
Integrate ASN bucketing in Addrman and add tests
Instead of using /16 netgroups to bucket nodes in Addrman for connection diversification, ASN, which better represents an actor in terms of network-layer infrastructure, is used. For testing, asmap.raw is used. It represents a minimal asmap needed for testing purposes.
Diffstat (limited to 'src/Makefile.test.include')
-rw-r--r--src/Makefile.test.include12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index b4ca01b1fe..f3fc6c706b 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -53,7 +53,8 @@ JSON_TEST_FILES = \
test/data/tx_invalid.json \
test/data/tx_valid.json
-RAW_TEST_FILES =
+RAW_TEST_FILES = \
+ test/data/asmap.raw
GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
@@ -429,3 +430,12 @@ endif
echo "};};"; \
} > "$@.new" && mv -f "$@.new" "$@"
@echo "Generated $@"
+
+%.raw.h: %.raw
+ @$(MKDIR_P) $(@D)
+ @{ \
+ echo "static unsigned const char $(*F)_raw[] = {" && \
+ $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
+ echo "};"; \
+ } > "$@.new" && mv -f "$@.new" "$@"
+ @echo "Generated $@"