Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix output file for updating weights in run_benches_for_runtime.sh #5906

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/ci/run_benches_for_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ rm -f $ERR_FILE
for PALLET in "${PALLETS[@]}"; do
echo "[+] Benchmarking $PALLET for $runtime";

output_file=""
if [[ $PALLET == *"::"* ]]; then
# translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
output_file="${PALLET//::/_}.rs"
fi

OUTPUT=$(
./target/production/polkadot benchmark pallet \
--chain="${runtime}-dev" \
Expand All @@ -39,7 +45,7 @@ for PALLET in "${PALLETS[@]}"; do
--execution=wasm \
--wasm-execution=compiled \
--header=./file_header.txt \
--output="./runtime/${runtime}/src/weights/${PALLET/::/_}.rs" 2>&1
--output="./runtime/${runtime}/src/weights/${output_file}" 2>&1
)
if [ $? -ne 0 ]; then
echo "$OUTPUT" >> "$ERR_FILE"
Expand Down