debug
This commit is contained in:
@ -1,11 +1,17 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from trc20wrapper.transactions import get_transaction_by_hash
|
from trc20wrapper.transactions import get_transactions
|
||||||
|
|
||||||
HASH_ = "36ad0f7e042b6d95b22e3226cee5e61101712cc3d519ac5623da1ab3c42d49a9"
|
HASH_ = "36ad0f7e042b6d95b22e3226cee5e61101712cc3d519ac5623da1ab3c42d49a9"
|
||||||
ADDR = "TEqCBKLNfJsrYaiYXnSVDDx7QvhyWnH9gj"
|
ADDR = "TEqCBKLNfJsrYaiYXnSVDDx7QvhyWnH9gj"
|
||||||
|
|
||||||
|
|
||||||
|
# @pytest.mark.asyncio
|
||||||
|
# async def test_get_transaction_by_hash():
|
||||||
|
# print(await get_transaction_by_hash(ADDR, HASH_))
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_get_transaction_by_hash():
|
async def test_get_transactions():
|
||||||
print(await get_transaction_by_hash(ADDR, HASH_))
|
for tx in await get_transactions(ADDR):
|
||||||
|
print(tx.amount, tx.time)
|
||||||
|
|||||||
@ -54,7 +54,7 @@ async def get_transactions(
|
|||||||
params: dict = {"limit": limit}
|
params: dict = {"limit": limit}
|
||||||
if only_confirmed:
|
if only_confirmed:
|
||||||
params["only_confirmed"] = "true"
|
params["only_confirmed"] = "true"
|
||||||
timeout = aiohttp.ClientTimeout(total=30)
|
timeout = aiohttp.ClientTimeout(total=60)
|
||||||
async with aiohttp.ClientSession(timeout=timeout) as s:
|
async with aiohttp.ClientSession(timeout=timeout) as s:
|
||||||
async with s.get(url, params=params, timeout=timeout) as r:
|
async with s.get(url, params=params, timeout=timeout) as r:
|
||||||
if r.status != 200:
|
if r.status != 200:
|
||||||
|
|||||||
Reference in New Issue
Block a user