Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reading contract states contextually #61

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion chaindexing/src/contract_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ pub trait ContractState:
) -> Vec<Self> {
let client = context.raw_query_client;

let context_chain_id = context.event.chain_id as u64;
let context_contract_address = context.event.contract_address.clone();

let raw_query = format!(
"SELECT * FROM {table_name} WHERE {filters}",
"SELECT * FROM {table_name}
WHERE {filters}
AND chain_id={context_chain_id} AND contract_address='{context_contract_address}'",
table_name = Self::table_name(),
filters = to_and_filters(&filters),
);
Expand Down
Loading