Add skip balance check flag for testing module

This commit is contained in:
Thales Lima
2024-07-19 22:29:31 +02:00
committed by tvinagre
parent e0c1ba3b50
commit 3ccf0a8a1f
8 changed files with 19 additions and 13 deletions

View File

@@ -135,12 +135,13 @@ class TestRunner:
tycho_balance = int(balance_hex, 16)
token_balances[comp_id][token_lower] = tycho_balance
node_balance = get_token_balance(token, comp_id, stop_block)
if node_balance != tycho_balance:
return TestResult.Failed(
f"Balance mismatch for {comp_id}:{token} at block {stop_block}: got {node_balance} "
f"from rpc call and {tycho_balance} from Substreams"
)
if self.config["skip_balance_check"] is not True:
node_balance = get_token_balance(token, comp_id, stop_block)
if node_balance != tycho_balance:
return TestResult.Failed(
f"Balance mismatch for {comp_id}:{token} at block {stop_block}: got {node_balance} "
f"from rpc call and {tycho_balance} from Substreams"
)
contract_states = self.tycho_runner.get_contract_state()
simulation_failures = self.simulate_get_amount_out(
token_balances,