def channel_worker(channel_index, transactions): thread_horizon = horizon_instance() channel_keypair = channel_keypairs[channel_index] channel_address = channel_keypair.address().decode() channel_sequence = int(channel_accounts[channel_index].get("sequence")) + 1 failed = [] for i in range(len(transactions)): env = TransactionEnvelope.from_xdr(transactions[i]) env.tx.source = channel_address env.tx.sequence = channel_sequence env.sign(channel_keypair) res = requests.post( "https://horizon-testnet.stellar.org/transactions", data={"tx": env.xdr()}, ) res = res.json() if res["status"] < 400: channel_sequence += 1 else: #print(res) failed.append((i, res)) print("Channel #%d thread finished, %d transaction(s) failed" % (channel_index + 1, len(failed)))
def test_deposit_authenticated_success(client, acc1_usd_deposit_transaction_factory): """`GET /deposit` succeeds with the SEP 10 authentication flow.""" client_address = "GDKFNRUATPH4BSZGVFDRBIGZ5QAFILVFRIRYNSQ4UO7V2ZQAPRNL73RI" client_seed = "SDKWSBERDHP3SXW5A3LXSI7FWMMO5H7HG33KNYBKWH2HYOXJG2DXQHQY" settings.DEPOSIT_AUTH_REQUIRED = True deposit = acc1_usd_deposit_transaction_factory() # SEP 10. response = client.get(f"/auth?account={client_address}", follow=True) content = json.loads(response.content) envelope_xdr = content["transaction"] envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) client_signing_key = Keypair.from_seed(client_seed) envelope_object.sign(client_signing_key) client_signed_envelope_xdr = envelope_object.xdr().decode("ascii") response = client.post( "/auth", data={"transaction": client_signed_envelope_xdr}, content_type="application/json", ) content = json.loads(response.content) encoded_jwt = content["token"] assert encoded_jwt header = {"HTTP_AUTHORIZATION": f"Bearer {encoded_jwt}"} response = client.get( f"/deposit?asset_code=USD&account={deposit.stellar_account}", follow=True, **header, ) content = json.loads(response.content) assert response.status_code == 403 assert content["type"] == "interactive_customer_info_needed"
def test_auth_get_account(client): """`GET <auth>` succeeds with a valid TransactionEnvelope XDR.""" response = client.get(f"/auth?account={STELLAR_ACCOUNT_1}", follow=True) content = json.loads(response.content) assert content["network_passphrase"] == "Test SDF Network ; September 2015" assert content["transaction"] envelope_xdr = content["transaction"] envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) transaction_object = envelope_object.tx assert transaction_object.sequence == 0 assert len(transaction_object.operations) == 1 manage_data_op = transaction_object.operations[0] assert manage_data_op.type_code() == Xdr.const.MANAGE_DATA assert manage_data_op.data_name == "SEP 6 Reference auth" assert len(manage_data_op.data_value) == 64 signatures = envelope_object.signatures assert len(signatures) == 1 server_signature = signatures[0] tx_hash = envelope_object.hash_meta() server_public_key = Keypair.from_address(settings.STELLAR_ACCOUNT_ADDRESS) server_public_key.verify(tx_hash, server_signature.signature)
def __init__(self, developer_secret, te_xdr, address): self.developer_secret = developer_secret self.te = TransactionEnvelope.from_xdr(te_xdr) self.tx = self.te.tx self.address = address self.keypair = self.keypair() self.user_keypair = self.user_keypair() self.time_bounds()
def call(self): te = TransactionEnvelope.from_xdr(xdr=self.xdr) keypair = self.keypair() dev_keypair = self.dev_keypair() self.validate(dev_keypair, te) te.sign(keypair) return te.xdr().decode()
def process_withdrawal(response, withdraw_memo): """ Check if an individual Stellar transaction matches our desired withdrawal memo. """ # Validate the Horizon response. try: memo_type = response["memo_type"] response_memo = response["memo"] successful = response["successful"] stellar_transaction_id = response["id"] envelope_xdr = response["envelope_xdr"] except KeyError: return False if memo_type != "hash": return False # The memo on the response will be base 64 string, due to XDR, while # the memo parameter is base 16. Thus, we convert the parameter # from hex to base 64, and then to a string without trailing whitespace. if response_memo != format_memo_horizon(withdraw_memo): return False # Confirm that the transaction has a matching payment operation, with destination, # amount, and asset type in the response matching those values in the database. transaction = Transaction.objects.filter(withdraw_memo=withdraw_memo).first() if not transaction: return False horizon_tx = TransactionEnvelope.from_xdr(envelope_xdr).tx found_matching_payment_op = False for operation in horizon_tx.operations: if _check_payment_op(operation, transaction.asset.name, transaction.amount_in): found_matching_payment_op = True break # If no matching payment operation is found in the Stellar response, return. if not found_matching_payment_op: return False # If the Stellar transaction succeeded, we mark the corresponding `Transaction` # accordingly in the database. Else, we mark it `pending_stellar`, so the wallet # knows to resubmit. if successful: transaction.completed_at = now() transaction.status = Transaction.STATUS.completed transaction.status_eta = 0 transaction.amount_out = transaction.amount_in - transaction.amount_fee else: transaction.status = Transaction.STATUS.pending_stellar transaction.stellar_transaction_id = stellar_transaction_id transaction.save() return True
def test_transaction_authenticated_success( mock_render, client, acc1_usd_deposit_transaction_factory, acc2_eth_withdrawal_transaction_factory, ): """ Succeeds with expected response if authentication required. Though it filters using the stellar transaction ID, the logic should apply in any case. """ del mock_render client_address = "GDKFNRUATPH4BSZGVFDRBIGZ5QAFILVFRIRYNSQ4UO7V2ZQAPRNL73RI" client_seed = "SDKWSBERDHP3SXW5A3LXSI7FWMMO5H7HG33KNYBKWH2HYOXJG2DXQHQY" acc1_usd_deposit_transaction_factory() withdrawal = acc2_eth_withdrawal_transaction_factory() withdrawal.stellar_address = client_address withdrawal.save() # SEP 10. response = client.get(f"/auth?account={client_address}", follow=True) content = json.loads(response.content) envelope_xdr = content["transaction"] envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) client_signing_key = Keypair.from_seed(client_seed) envelope_object.sign(client_signing_key) client_signed_envelope_xdr = envelope_object.xdr().decode("ascii") response = client.post( "/auth", data={"transaction": client_signed_envelope_xdr}, content_type="application/json", ) content = json.loads(response.content) encoded_jwt = content["token"] assert encoded_jwt # For testing, we make the key `HTTP_AUTHORIZATION`. This is the value that # we expect due to the middleware. header = {"HTTP_AUTHORIZATION": f"Bearer {encoded_jwt}"} response = client.get( f"/transaction?stellar_transaction_id={withdrawal.stellar_transaction_id}", follow=True, **header, ) content = json.loads(response.content) assert response.status_code == 200 withdrawal_transaction = content.get("transaction") assert withdrawal_transaction["kind"] == "withdrawal" assert withdrawal_transaction["status"] == Transaction.STATUS.completed
def test_transactions_authenticated_success( mock_render, client, acc2_eth_withdrawal_transaction_factory, acc2_eth_deposit_transaction_factory, ): """ Response has correct length and status code, if the SEP 10 authentication token is required. """ del mock_render client_address = "GDKFNRUATPH4BSZGVFDRBIGZ5QAFILVFRIRYNSQ4UO7V2ZQAPRNL73RI" client_seed = "SDKWSBERDHP3SXW5A3LXSI7FWMMO5H7HG33KNYBKWH2HYOXJG2DXQHQY" withdrawal = acc2_eth_withdrawal_transaction_factory() withdrawal.stellar_address = client_address withdrawal.save() acc2_eth_deposit_transaction_factory() # SEP 10. response = client.get(f"/auth?account={client_address}", follow=True) content = json.loads(response.content) envelope_xdr = content["transaction"] envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) client_signing_key = Keypair.from_seed(client_seed) envelope_object.sign(client_signing_key) client_signed_envelope_xdr = envelope_object.xdr().decode("ascii") response = client.post( "/auth", data={"transaction": client_signed_envelope_xdr}, content_type="application/json", ) content = json.loads(response.content) encoded_jwt = content["token"] assert encoded_jwt # For testing, we make the key `HTTP_AUTHORIZATION`. This is the value that # we expect due to the middleware. header = {"HTTP_AUTHORIZATION": f"Bearer {encoded_jwt}"} response = client.get( f"/transactions?asset_code={withdrawal.asset.name}&account={withdrawal.stellar_account}", follow=True, **header, ) content = json.loads(response.content) assert len(content.get("transactions")) == 2 assert response.status_code == 200
def _validate_envelope_xdr(envelope_xdr): """ Validate the provided TransactionEnvelope XDR (base64 string). Return the appropriate error if it fails, else the empty string. """ envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) transaction_object = envelope_object.tx if str(transaction_object.source.decode() ) != settings.STELLAR_ACCOUNT_ADDRESS: return "incorrect source account" if transaction_object.sequence != 0: return "incorrect sequence" if len(transaction_object.operations) != 1: return "incorrect number of operations" manage_data_op = transaction_object.operations[0] if manage_data_op.type_code() != Xdr.const.MANAGE_DATA: return "incorrect operation type" if manage_data_op.data_name != ANCHOR_NAME + " auth": return "incorrect data key in managedata" if len(manage_data_op.data_value) != 64: return "invalid data value in managedata" signatures = envelope_object.signatures if len(signatures) != 2: return "incorrect number of signatures" transaction_hash = envelope_object.hash_meta() server_signature = signatures[0] server_public_keypair = Keypair.from_address( settings.STELLAR_ACCOUNT_ADDRESS) try: server_public_keypair.verify(transaction_hash, server_signature.signature) except ed25519.BadSignatureException: return "invalid server signature" client_signature = signatures[1] client_account = manage_data_op.source client_public_keypair = Keypair.from_address(client_account) try: client_public_keypair.verify(transaction_hash, client_signature.signature) except ed25519.BadSignatureError: return "invalid client signature" return ""
def test_auth_post_urlencode_success(client): """`POST <auth>` succeeds when given a proper URL-encoded transaction.""" response = client.get(f"/auth?account={CLIENT_ADDRESS}", follow=True) content = json.loads(response.content) # Sign the XDR with the client. envelope_xdr = content["transaction"] envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) client_signing_key = Keypair.from_seed(CLIENT_SEED) envelope_object.sign(client_signing_key) client_signed_envelope_xdr = envelope_object.xdr().decode("ascii") response = client.post( "/auth", data=f"transaction=<{client_signed_envelope_xdr}>", content_type="application/x-www-form-urlencoded", ) content = json.loads(response.content) assert content["token"]
def _generate_jwt(request, envelope_xdr): """ Generates the JSON web token from the challenge transaction XDR. See: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md#token """ issued_at = time.time() hash_hex = binascii.hexlify( TransactionEnvelope.from_xdr(envelope_xdr).hash_meta()).decode() jwt_dict = { "iss": request.build_absolute_uri("/auth"), "sub": settings.STELLAR_ACCOUNT_ADDRESS, "iat": issued_at, "exp": issued_at + 24 * 60 * 60, "jti": hash_hex, } encoded_jwt = jwt.encode(jwt_dict, settings.SERVER_JWT_KEY, algorithm="HS256") return encoded_jwt.decode("ascii")
def test_fee_authenticated_success(mock_render, client, usd_asset_factory): """Succeeds for a valid fee, with successful authentication.""" del mock_render usd_asset_factory() client_address = "GDKFNRUATPH4BSZGVFDRBIGZ5QAFILVFRIRYNSQ4UO7V2ZQAPRNL73RI" client_seed = "SDKWSBERDHP3SXW5A3LXSI7FWMMO5H7HG33KNYBKWH2HYOXJG2DXQHQY" # SEP 10. response = client.get(f"/auth?account={client_address}", follow=True) content = json.loads(response.content) envelope_xdr = content["transaction"] envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) client_signing_key = Keypair.from_seed(client_seed) envelope_object.sign(client_signing_key) client_signed_envelope_xdr = envelope_object.xdr().decode("ascii") response = client.post( "/auth", data={"transaction": client_signed_envelope_xdr}, content_type="application/json", ) content = json.loads(response.content) encoded_jwt = content["token"] assert encoded_jwt # For testing, we make the key `HTTP_AUTHORIZATION`. This is the value that # we expect due to the middleware. header = {"HTTP_AUTHORIZATION": f"Bearer {encoded_jwt}"} response = client.get( f"/fee?asset_code=USD&operation=withdraw&amount=100.0", follow=True, **header) content = json.loads(response.content) assert response.status_code == 200 assert content == {"fee": 5.0}
def test_changeTrust_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAYAAAABYmVlcgAAAACtrhaIK8Wv+/J1OJRtJAXQfCSoSs/zBzoFRBq/epJAjn//////////AAAAAAAAAAHNPhNjAAAAQL0R9eOS0qesc+HHKQoHMjFUJWvzeQOy+u/7HBHNooo37AOaG85y9jyNoa1D4EduroZmK8vCfCF0V3rn5o9CpgA=' assert (result == Te.from_xdr(result).xdr())
def envelope(self, xdr): return TransactionEnvelope.from_xdr(xdr)
def test_xdr_and_un_xdr(name, xdr_data): assert xdr_data == Te.from_xdr(xdr_data).xdr()
import json import sys import requests from getpass import getpass from stellar_base.keypair import Keypair from stellar_base.stellarxdr import Xdr from stellar_base.transaction_envelope import TransactionEnvelope if len(sys.argv) < 3: print(f'usage: {sys.argv[0]} server_url public_key') print(f'example: {sys.argv[0]} server_url public_key') sys.exit(1) server_url = sys.argv[1] public_key = sys.argv[2] secret_key = getpass("Secret key (won't be displayed): ") response = requests.get(f"{server_url}/api/sep-auth?account={public_key}") content = json.loads(response.content) envelope_xdr = content["transaction"] envelope_object = TransactionEnvelope.from_xdr(envelope_xdr) client_signing_key = Keypair.from_seed(secret_key) envelope_object.sign(client_signing_key) client_signed_envelope_xdr = envelope_object.xdr().decode("ascii") response = requests.post(f"{server_url}/api/sep-auth", json={"transaction": client_signed_envelope_xdr}) content = json.loads(response.content) print(content["token"])
def test_with_textmemo_unXdr(self): result = b'AAAAAOiDfcHkczCk4s7yZjQUk3Bw5I2XbnYE6chMMKI8YJtLAAAAZACBU1YAAAACAAAAAAAAAAEAAAAIdGV4dG1lbW8AAAABAAAAAAAAAAEAAAAAFpAPI0oLC9YB1XuGNOlQ66m2pW2S475yjvCc8hjY4fIAAAAAAAAAADuaygAAAAAAAAAAAjxgm0sAAABAip/qGePkWwafGT0Juy65rZ2jG1PAv5wDoiZSLmTj9DDcYNq/MpZg5cgOht+aqESP+dlFp6Lmz0sO2A5vo49ZD31MZysAAABANgJJyV+XRPZAieaHceV3JWfjyfhWJpqrEpfS0pkDzKbExGIKy9ntfrZS3a4kYE8IQeziRRYxc+tASf+Tgs+EAQ==' assert (result == Te.from_xdr(result).xdr())
def test_createAccount_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAJiWgAAAAAAAAAABzT4TYwAAAEBBR+eUTPqpyTBLiNMudfSl2AN+oZL9/yp0KE9SyYeIzM2Y7yQH+dGNlwz5PMaaCEGAD+82IZkAPSDyunElc+EP' assert (result == Te.from_xdr(result).xdr())
def test_allowTrust_shortAsset_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAcAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAACcG9ja2V0a25pdmVzAAAAAQAAAAAAAAABzT4TYwAAAEBK169VZqBQYUrs+ueQzx/UaANo+7HCdUcpflNvT4e5y7o+T7fxzJ845B3hVr8rrJ27Rz/VVslBWkXmxKoaa8sC' assert (result == Te.from_xdr(result).xdr())
def test_manageOffer_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAMAAAABYmVlcgAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAFiZWVyAAAAAK2uFogrxa/78nU4lG0kBdB8JKhKz/MHOgVEGr96kkCOAAAAADuaygAABMsvAAGGoAAAAAAAAAABAAAAAAAAAAHNPhNjAAAAQBTg1srmkpv/pFqELvCsSurwRPYRUpH05j1sgDzOZdILCdVpxb3sEvMgim1DXE0VhGXqbgZaQV/Sp2VH5C5RKQI=' # TODO print(result) print(Te.from_xdr(result).xdr())
def test_payment_short_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAEAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAACYloAAAAAAAAAAAc0+E2MAAABAzEdbP2ISsB9pDqmIRPt6WEK0GkVOgAEljnelNQjNpDig6A60+jMtveQjdCocL13GwVbO1B8VBXgQdlAobs0fDg==' assert (result == Te.from_xdr(result).xdr())
def test_inflation_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAkAAAAAAAAAAc0+E2MAAABAL2tfdCYqdtfxvINWVZ0iwcROqxQieoBF9cay5AL2oj2oJDrp3F3sYlHQNJi1orkcMLqsxaGtr6DWdnc0vwIBDg==' assert (result == Te.from_xdr(result).xdr())
def test_changeTrust_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAYAAAABYmVlcgAAAACtrhaIK8Wv+/J1OJRtJAXQfCSoSs/zBzoFRBq/epJAjn//////////AAAAAAAAAAHNPhNjAAAAQL0R9eOS0qesc+HHKQoHMjFUJWvzeQOy+u/7HBHNooo37AOaG85y9jyNoa1D4EduroZmK8vCfCF0V3rn5o9CpgA=' assert (result == Te.from_xdr(result).xdr())
def test_payment_short_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAEAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAACYloAAAAAAAAAAAc0+E2MAAABAzEdbP2ISsB9pDqmIRPt6WEK0GkVOgAEljnelNQjNpDig6A60+jMtveQjdCocL13GwVbO1B8VBXgQdlAobs0fDg==' assert (result == Te.from_xdr(result).xdr())
def test_allowTrust_shortAsset_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAcAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAACcG9ja2V0a25pdmVzAAAAAQAAAAAAAAABzT4TYwAAAEBK169VZqBQYUrs+ueQzx/UaANo+7HCdUcpflNvT4e5y7o+T7fxzJ845B3hVr8rrJ27Rz/VVslBWkXmxKoaa8sC' assert (result == Te.from_xdr(result).xdr())
def test_pathPayment_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAIAAAAAAAAAAACYloAAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAACYloAAAAAAAAAAAAAAAAHNPhNjAAAAQFwSz9wwBEWCv9cNnuIq+Jjq36mXBI22f6uj/FZ6LbyLljkckSLkF/AqXcaOoOgY9mZ0NrXsHbA5/chSThtgMgQ=' # TODO assert (result == Te.from_xdr(result).xdr())
def test_createAccount_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAJiWgAAAAAAAAAABzT4TYwAAAEBBR+eUTPqpyTBLiNMudfSl2AN+oZL9/yp0KE9SyYeIzM2Y7yQH+dGNlwz5PMaaCEGAD+82IZkAPSDyunElc+EP' assert (result == Te.from_xdr(result).xdr())
def test_accountMerge_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAc0+E2MAAABADFSYbdlswOKfK4Y02Tz/j5j83c7f5YvLe+QxmXcHSd/W8ika63MsM6CDkDZhjRx4+Nt+mfCKpKbP7j0NPzNhCQ==' assert (result == Te.from_xdr(result).xdr())
def test_pathPayment_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAIAAAAAAAAAAACYloAAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAACYloAAAAAAAAAAAAAAAAHNPhNjAAAAQFwSz9wwBEWCv9cNnuIq+Jjq36mXBI22f6uj/FZ6LbyLljkckSLkF/AqXcaOoOgY9mZ0NrXsHbA5/chSThtgMgQ=' # TODO assert (result == Te.from_xdr(result).xdr())
def test_inflation_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAkAAAAAAAAAAc0+E2MAAABAL2tfdCYqdtfxvINWVZ0iwcROqxQieoBF9cay5AL2oj2oJDrp3F3sYlHQNJi1orkcMLqsxaGtr6DWdnc0vwIBDg==' assert (result == Te.from_xdr(result).xdr())
def test_accountMerge_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAra4WiCvFr/vydTiUbSQF0HwkqErP8wc6BUQav3qSQI4AAAAAAAAAAc0+E2MAAABADFSYbdlswOKfK4Y02Tz/j5j83c7f5YvLe+QxmXcHSd/W8ika63MsM6CDkDZhjRx4+Nt+mfCKpKbP7j0NPzNhCQ==' assert (result == Te.from_xdr(result).xdr())
def test_createPassiveOffer_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAQAAAABYmVlcgAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAFiZWVyAAAAAK2uFogrxa/78nU4lG0kBdB8JKhKz/MHOgVEGr96kkCOAAAAADuaygAABMsvAAGGoAAAAAAAAAABzT4TYwAAAEAm4lQf6g7mpnw05syhOt3ub+OmSADhSfLwn/xg6bD+6qwqlpF/xflNYWKU1uQOy4P9e1+SWIGJdR+KWryykS0M' # TODO assert (result == Te.from_xdr(result).xdr())
def test_createPassiveOffer_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAQAAAABYmVlcgAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAFiZWVyAAAAAK2uFogrxa/78nU4lG0kBdB8JKhKz/MHOgVEGr96kkCOAAAAADuaygAABMsvAAGGoAAAAAAAAAABzT4TYwAAAEAm4lQf6g7mpnw05syhOt3ub+OmSADhSfLwn/xg6bD+6qwqlpF/xflNYWKU1uQOy4P9e1+SWIGJdR+KWryykS0M' # TODO assert (result == Te.from_xdr(result).xdr())
def test_manageOffer_min_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAMAAAABYmVlcgAAAADTUozdcK3X4scPuMNM5il78cYpIOhCjIvUltQ5zT4TYwAAAAFiZWVyAAAAAK2uFogrxa/78nU4lG0kBdB8JKhKz/MHOgVEGr96kkCOAAAAADuaygAABMsvAAGGoAAAAAAAAAABAAAAAAAAAAHNPhNjAAAAQBTg1srmkpv/pFqELvCsSurwRPYRUpH05j1sgDzOZdILCdVpxb3sEvMgim1DXE0VhGXqbgZaQV/Sp2VH5C5RKQI=' # TODO print(result) print(Te.from_xdr(result).xdr())
def test_SetOptions_empty_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAc0+E2MAAABAymdhj3dFg+3TcCRILXdUu8ZhG3WOuBmX3YXcYJhYemjCDylQEk31vF8wxB/ntRg4/vmCYC2IwhBtw1mJZ8h+Bw==' assert (result == Te.from_xdr(result).xdr())
def test_SetOptions_empty_unXdr(self): result = b'AAAAANNSjN1wrdfixw+4w0zmKXvxxikg6EKMi9SW1DnNPhNjAAAAZAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAc0+E2MAAABAymdhj3dFg+3TcCRILXdUu8ZhG3WOuBmX3YXcYJhYemjCDylQEk31vF8wxB/ntRg4/vmCYC2IwhBtw1mJZ8h+Bw==' assert (result == Te.from_xdr(result).xdr())