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

Commit

Permalink
Fix output file for updating weights in run_benches_for_runtime.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mordamax committed Aug 22, 2022
1 parent 0ace38a commit 8a3efb8
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 8a3efb8

Please sign in to comment.