agent0.test_fixtures.chain_fixture

Local chain connected to a local database hosted in docker.

Functions

launch_chain(...)

Launches a local chain.

chain_fixture(...)

Local chain connected to a local database hosted in docker.

init_chain(...)

Local chain connected to a local database hosted in docker.

fast_chain_fixture(...)

Local chain connected to a local database hosted in docker.

Module Contents

agent0.test_fixtures.chain_fixture.launch_chain(port_base) agent0.core.hyperdrive.interactive.LocalChain

Launches a local chain.

Parameters:

port_base (int) – The base port number to use for the chain and database. The chain port will be port_base, and the database port will be port_base + 1.

Returns:

The local chain.

Return type:

LocalChain

agent0.test_fixtures.chain_fixture.chain_fixture() Iterator[agent0.core.hyperdrive.interactive.LocalChain]

Local chain connected to a local database hosted in docker. This fixture launches a chain from scratch in a function scope.

Yields:

LocalChain – The local chain instance.

agent0.test_fixtures.chain_fixture.init_chain() Iterator[agent0.core.hyperdrive.interactive.LocalChain]

Local chain connected to a local database hosted in docker. This fixture launches a chain from scratch in a session scope.

Yields:

LocalChain – local chain instance.

agent0.test_fixtures.chain_fixture.fast_chain_fixture(init_chain: agent0.core.hyperdrive.interactive.LocalChain) Iterator[agent0.core.hyperdrive.interactive.LocalChain]

Local chain connected to a local database hosted in docker. This fixture uses snapshot on an existing chain in a function scope.

Note

This chain is booted from an existing snapshot for speed. If you save a new snapshot the first will be overwritten.

Parameters:

init_chain (LocalChain) – Session scoped chain fixture.

Yields:

LocalChain – Local chain instance.