diff --git a/testing/src/runner/cli.py b/testing/src/runner/cli.py index 1fe82b6..f1d2c05 100644 --- a/testing/src/runner/cli.py +++ b/testing/src/runner/cli.py @@ -1,5 +1,5 @@ import argparse -from runner import TestRunner +from .runner import TestRunner def main() -> None: diff --git a/testing/src/runner/runner.py b/testing/src/runner/runner.py index 7324927..15c7745 100644 --- a/testing/src/runner/runner.py +++ b/testing/src/runner/runner.py @@ -140,7 +140,17 @@ class TestRunner: return TestResult.Failed( f"Missing '{key}' in component '{comp_id}'." ) - if isinstance(value, list): + if key == "tokens": + if set(map(HexBytes, value)) != set(component[key]): + return TestResult.Failed( + f"Token mismatch for key '{key}': {value} != {component[key]}" + ) + elif key == "creation_tx": + if HexBytes(value) != component[key]: + return TestResult.Failed( + f"Creation tx mismatch for key '{key}': {value} != {component[key]}" + ) + elif isinstance(value, list): if set(map(str.lower, value)) != set( map(str.lower, component[key]) ): @@ -165,10 +175,10 @@ class TestRunner: None, ) if state: - balance_hex = state["balances"].get(token, "0x0") + balance_hex = state.balances.get(token, "0x0") else: balance_hex = "0x0" - tycho_balance = int(balance_hex, 16) + tycho_balance = int(balance_hex) token_balances[comp_id][token] = tycho_balance if self.config["skip_balance_check"] is not True: @@ -227,7 +237,7 @@ class TestRunner: ) failed_simulations: dict[str, list[SimulationFailure]] = dict() - for protocol in protocol_type_names: + for _ in protocol_type_names: adapter_contract = os.path.join( self.adapters_src, "out",