Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Only use folder name for --output
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez committed Sep 23, 2022
commit 6d3b6200167b1afe0c8501d24ab810c16ce23474
20 changes: 4 additions & 16 deletions bench-bot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,17 @@ bench_pallet() {
fi
local weights_dir="./runtime/${runtime_dir}/src/weights"

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

case "$kind" in
runtime)
args+=(
--header=./file_header.txt
--output="${weights_dir}/${output_file}"
--output="${weights_dir}/"
)
;;
xcm)
args+=(
--template=./xcm/pallet-xcm-benchmarks/template.hbs
--output="${weights_dir}/xcm/${output_file}"
--output="${weights_dir}/xcm/"
)
;;
*)
Expand All @@ -132,23 +126,17 @@ bench_pallet() {
--header=./file_header.txt
)

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

case "$kind" in
pallet)
args+=(
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/${output_file}"
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/"
)
;;
xcm)
mkdir -p "./parachains/runtimes/$chain_type/$runtime/src/weights/xcm"
args+=(
--template=./templates/xcm-bench-template.hbs
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/xcm/${output_file}"
--output="./parachains/runtimes/$chain_type/$runtime/src/weights/xcm/"
)
;;
*)
Expand Down