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

Commit c548525

Browse files
authored
Fix output file for updating weights in run_benches_for_runtime.sh (#5906)
1 parent 0ace38a commit c548525

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/ci/run_benches_for_runtime.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ rm -f $ERR_FILE
2929
for PALLET in "${PALLETS[@]}"; do
3030
echo "[+] Benchmarking $PALLET for $runtime";
3131

32+
output_file=""
33+
if [[ $PALLET == *"::"* ]]; then
34+
# translates e.g. "pallet_foo::bar" to "pallet_foo_bar"
35+
output_file="${PALLET//::/_}.rs"
36+
fi
37+
3238
OUTPUT=$(
3339
./target/production/polkadot benchmark pallet \
3440
--chain="${runtime}-dev" \
@@ -39,7 +45,7 @@ for PALLET in "${PALLETS[@]}"; do
3945
--execution=wasm \
4046
--wasm-execution=compiled \
4147
--header=./file_header.txt \
42-
--output="./runtime/${runtime}/src/weights/${PALLET/::/_}.rs" 2>&1
48+
--output="./runtime/${runtime}/src/weights/${output_file}" 2>&1
4349
)
4450
if [ $? -ne 0 ]; then
4551
echo "$OUTPUT" >> "$ERR_FILE"

0 commit comments

Comments
 (0)