From 4c4846f82ab696d0cb2658a6a0a5edf5f621f027 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 1 Aug 2022 15:43:11 +1000 Subject: [PATCH 1/4] Remove double blank line at EOF There should only be a single blank line at end of file. --- src/blockdata/constants.rs | 1 - src/blockdata/mod.rs | 1 - src/blockdata/script.rs | 1 - src/consensus/encode.rs | 1 - src/network/message_blockdata.rs | 1 - src/util/amount.rs | 1 - src/util/base58.rs | 1 - src/util/bip32.rs | 1 - 8 files changed, 8 deletions(-) diff --git a/src/blockdata/constants.rs b/src/blockdata/constants.rs index 27de8845..907e20b3 100644 --- a/src/blockdata/constants.rs +++ b/src/blockdata/constants.rs @@ -305,4 +305,3 @@ mod test { assert_eq!(got, want); } } - diff --git a/src/blockdata/mod.rs b/src/blockdata/mod.rs index 15d44c24..2edb7883 100644 --- a/src/blockdata/mod.rs +++ b/src/blockdata/mod.rs @@ -14,4 +14,3 @@ pub mod script; pub mod transaction; pub mod block; pub mod witness; - diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index 1e145991..5d4e7c8e 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -1538,4 +1538,3 @@ mod test { assert!(read_scriptbool(&v)); } } - diff --git a/src/consensus/encode.rs b/src/consensus/encode.rs index 04b0fe01..362a8c54 100644 --- a/src/consensus/encode.rs +++ b/src/consensus/encode.rs @@ -1170,4 +1170,3 @@ mod tests { } } } - diff --git a/src/network/message_blockdata.rs b/src/network/message_blockdata.rs index 98e5bbc8..0e51748f 100644 --- a/src/network/message_blockdata.rs +++ b/src/network/message_blockdata.rs @@ -179,4 +179,3 @@ mod tests { assert_eq!(serialize(&real_decode), from_sat); } } - diff --git a/src/util/amount.rs b/src/util/amount.rs index 88fab77b..1c0f5c55 100644 --- a/src/util/amount.rs +++ b/src/util/amount.rs @@ -2238,4 +2238,3 @@ mod tests { } } } - diff --git a/src/util/base58.rs b/src/util/base58.rs index eb955469..d548f116 100644 --- a/src/util/base58.rs +++ b/src/util/base58.rs @@ -334,4 +334,3 @@ mod tests { } } - diff --git a/src/util/bip32.rs b/src/util/bip32.rs index 191e79f9..9f18916d 100644 --- a/src/util/bip32.rs +++ b/src/util/bip32.rs @@ -1177,4 +1177,3 @@ mod tests { ExtendedPrivKey::from_str(xpriv_str).unwrap(); } } - From 58ede47ef1f94bc3758f85efcb532e504dd85b1b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 22 Jul 2022 08:06:51 +1000 Subject: [PATCH 2/4] ci: Use set -ex instead of /bin/sh -ex Setting `-ex` in the shebang makes it a little hard to see since folks are used to glancing up and looking for `set -ex`. Both styles achieve the same result, so this does not change the logic of the script. --- contrib/test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/test.sh b/contrib/test.sh index cafce679..c0bf30c1 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -1,4 +1,6 @@ -#!/bin/sh -ex +#!/bin/sh + +set -ex FEATURES="base64 bitcoinconsensus serde rand secp-recovery" From 8eb6c23eafb30e308386b0d9ecfb5eb4843b2c8a Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 22 Jul 2022 11:26:37 +1000 Subject: [PATCH 3/4] ci: Remove inner quotes from shell variable shellcheck emits: SC2027: The surrounding quotes actually unquote this. Remove or escape them. Remove inner quotes from shell variable so the feature is correctly printed. --- contrib/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/test.sh b/contrib/test.sh index c0bf30c1..3fe57b2b 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -80,7 +80,7 @@ fi # Test each feature for feature in ${FEATURES} do - echo "********* Testing "$feature" *************" + echo "********* Testing $feature *************" cargo test --verbose --features="$feature" done From 37cd6503f11f783e91d84d85a1516c29f76361a7 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 1 Sep 2022 11:52:03 +1000 Subject: [PATCH 4/4] ci: Remove TOOLCHAIN env var Cargo already has an env var for controlling the toolchain, we should use it instead of our current custom `TOOLCHAIn`. While we are at it fix the missing `$` from variables (found by `shellcheck`). Use RUSTUP_TOOLCHAIN to allow control of the toolchain. --- contrib/test.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contrib/test.sh b/contrib/test.sh index 3fe57b2b..b46e8917 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -4,12 +4,6 @@ set -ex FEATURES="base64 bitcoinconsensus serde rand secp-recovery" -# Use toolchain if explicitly specified -if [ -n "$TOOLCHAIN" ] -then - alias cargo="cargo +$TOOLCHAIN" -fi - if [ "$DO_COV" = true ] then export RUSTFLAGS="-C link-dead-code" @@ -104,11 +98,11 @@ fi # Bench if told to, only works with non-stable toolchain (nightly, beta). if [ "$DO_BENCH" = true ] then - if [ "NIGHTLY" = false ] + if [ "$NIGHTLY" = false ] then - if [ -n "TOOLCHAIN" ] + if [ -n "$RUSTUP_TOOLCHAIN" ] then - echo "TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain" + echo "RUSTUP_TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain" else echo "DO_BENCH requires a nightly toolchain" fi