Skip to content

Commit

Permalink
fix: query validators.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinyuchan committed Jul 8, 2024
1 parent e36d0e7 commit 84377cb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions indexer/src/validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ pub async fn get_validators(
let page_size = params.page_size.unwrap_or(10);

let mut sql_total = "SELECT count(ev.block_num) \
FROM evm_validators ev \
LEFT JOIN evm_stakes es \
ON ev.validator=es.validator \
FROM evm_stakes es \
LEFT JOIN evm_validators ev \
ON es.validator=ev.validator \
WHERE ev.block_num=(SELECT max(block_num) FROM evm_validators) "
.to_string();

let mut sql_query = "SELECT ev.validator,ev.pubkey,ev.pubkey_type,ev.rate,ev.staker,ev.power,\
ev.unbound,ev.punish_rate,ev.begin_block,ev.active,ev.jailed,ev.unjail_time,ev.should_vote,ev.voted,es.memo \
FROM evm_validators ev \
LEFT JOIN evm_stakes es \
ON ev.validator=es.validator \
FROM evm_stakes es \
LEFT JOIN evm_validators ev \
ON es.validator=ev.validator \
WHERE ev.block_num=(SELECT max(block_num) FROM evm_validators) ".to_string();

let mut query_params: Vec<String> = vec![];
Expand Down

0 comments on commit 84377cb

Please sign in to comment.