@@ -29,85 +29,92 @@ jobs:
2929 # Verify block is accessible
3030 echo "Fetching block chain info..."
3131 bitcoin-cli -signet getblockchaininfo
32-
32+
33+ # --- grading helpers: hash commitments ---
34+ actual_sha() { printf '%s' "$1" | sha256sum | awk '{print $1}'; }
35+ EXPECTED_01_SHA=bde2baff59ce5e0af3bce4de819074e8543eaac9258177d4f5308736fb29ce4d
36+ EXPECTED_02_SHA=5627b4a8f9efbd8fbdadaf4177824186f8c734f320935c88e926bc027af6c50f
37+ EXPECTED_03_SHA=271adcc6544021004ef18d63e0ab2971e616b6da698de007cc02531eb169b127
38+ EXPECTED_04_SHA=8a7790effbf72c4952d9338be95ec6d8911028aaa1f0b3115e0996581d1dec94
39+ EXPECTED_05_SHA=677fe64a8ea7e98a420d129f1cf3d4d23a9f107e9fbe8d83efe95f093001cd54
40+ EXPECTED_06_SHA=3fdc1bbf0f9de58ee6e32ab8974faaa4aa803fd025afae36a49126849a14d7a1
41+ EXPECTED_07_SHA=917c00c7e09c9172665a0c6f6a36e92ffae6ad0cc581b805b590d2b932cc3795
42+ EXPECTED_08_SHA=a73116285d9ff195341d1fab25e55c595e7e71296b4820b4a377847e9ef90647
43+
3344 # Run and verify 01.sh
3445 chmod +x submission/01.sh
3546 HASH=$(submission/01.sh)
36- EXPECTED=000000b024f11595795f0be5974229f786df389c8b92e92b61890e9e3c6b8d8a
37- if [[ "$HASH" == "$EXPECTED" ]]; then
47+ if [[ "$(actual_sha "$HASH")" == "$EXPECTED_01_SHA" ]]; then
3848 echo "✅ Success: Verify Hash Block passed!"
3949 else
4050 echo "❌ Error: Verify Hash Block failed!"
4151 exit 1
4252 fi
43-
53+
4454 # 02.sh - Verify Input Count
4555 chmod +x submission/02.sh
4656 COUNT=$(submission/02.sh)
47- if [[ "$COUNT" == "442 " ]]; then
57+ if [[ "$(actual_sha "$ COUNT")" == "$EXPECTED_02_SHA " ]]; then
4858 echo "✅ Success: Input Count verification passed!"
4959 else
5060 echo "❌ Error: Input Count verification failed!"
5161 exit 1
5262 fi
53-
63+
5464 # 03.sh - Verify Transaction
5565 chmod +x submission/03.sh
5666 TX=$(submission/03.sh)
57- EXPECTED=0e302b600d32b86c3362647f422e5605165a1e5c89c760d0d972e102f390c84e
58- if [[ "$TX" == "$EXPECTED" ]]; then
67+ if [[ "$(actual_sha "$TX")" == "$EXPECTED_03_SHA" ]]; then
5968 echo "✅ Success: Transaction verification passed!"
6069 else
6170 echo "❌ Error: Transaction verification failed!"
6271 exit 1
6372 fi
64-
73+
6574 # 04.sh - Verify Public Key Signer
6675 chmod +x submission/04.sh
6776 PUBKEY=$(submission/04.sh)
68- EXPECTED_OUTPUT=02c6c9306ade30f9711c9503cdaa94094efc025acb9be7845acc49e1cb475952c6
69- if [[ "$PUBKEY" == "$EXPECTED_OUTPUT" ]]; then
77+ if [[ "$(actual_sha "$PUBKEY")" == "$EXPECTED_04_SHA" ]]; then
7078 echo "✅ Success: Public Key Signer verification passed!"
7179 else
7280 echo "❌ Error: Public Key Signer verification failed!"
7381 exit 1
7482 fi
75-
83+
7684 # 05.sh - Verify TX Fee
7785 chmod +x submission/05.sh
7886 FEE=$(submission/05.sh)
79- if [[ "$FEE" == "696 " ]]; then
87+ if [[ "$(actual_sha "$ FEE")" == "$EXPECTED_05_SHA " ]]; then
8088 echo "✅ Success: TX Fee (05.sh) verification passed!"
8189 else
8290 echo "❌ Error: TX Fee (05.sh) verification failed!"
8391 exit 1
8492 fi
85-
93+
8694 # 06.sh - Verify TX ID opt-in RBF
8795 chmod +x submission/06.sh
8896 TXID=$(submission/06.sh)
89- if [[ "$TXID" == "d78ef223c1adb9e5c9051f0ab1f03708838466630805aaf3eb2b123e374d12ab " ]]; then
97+ if [[ "$(actual_sha "$ TXID")" == "$EXPECTED_06_SHA " ]]; then
9098 echo "✅ Success: TX ID opt-in RBF verification passed!"
9199 else
92100 echo "❌ Error: TX ID opt-in RBF verification failed!"
93101 exit 1
94102 fi
95-
103+
96104 # 07.sh - Verify Coinbase TX
97105 chmod +x submission/07.sh
98106 COINBASE=$(submission/07.sh | tr -d '\n' | xargs)
99- EXPECTED_OUTPUT=7ab200e41b53d974f757535c01a715aae6b1322a30753c1d2b0ea201500bc060
100- if [[ "$COINBASE" == "$EXPECTED_OUTPUT" ]]; then
107+ if [[ "$(actual_sha "$COINBASE")" == "$EXPECTED_07_SHA" ]]; then
101108 echo "✅ Success: Coinbase TX verification passed!"
102109 else
103110 echo "❌ Error: Coinbase TX verification failed!"
104111 exit 1
105112 fi
106-
113+
107114 # 08.sh - Verify TX Block Height
108115 chmod +x submission/08.sh
109116 HEIGHT=$(submission/08.sh)
110- if [[ "$HEIGHT" == "243859 " ]]; then
117+ if [[ "$(actual_sha "$ HEIGHT")" == "$EXPECTED_08_SHA " ]]; then
111118 echo "✅ Success: TX Block Height verification passed!"
112119 else
113120 echo "❌ Error: TX Block Height verification failed!"
0 commit comments