$ git clone https://github.com/hermesloom/algorand-node-fly
$ cd algorand-node-fly
$ local/setup.sh 10000 EUR
< /code>
Последний шаг сценария настройки состоит в том, что он запускает модульные тесты из test.py в этом хранилище, особенно в этом: < /p>
def test_04_transfer_funds(self):
"""Test transferring funds from genesis to a new test account."""
try:
# Create a test account to transfer funds to
test_account = self.create_test_account()
# Transfer funds from genesis to test account
result = self.api_client.transfer(
self.genesis_address,
self.genesis_mnemonic,
test_account["address"],
self.test_transfer_amount,
"Test transfer",
)
# Check result
self.assertIn("tx_id", result)
self.assertIn("status", result)
tx_id = result["tx_id"]
print(f"Transfer initiated with transaction ID: {tx_id}")
# If status is pending, wait briefly for confirmation
if result["status"] == "pending":
print("Transaction pending, waiting 5 seconds for confirmation...")
time.sleep(5)
# Verify the balance was received by checking the test account
account_info = self.api_client.get_balance(
test_account["address"], test_account["mnemonic"]
)
self.assertIn("balance", account_info)
balance = account_info["balance"]
# The test account should have the transferred amount (or potentially more)
self.assertGreaterEqual(
balance,
self.test_transfer_amount,
f"Test account balance {balance} is less than transfer amount {self.test_transfer_amount}",
)
print(f"Test account received {balance} picoXDRs")
except Exception as e:
self.fail(f"Failed to transfer funds and verify: {e}")
< /code>
Конечная точка передачи использует Algosdk, как это: < /p>
@app.route("/api/transfer", methods=["POST"])
def transfer_funds():
"""Transfer funds from one account to another with mnemonic authentication."""
# Basic rate limiting
client_ip = request.remote_addr
if rate_limit(client_ip):
return jsonify({"error": "Rate limit exceeded"}), 429
try:
data = request.get_json()
sender_address = data.get("from")
sender_mnemonic = data.get("mnemonic")
receiver_address = data.get("to")
amount = data.get("amount")
note = data.get("note", "")
# Validate inputs
if not all([sender_address, sender_mnemonic, receiver_address, amount]):
return jsonify({"error": "Missing required fields"}), 400
try:
amount = int(amount)
if amount
И когда я запускаю модульный тест, я получаю эту ошибку: < /p>
FAIL: test_04_transfer_funds (__main__.AlgorandAPITest.test_04_transfer_funds)
Test transferring funds from genesis to a new test account.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/nalenz/Programmierung/algorand-node-fly/local/test.py", line 222, in test_04_transfer_funds
result = self.api_client.transfer(
self.genesis_address,
......
"Test transfer",
)
File "/Users/nalenz/Programmierung/algorand-node-fly/local/api_client.py", line 70, in transfer
raise Exception(f"Error transferring funds: {response.text}")
Exception: Error transferring funds: {"error":"Failed to transfer funds: TransactionPool.Remember: TransactionPool.ingest: no pending block evaluator"}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/nalenz/Programmierung/algorand-node-fly/local/test.py", line 260, in test_04_transfer_funds
self.fail(f"Failed to transfer funds and verify: {e}")
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Failed to transfer funds and verify: Error transferring funds: {"error":"Failed to transfer funds: TransactionPool.Remember: TransactionPool.ingest: no pending block evaluator"}
Как можно исправить эту проблему «без ожидаемого оценки блока»?
Я в настоящее время пробую алгоран, с намерением самостоятельно управлять совершенно новой сетью с одной командой.[code]$ git clone https://github.com/hermesloom/algorand-node-fly $ cd algorand-node-fly $ local/setup.sh 10000 EUR < /code> Последний шаг сценария настройки состоит в том, что он запускает модульные тесты из test.py в этом хранилище, особенно в этом: < /p> def test_04_transfer_funds(self): """Test transferring funds from genesis to a new test account.""" try: # Create a test account to transfer funds to test_account = self.create_test_account()
# Transfer funds from genesis to test account result = self.api_client.transfer( self.genesis_address, self.genesis_mnemonic, test_account["address"], self.test_transfer_amount, "Test transfer", )
# Check result self.assertIn("tx_id", result) self.assertIn("status", result) tx_id = result["tx_id"]
print(f"Transfer initiated with transaction ID: {tx_id}")
# If status is pending, wait briefly for confirmation if result["status"] == "pending": print("Transaction pending, waiting 5 seconds for confirmation...") time.sleep(5)
# Verify the balance was received by checking the test account account_info = self.api_client.get_balance( test_account["address"], test_account["mnemonic"] )
# The test account should have the transferred amount (or potentially more) self.assertGreaterEqual( balance, self.test_transfer_amount, f"Test account balance {balance} is less than transfer amount {self.test_transfer_amount}", )
print(f"Test account received {balance} picoXDRs")
except Exception as e: self.fail(f"Failed to transfer funds and verify: {e}") < /code> Конечная точка передачи использует Algosdk, как это: < /p> @app.route("/api/transfer", methods=["POST"]) def transfer_funds(): """Transfer funds from one account to another with mnemonic authentication.""" # Basic rate limiting client_ip = request.remote_addr if rate_limit(client_ip): return jsonify({"error": "Rate limit exceeded"}), 429
# Validate inputs if not all([sender_address, sender_mnemonic, receiver_address, amount]): return jsonify({"error": "Missing required fields"}), 400
try: amount = int(amount) if amount И когда я запускаю модульный тест, я получаю эту ошибку: < /p> FAIL: test_04_transfer_funds (__main__.AlgorandAPITest.test_04_transfer_funds) Test transferring funds from genesis to a new test account. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/nalenz/Programmierung/algorand-node-fly/local/test.py", line 222, in test_04_transfer_funds result = self.api_client.transfer( self.genesis_address, ...... "Test transfer", ) File "/Users/nalenz/Programmierung/algorand-node-fly/local/api_client.py", line 70, in transfer raise Exception(f"Error transferring funds: {response.text}") Exception: Error transferring funds: {"error":"Failed to transfer funds: TransactionPool.Remember: TransactionPool.ingest: no pending block evaluator"}
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/nalenz/Programmierung/algorand-node-fly/local/test.py", line 260, in test_04_transfer_funds self.fail(f"Failed to transfer funds and verify: {e}") ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: Failed to transfer funds and verify: Error transferring funds: {"error":"Failed to transfer funds: TransactionPool.Remember: TransactionPool.ingest: no pending block evaluator"} [/code] Как можно исправить эту проблему «без ожидаемого оценки блока»?
Как и в у нас есть производныйStateOf, который помогает предотвратить ненужную рекомпозицию.
При этом это заставляет меня задуматься, должны ли мы всегда использовать DerivedStateOf вместо Remember(value), как показано ниже?
// Instead of using...
Я проигнорировал google-services.json в своем репозитории, но я использую Github Actions для сборки APK, поэтому в конечном итоге мне понадобится этот файл google-services.json, Я следил за статьей, в которой предлагается закодировать файл,...
Я пытаюсь импортировать azure.kusto.ingest в своем скрипте Python, но я получаю импортерровку, утверждая, что модуль не может быть найден.
Я уже установил Требуемый пакет с использованием:
pip install azure-kusto-ingest
Чтобы подтвердить, что...
Я пытаюсь импортировать azure.kusto.ingest в своем скрипте Python, но я получаю импортерровку, утверждая, что модуль не может быть найден.
Я уже установил Требуемый пакет с использованием:
pip install azure-kusto-ingest
Чтобы подтвердить, что...