feat: Request only contracts of interest

Instead of requesting all contracts just get what is specified by the components.
This commit is contained in:
kayibal
2024-08-07 13:47:21 +02:00
committed by tvinagre
parent 9f4503e2a9
commit e302bfb4a6

View File

@@ -23,6 +23,7 @@ from tycho_client.dto import (
HexBytes, HexBytes,
ResponseAccount, ResponseAccount,
Snapshot, Snapshot,
ContractId,
) )
from tycho_client.rpc_client import TychoRPCClient from tycho_client.rpc_client import TychoRPCClient
@@ -185,7 +186,13 @@ class TestRunner:
f"from rpc call and {tycho_balance} from Substreams" f"from rpc call and {tycho_balance} from Substreams"
) )
contract_states = self.tycho_rpc_client.get_contract_state( contract_states = self.tycho_rpc_client.get_contract_state(
ContractStateParams() ContractStateParams(
contract_ids=[
ContractId(chain=self._chain, address=a)
for component in protocol_components
for a in component.contract_ids
]
)
) )
filtered_components = [ filtered_components = [
pc pc