コード例 #1
0
    def test_login(self):
        password = "******"
        secrets_manager = ETHKeyFileSecretManger(password)
        store_password_verification(secrets_manager)

        Security.login(secrets_manager)
        config_map = self.store_binance_config()
        self.async_run_with_timeout(Security.wait_til_decryption_done(), timeout=2)

        self.assertTrue(Security.is_decryption_done())
        self.assertTrue(Security.any_secure_configs())
        self.assertTrue(Security.connector_config_file_exists(self.connector))

        api_keys = Security.api_keys(self.connector)
        expected_keys = api_keys_from_connector_config_map(config_map)

        self.assertEqual(expected_keys, api_keys)
コード例 #2
0
 async def export_keys(self,  # type: HummingbotApplication
                       ):
     await Security.wait_til_decryption_done()
     if not Security.any_secure_configs():
         self.notify("There are no keys to export.")
         return
     self.placeholder_mode = True
     self.app.hide_input = True
     if await self.check_password():
         self.notify("\nWarning: Never disclose API keys or private keys. Anyone with your keys can steal any "
                     "assets held in your account.")
         self.notify("\nAPI keys:")
         for key, cm in Security.all_decrypted_values().items():
             for el in cm.traverse(secure=False):
                 if el.client_field_data is not None and el.client_field_data.is_secure:
                     self.notify(f"{el.attr}: {el.printable_value}")
     self.app.change_prompt(prompt=">>> ")
     self.app.hide_input = False
     self.placeholder_mode = False