示例#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()
示例#2
0
async def block():
    c = Client('TestApiKey')
    yield c.block
    await c.close()
示例#3
0
def test_api_key():
    with pytest.raises(TypeError):
        c = Client()
示例#4
0
async def account():
    c = Client('TestApiKey')
    yield c.account
    await c.close()
示例#5
0
async def client():
    c = Client('TestApiKey')
    yield c
    await c.close()
示例#6
0
async def proxy():
    c = Client('TestApiKey')
    yield c.proxy
    await c.close()
示例#7
0
async def stats():
    c = Client('TestApiKey')
    yield c.stats
    await c.close()
示例#8
0
async def logs():
    c = Client('TestApiKey')
    yield c.logs
    await c.close()
示例#9
0
async def contract():
    c = Client('TestApiKey')
    yield c.contract
    await c.close()
示例#10
0
async def transaction():
    c = Client('TestApiKey')
    yield c.transaction
    await c.close()