@@ -11,6 +11,50 @@ function PIN_RELEASE_DEPS {
11
11
return 0 # Don't fail the script if our rustc is higher than the last check
12
12
}
13
13
14
+ # The tests of `lightning-transaction-sync` require `electrs` and `bitcoind`
15
+ # binaries. Here, we download the binaries, validate them, and export their
16
+ # location via `ELECTRS_EXE`/`BITCOIND_EXE` which will be used by
17
+ # `electrsd`/`bitcoind` crates in our tests.
18
+ function DOWNLOAD_ELECTRS_AND_BITCOIND {
19
+ ELECTRS_DL_ENDPOINT=" https://github.com/RCasatta/electrsd/releases/download/electrs_releases"
20
+ ELECTRS_VERSION=" esplora_a33e97e1a1fc63fa9c20a116bb92579bbf43b254"
21
+ BITCOIND_DL_ENDPOINT=" https://bitcoincore.org/bin/"
22
+ BITCOIND_VERSION=" 25.1"
23
+ if [[ " $HOST_PLATFORM " == * linux* ]]; then
24
+ ELECTRS_DL_FILE_NAME=electrs_linux_" $ELECTRS_VERSION " .zip
25
+ ELECTRS_DL_HASH=" 865e26a96e8df77df01d96f2f569dcf9622fc87a8d99a9b8fe30861a4db9ddf1"
26
+ BITCOIND_DL_FILE_NAME=bitcoin-" $BITCOIND_VERSION " -x86_64-linux-gnu.tar.gz
27
+ BITCOIND_DL_HASH=" a978c407b497a727f0444156e397b50491ce862d1f906fef9b521415b3611c8b"
28
+ elif [[ " $HOST_PLATFORM " == * darwin* ]]; then
29
+ ELECTRS_DL_FILE_NAME=electrs_macos_" $ELECTRS_VERSION " .zip
30
+ ELECTRS_DL_HASH=" 2d5ff149e8a2482d3658e9b386830dfc40c8fbd7c175ca7cbac58240a9505bcd"
31
+ BITCOIND_DL_FILE_NAME=bitcoin-" $BITCOIND_VERSION " -x86_64-apple-darwin.tar.gz
32
+ BITCOIND_DL_HASH=" 1acfde0ec3128381b83e3e5f54d1c7907871d324549129592144dd12a821eff1"
33
+ else
34
+ echo -e " \n\nUnsupported platform. Exiting.."
35
+ exit 1
36
+ fi
37
+
38
+ DL_TMP_DIR=$( mktemp -d)
39
+ trap ' rm -rf -- "$DL_TMP_DIR"' EXIT
40
+
41
+ pushd " $DL_TMP_DIR "
42
+ ELECTRS_DL_URL=" $ELECTRS_DL_ENDPOINT " /" $ELECTRS_DL_FILE_NAME "
43
+ curl -L -o " $ELECTRS_DL_FILE_NAME " " $ELECTRS_DL_URL "
44
+ echo " $ELECTRS_DL_HASH $ELECTRS_DL_FILE_NAME " | shasum -a 256 -c
45
+ unzip " $ELECTRS_DL_FILE_NAME "
46
+ export ELECTRS_EXE=" $DL_TMP_DIR " /electrs
47
+ chmod +x " $ELECTRS_EXE "
48
+
49
+ BITCOIND_DL_URL=" $BITCOIND_DL_ENDPOINT " /bitcoin-core-" $BITCOIND_VERSION " /" $BITCOIND_DL_FILE_NAME "
50
+ curl -L -o " $BITCOIND_DL_FILE_NAME " " $BITCOIND_DL_URL "
51
+ echo " $BITCOIND_DL_HASH $BITCOIND_DL_FILE_NAME " | shasum -a 256 -c
52
+ tar xzf " $BITCOIND_DL_FILE_NAME "
53
+ export BITCOIND_EXE=" $DL_TMP_DIR " /bitcoin-" $BITCOIND_VERSION " /bin/bitcoind
54
+ chmod +x " $BITCOIND_EXE "
55
+ popd
56
+ }
57
+
14
58
PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
15
59
16
60
# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
@@ -41,23 +85,21 @@ if [[ "$HOST_PLATFORM" != *windows* ]]; then
41
85
echo -e " \n\nBuilding and testing Transaction Sync Clients with features"
42
86
pushd lightning-transaction-sync
43
87
44
- # zstd-sys 2.0.9+zstd.1.5.5 requires rustc 1.64.0
45
- [ " $RUSTC_MINOR_VERSION " -lt 64 ] && cargo update -p zstd-sys --precise " 2.0.8+zstd.1.5.5" --verbose
46
88
# reqwest 0.11.21 had a regression that broke its 1.63.0 MSRV
47
89
[ " $RUSTC_MINOR_VERSION " -lt 65 ] && cargo update -p reqwest --precise " 0.11.20" --verbose
48
- # jobserver 0.1.27 requires rustc 1.66.0
49
- [ " $RUSTC_MINOR_VERSION " -lt 66 ] && cargo update -p jobserver --precise " 0.1.26" --verbose
50
90
# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
51
91
[ " $RUSTC_MINOR_VERSION " -lt 65 ] && cargo update -p regex --precise " 1.9.6" --verbose
52
92
53
- cargo test --verbose --color always --features esplora-blocking
54
- cargo check --verbose --color always --features esplora-blocking
55
- cargo test --verbose --color always --features esplora-async
56
- cargo check --verbose --color always --features esplora-async
57
- cargo test --verbose --color always --features esplora-async-https
58
- cargo check --verbose --color always --features esplora-async-https
59
- cargo test --verbose --color always --features electrum
60
- cargo check --verbose --color always --features electrum
93
+ DOWNLOAD_ELECTRS_AND_BITCOIND
94
+
95
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features esplora-blocking
96
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features esplora-blocking
97
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features esplora-async
98
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features esplora-async
99
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features esplora-async-https
100
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features esplora-async-https
101
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features electrum
102
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features electrum
61
103
62
104
popd
63
105
fi
0 commit comments