#!/bin/bash

while getopts f: flag
do
    case "${flag}" in
        f) filename=${OPTARG};;
    esac
done

mkdir benchmarking
mkdir benchmarking/results
mkdir benchmarking/new-benchmarks

while IFS= read -r line; do
    echo "Creating benchmark for: $line"
    target/release/teyrchain-template-node benchmark pezpallet --steps=50 --repeat=20 --extrinsic=* --wasm-execution=compiled --heap-pages=4096 --json-file=benchmarking/results/results-$line.json --pezpallet=$line --chain=dev --output=benchmarking/new-benchmarks/$line.rs
done < $filename