From 8a3efb8d7f8783e87e4487c388a48f5b65df1dfa Mon Sep 17 00:00:00 2001 From: command-bot Date: Fri, 19 Aug 2022 22:12:20 +0100 Subject: [PATCH] Fix output file for updating weights in run_benches_for_runtime.sh --- scripts/ci/run_benches_for_runtime.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/ci/run_benches_for_runtime.sh b/scripts/ci/run_benches_for_runtime.sh index 8149195c82c4..cd9cb5be8e98 100755 --- a/scripts/ci/run_benches_for_runtime.sh +++ b/scripts/ci/run_benches_for_runtime.sh @@ -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" \ @@ -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"