ci: Change encodable coverage to check for Encode trait
What changed, and why it matters
This is a routine CI maintenance patch. A trait named Encodable was renamed to Encode elsewhere in the project, and this change updates a GitHub Actions workflow and a shell script so they reference the new name. It fixes a broken documentation-file path that was causing CI to fail. There is no security issue here.
No security action needed. Treat as normal CI hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates .github/workflows/rust.yml and contrib/check-encodable-coverage.sh to replace references to the old Encodable trait with Encode. The script uses rustdoc-generated trait implementation files (target/doc/trait.impl/…/trait.Encode.js) to verify that all types implementing the consensus encoding trait are exercised by a fuzz target. The change is purely a name synchronization after a prior refactor; no logic, permissions, inputs, or cryptographic code is modified.
Changed components
.github/workflows/rust.ymlcontrib/check-encodable-coverage.shInspect captured patch +7 / −7
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 263d648e..62c21308 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -240,7 +240,7 @@ jobs:
run: contrib/check-error-reexports.sh
Encodable-coverage:
- name: Check Encodable fuzz coverage - stable toolchain
+ name: Check Encode fuzz coverage - stable toolchain
runs-on: ubuntu-24.04
permissions:
contents: read
@@ -251,7 +251,7 @@ jobs:
persist-credentials: false
- name: "Select toolchain"
uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
- - name: "Check Encodable coverage"
+ - name: "Check Encode coverage"
run: ./contrib/check-encodable-coverage.sh
DiffMutants:
diff --git a/contrib/check-encodable-coverage.sh b/contrib/check-encodable-coverage.sh
index aafec533..fa35260f 100755
--- a/contrib/check-encodable-coverage.sh
+++ b/contrib/check-encodable-coverage.sh
@@ -7,7 +7,7 @@ set -euo pipefail
REPO_DIR=$(git rev-parse --show-toplevel)
FUZZ_FILE="$REPO_DIR/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs"
-TRAIT_IMPL_JS="$REPO_DIR/target/doc/trait.impl/bitcoin_consensus_encoding/encode/trait.Encodable.js"
+TRAIT_IMPL_JS="$REPO_DIR/target/doc/trait.impl/bitcoin_consensus_encoding/encode/trait.Encode.js"
# Known exclusions (types that don't exist in old_bitcoin 0.32 or are generic).
# Add types here that have new Encodable but no old_bitcoin equivalent.
@@ -29,18 +29,18 @@ main() {
missing=$(find_missing_types "$new_types" "$fuzz_types")
if [ -n "$missing" ]; then
- echo "The following types implement encoding::Encodable but are not in the fuzz test:" >&2
+ echo "The following types implement encoding::Encode but are not in the fuzz test:" >&2
for type in $missing; do
echo " - $type" >&2
done
err "Either add them to compare_consensus_encoding.rs or add to EXCLUSIONS in this script"
fi
- echo "All encoding::Encodable types are covered (or excluded)"
+ echo "All encoding::Encode types are covered (or excluded)"
}
generate_docs() {
- echo "Generating docs to discover Encodable implementors..."
+ echo "Generating docs to discover Encode implementors..."
cargo doc --workspace --no-deps --quiet
}
@@ -56,7 +56,7 @@ extract_new_types() {
tr '>' '\n' < "$TRAIT_IMPL_JS" \
| grep -oE '^[A-Z][a-zA-Z0-9_]+<' \
| sed 's/<$//' \
- | grep -v '^Encodable$' \
+ | grep -v '^Encode$' \
| sort -u
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.