def is_code(self): '''Determine whether any contract is set to the account. Return: True if the retrieved hash code of the contract code is not null. ''' get_code = cleos_get.GetCode(self.name, is_verbose=False) if get_code.code_hash == \ "0000000000000000000000000000000000000000000000000000000000000000": return "" else: return get_code.code_hash
def code(self, code=None, abi=None, wasm=False): '''Retrieve the code and ABI Args: code (str): If set, the name of the file to save the contract WAST/WASM to. abi (str): If set, the name of the file to save the contract ABI to. wasm (bool): Save contract as wasm. ''' result = cleos_get.GetCode(self, is_verbose=False) logger.INFO(''' * code() ''') logger.OUT(str(result))