Skip to content

Commit

Permalink
add chain parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
enthusiastmartin committed Mar 22, 2022
1 parent 23c5fbf commit 3d1c2ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bench_wizard/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class BenchmarksConfig:
dump_results: Optional[str] = None
output_dir: Optional[str] = None
template: Optional[str] = None
chain: Optional[str] = "dev"


class Benchmark:
Expand Down Expand Up @@ -77,7 +78,7 @@ def _prepare_benchmarks(config: BenchmarksConfig) -> List[Benchmark]:
benchmarks = []

for pallet in config.pallets:
cargo = Cargo(pallet=pallet, template=config.template)
cargo = Cargo(pallet=pallet, template=config.template, chain=config.chain)

if config.output_dir:
output_file = os.path.join(config.output_dir, f"{pallet}.rs")
Expand Down
11 changes: 10 additions & 1 deletion bench_wizard/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ def version():
required=True,
help="Pallets",
)
@click.option(
"-c",
"--chain",
type=str,
required=False,
default="dev",
help="chain",
)
@click.option(
"-d",
"--dump-results",
Expand All @@ -54,6 +62,7 @@ def version():
)
def benchmark(
pallet: list,
chain: str,
dump_results: Optional[str],
template: Optional[str],
output_dir: Optional[str],
Expand All @@ -64,6 +73,7 @@ def benchmark(
dump_results=dump_results,
template=template,
output_dir=output_dir,
chain=chain,
)

run_pallet_benchmarks(config, Output())
Expand Down Expand Up @@ -94,7 +104,6 @@ def pc(
print(f"{reference_values} does not exist", file=sys.stderr)
exit(1)


config = PerformanceConfig(
reference_values=reference_values,
pallets=pallet,
Expand Down

0 comments on commit 3d1c2ce

Please sign in to comment.