Skip to content

Commit 5e64905

Browse files
authored
fix: import additional services only when necessary (#597)
1 parent 870acbf commit 5e64905

1 file changed

Lines changed: 19 additions & 26 deletions

File tree

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,47 @@
1-
arpeggio = import_module("./arpeggio.star")
2-
assertoor = import_module("./assertoor.star")
3-
blockscout = import_module("./blockscout.star")
4-
blutgang = import_module("./blutgang.star")
5-
bridge_spammer = import_module("./bridge_spammer.star")
61
constants = import_module("../package_io/constants.star")
7-
erpc = import_module("./erpc.star")
8-
grafana = import_module("./grafana.star")
9-
panoptichain = import_module("./panoptichain.star")
10-
pless_zkevm_node = import_module("./pless_zkevm_node.star")
11-
prometheus = import_module("./prometheus.star")
12-
status_checker = import_module("./status_checker.star")
13-
test_runner = import_module("./test_runner.star")
14-
tx_spammer = import_module("./tx_spammer.star")
152

163

174
def launch(
185
plan, args, contract_setup_addresses, genesis_artifact, deploy_optimism_rollup=False
196
):
207
for svc in args.get("additional_services", []):
218
if svc == constants.ADDITIONAL_SERVICES.arpeggio:
22-
arpeggio.run(plan, args)
9+
import_module("./arpeggio.star").run(plan, args)
2310
elif svc == constants.ADDITIONAL_SERVICES.assertoor:
24-
assertoor.run(plan, args)
11+
import_module("./assertoor.star").run(plan, args)
2512
elif svc == constants.ADDITIONAL_SERVICES.blockscout:
26-
blockscout.run(plan, args)
13+
import_module("./blockscout.star").run(plan, args)
2714
elif svc == constants.ADDITIONAL_SERVICES.blutgang:
28-
blutgang.run(plan, args)
15+
import_module("./blutgang.star").run(plan, args)
2916
elif svc == constants.ADDITIONAL_SERVICES.bridge_spammer:
30-
bridge_spammer.run(plan, args, contract_setup_addresses)
17+
import_module("./bridge_spammer.star").run(
18+
plan, args, contract_setup_addresses
19+
)
3120
elif svc == constants.ADDITIONAL_SERVICES.erpc:
32-
erpc.run(plan, args)
21+
import_module("./erpc.star").run(plan, args)
3322
elif svc == constants.ADDITIONAL_SERVICES.pless_zkevm_node:
3423
# Note that an additional suffix will be added to the permissionless services.
3524
permissionless_node_args = dict(args)
3625
permissionless_node_args["original_suffix"] = args["deployment_suffix"]
3726
permissionless_node_args["deployment_suffix"] = (
3827
"-pless" + args["deployment_suffix"]
3928
)
40-
pless_zkevm_node.run(plan, permissionless_node_args, genesis_artifact)
29+
import_module("./pless_zkevm_node.star").run(
30+
plan, permissionless_node_args, genesis_artifact
31+
)
4132
elif svc == constants.ADDITIONAL_SERVICES.observability:
42-
panoptichain.run(plan, args, contract_setup_addresses)
43-
prometheus.run(plan, args)
44-
grafana.run(plan, args)
33+
import_module("./panoptichain.star").run(
34+
plan, args, contract_setup_addresses
35+
)
36+
import_module("./prometheus.star").run(plan, args)
37+
import_module("./grafana.star").run(plan, args)
4538
elif svc == constants.ADDITIONAL_SERVICES.status_checker:
46-
status_checker.run(plan, args)
39+
import_module("./status_checker.star").run(plan, args)
4740
elif svc == constants.ADDITIONAL_SERVICES.test_runner:
48-
test_runner.run(
41+
import_module("./test_runner.star").run(
4942
plan, args, contract_setup_addresses, deploy_optimism_rollup
5043
)
5144
elif svc == constants.ADDITIONAL_SERVICES.tx_spammer:
52-
tx_spammer.run(plan, args, contract_setup_addresses)
45+
import_module("./tx_spammer.star").run(plan, args, contract_setup_addresses)
5346
else:
5447
fail("Invalid additional service: %s" % (svc))

0 commit comments

Comments
 (0)