refactor(testing): miscellaneous improvements and bugfixes
Includes bugfix on `tycho-indexer-client` and `protosim_py`, a script to simplify setting up testing python env and cli improvements. Also add support for building runtime for SwapAdapters with many args that was bugged before.
This commit is contained in:
@@ -8,10 +8,13 @@ def main() -> None:
|
||||
)
|
||||
parser.add_argument("--package", type=str, help="Name of the package to test.")
|
||||
parser.add_argument(
|
||||
"--tycho-logs", action="store_true", help="Flag to activate logs from Tycho."
|
||||
"--tycho-logs", action="store_true", help="Enable Tycho logs."
|
||||
)
|
||||
parser.add_argument(
|
||||
"--db-url", type=str, help="Postgres database URL for the Tycho indexer."
|
||||
"--db-url",
|
||||
default="postgres://postgres:mypassword@localhost:5431/tycho_indexer_0",
|
||||
type=str,
|
||||
help="Postgres database URL for the Tycho indexer. Default: postgres://postgres:mypassword@localhost:5431/tycho_indexer_0",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--vm-traces", action="store_true", help="Enable tracing during vm simulations."
|
||||
|
||||
@@ -4,8 +4,6 @@ from hexbytes import HexBytes
|
||||
from pydantic import BaseModel, Field, validator
|
||||
from typing import List, Dict, Optional
|
||||
|
||||
from tycho_client.dto import ProtocolComponent
|
||||
|
||||
|
||||
class ProtocolComponentExpectation(BaseModel):
|
||||
"""Represents a ProtocolComponent with its main attributes."""
|
||||
|
||||
@@ -14,7 +14,7 @@ from protosim_py.evm.decoders import ThirdPartyPoolTychoDecoder
|
||||
from protosim_py.evm.storage import TychoDBSingleton
|
||||
from protosim_py.models import EVMBlock
|
||||
from pydantic import BaseModel
|
||||
from tycho_client.dto import (
|
||||
from tycho_indexer_client.dto import (
|
||||
Chain,
|
||||
ProtocolComponentsParams,
|
||||
ProtocolStateParams,
|
||||
@@ -26,7 +26,7 @@ from tycho_client.dto import (
|
||||
Snapshot,
|
||||
ContractId,
|
||||
)
|
||||
from tycho_client.rpc_client import TychoRPCClient
|
||||
from tycho_indexer_client.rpc_client import TychoRPCClient
|
||||
|
||||
from models import (
|
||||
IntegrationTestsConfig,
|
||||
|
||||
@@ -27,12 +27,15 @@ def find_binary_file(file_name):
|
||||
|
||||
# Check each location
|
||||
for location in locations:
|
||||
potential_path = location + "/" + file_name
|
||||
potential_path = os.path.join(location, file_name)
|
||||
if os.path.exists(potential_path):
|
||||
return potential_path
|
||||
|
||||
# If binary is not found in the usual locations, return None
|
||||
raise RuntimeError("Unable to locate tycho-indexer binary")
|
||||
searched_paths = "\n".join(locations)
|
||||
raise RuntimeError(
|
||||
f"Unable to locate {file_name} binary. Searched paths:\n{searched_paths}"
|
||||
)
|
||||
|
||||
|
||||
binary_path = find_binary_file("tycho-indexer")
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Union
|
||||
|
||||
from eth_utils import to_checksum_address
|
||||
from protosim_py.models import EthereumToken
|
||||
from tycho_client.dto import (
|
||||
from tycho_indexer_client.dto import (
|
||||
ResponseProtocolState,
|
||||
ProtocolComponent,
|
||||
ResponseAccount,
|
||||
@@ -13,7 +13,7 @@ from tycho_client.dto import (
|
||||
TokensParams,
|
||||
PaginationParams,
|
||||
)
|
||||
from tycho_client.rpc_client import TychoRPCClient
|
||||
from tycho_indexer_client.rpc_client import TychoRPCClient
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user