def test_new_from_at_rest_good_input_v1(self): client = btc.new_from_at_rest({ "version": "1", "name": "banana", "rpc_address": "http://yeah", "testnet": True, "private_key": "KhDH0BKv7n9iFwMc2ClTwJ5zb3R2fTLuQEupXSgoYxo=", "authorization": None, }) self.assertEqual(client.name, "banana") self.assertEqual(client.rpc_address, "http://yeah") self.assertTrue(client.testnet) self.assertEqual(client.priv_key.address, "mzhqDGPpFVxDUhYiDgrdUpzGw4NFBkXPaK") self.assertIsNone(client.authorization)
def get_interchain_client(blockchain: str, name: str) -> "model.InterchainModel": """Get a specific interchain client Args: blockchain: the blockchain of the desired client (i.e. bitcoin, ethereum, etc) name: the name (id) of the network to get (user defined on the creation of the interchain) Raises: exceptions.NotFound: When the requested client can't be found """ if blockchain == "bitcoin": return btc.new_from_at_rest( storage.get_json_from_object(f"{FOLDER}/bitcoin/{name}")) elif blockchain == "ethereum": return eth.new_from_at_rest( storage.get_json_from_object(f"{FOLDER}/ethereum/{name}")) else: raise exceptions.NotFound( f"Blockchain network {blockchain} is not supported")