From b9cc98dae4a005e89cf421240fe244885f253c99 Mon Sep 17 00:00:00 2001 From: "A.Bescond" Date: Thu, 22 Sep 2022 07:33:35 +0200 Subject: [PATCH] Do not check signer/validate address in dry run mode (#615) * Do not check signer in dry run mode * Update contributors.csv * Contributor: redref, Effort=1h * Reviewer: vkresch, Effort=0.5h --- contributors.csv | 1 + src/config/yaml_baking_conf_parser.py | 5 ++++- src/configure.py | 1 + src/util/config_life_cycle.py | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contributors.csv b/contributors.csv index a3577f8b..5d11324a 100644 --- a/contributors.csv +++ b/contributors.csv @@ -13,3 +13,4 @@ sebuhbitcoin, tz1R664EP6wjcM1RSUVJ7nrJisTpBW9QyJzP, Documentation and testing an ericlavoie, tz1ekt9uG1SdHQ6dc175uANbFPgbMM5iciGq, Core developer - helping out where I can pea-io, tz1RVXV1KVPprRcgffz1DrsqKwnLG3ZT9NEw, Contributed to the Docker image NeoktaLabs, tz1UvkANVPWppVgMkLnvN7BwYZsCP7vm6NVd, Contributed to testing of TRD +redref, tz3Vq38qYD3GEbWcXHMLt5PaASZrkDtEiA8D, Contributed to dry-run mode without signer diff --git a/src/config/yaml_baking_conf_parser.py b/src/config/yaml_baking_conf_parser.py index 546f7b06..6ccc330a 100644 --- a/src/config/yaml_baking_conf_parser.py +++ b/src/config/yaml_baking_conf_parser.py @@ -50,6 +50,7 @@ def __init__( node_url, block_api=None, api_base_url=None, + dry_run=False, ) -> None: super().__init__(yaml_text) self.clnt_mngr = clnt_mngr @@ -59,6 +60,7 @@ def __init__( network_config, node_url, api_base_url=api_base_url ) self.block_api = block_api + self.dry_run = dry_run def parse(self): yaml_conf_dict = super().parse() @@ -191,7 +193,8 @@ def validate_payment_address(self, conf_obj): ) if len(pymnt_addr) == PKH_LENGHT and pymnt_addr.startswith("tz"): - self.clnt_mngr.check_pkh_known_by_signer(pymnt_addr) + if not self.dry_run: + self.clnt_mngr.check_pkh_known_by_signer(pymnt_addr) conf_obj[("__%s_type" % PAYMENT_ADDRESS)] = AddrType.TZ conf_obj[("__%s_pkh" % PAYMENT_ADDRESS)] = pymnt_addr diff --git a/src/configure.py b/src/configure.py index 5668ee3b..b199e2af 100644 --- a/src/configure.py +++ b/src/configure.py @@ -114,6 +114,7 @@ def onbakingaddress(input): network_config, args.node_endpoint, api_base_url=args.api_base_url, + dry_run=args.dry_run, ) parser.set(BAKING_ADDRESS, input) fsm.go() diff --git a/src/util/config_life_cycle.py b/src/util/config_life_cycle.py index 31f3e751..6478ec6d 100644 --- a/src/util/config_life_cycle.py +++ b/src/util/config_life_cycle.py @@ -116,6 +116,7 @@ def do_build_parser(self, e): network_config=self.__nw_cfg, node_url=self.args.node_endpoint, api_base_url=self.args.api_base_url, + dry_run=self.args.dry_run, ) def do_parse_cfg(self, e):