Exemple #1
0
async def test_networks():
    with patch('aioetherscan.network.Network._set_network') as m:
        c = Client('TestApiKey')
        m.assert_called_once_with('eth', 'main')
        await c.close()

    with patch('aioetherscan.network.Network._set_network') as m:
        c = Client('TestApiKey', 'eth', 'kovan')
        m.assert_called_once_with('eth', 'kovan')
        await c.close()
Exemple #2
0
async def block():
    c = Client('TestApiKey')
    yield c.block
    await c.close()
Exemple #3
0
def test_api_key():
    with pytest.raises(TypeError):
        c = Client()
Exemple #4
0
async def account():
    c = Client('TestApiKey')
    yield c.account
    await c.close()
Exemple #5
0
async def client():
    c = Client('TestApiKey')
    yield c
    await c.close()
Exemple #6
0
async def proxy():
    c = Client('TestApiKey')
    yield c.proxy
    await c.close()
Exemple #7
0
async def stats():
    c = Client('TestApiKey')
    yield c.stats
    await c.close()
Exemple #8
0
async def logs():
    c = Client('TestApiKey')
    yield c.logs
    await c.close()
Exemple #9
0
async def contract():
    c = Client('TestApiKey')
    yield c.contract
    await c.close()
Exemple #10
0
async def transaction():
    c = Client('TestApiKey')
    yield c.transaction
    await c.close()