예제 #1
0
 async def validate_n_connect_celo(self, to_reconnect: bool = False, celo_address: str = None,
                                   celo_password: str = None) -> Optional[str]:
     if celo_address is None:
         celo_address = global_config_map["celo_address"].value
     if celo_password is None:
         await Security.wait_til_decryption_done()
         celo_password = Security.decrypted_value("celo_password")
     if celo_address is None or celo_password is None:
         return "Celo address and/or password have not been added."
     if CeloCLI.unlocked and not to_reconnect:
         return None
     err_msg = CeloCLI.validate_node_synced()
     if err_msg is not None:
         return err_msg
     err_msg = CeloCLI.unlock_account(celo_address, celo_password)
     return err_msg
예제 #2
0
 def test_validate_node_synced(self):
     err_msg = CeloCLI.validate_node_synced()
     self.assertEqual(None, err_msg)