def parse_list_known_contracts_response(self, response):
     dict = {}
     for line in response.splitlines():
         line = line.strip()
         if ":" in line and not_indicator_line(line):
             alias, pkh = line.split(":", maxsplit=1)
             dict[alias.strip()] = pkh.strip()
     if self.verbose:
         logger.debug("known contracts: {}".format(dict))
     return dict
Пример #2
0
    def parse_list_known_addresses_response(self, response):
        dict = {}

        for line in response.splitlines():
            line = line.strip()
            if ":" in line and not_indicator_line(line):
                alias, pkh_plus_braces = line.split(":", maxsplit=1)
                pkh_plus_braces = pkh_plus_braces.replace(' (', ':')
                if ':' in pkh_plus_braces:
                    pkh, sk_section = pkh_plus_braces.split(":", maxsplit=1)
                else:
                    pkh = pkh_plus_braces.strip()
                    sk_section = ""
                sk_known = "sk known" in sk_section
                pkh = pkh.strip()
                alias = alias.strip()
                dict[pkh] = {"alias": alias, "sk": sk_known}

            verbose_logger.debug("known addresses: {}".format(dict))

        return dict