search escaped
@@ -609,17 +609,19 @@ impl StorageProcessor {
committed.block_number = verified.block_number
and action_type = 'Verify'
where false
- or lower(commit_tx_hash) = '{tx_hash}'
- or lower(verified.tx_hash) = '{tx_hash}'
- or lower(new_state_root) = '{tx_hash}'
+ or lower(commit_tx_hash) = $1
+ or lower(verified.tx_hash) = $2
+ or lower(new_state_root) = $3
or committed.block_number = {block_number}
order by committed.block_number desc
limit 1
",
- tx_hash = query_with_prefix.as_str(),
block_number = block_number as i32
);
let result = diesel::sql_query(sql_query)
+ .bind::<Text, _>(query_with_prefix.clone())
+ .bind::<Text, _>(query_with_prefix.clone())
+ .bind::<Text, _>(query_with_prefix.clone())
.get_result(self.conn())
.ok();
result
