Skip to content

Commit

Permalink
Retrieve only 100 first addresses for leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadalm committed Jul 14, 2023
1 parent e3656c8 commit c270ce4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
.idx
.total
.range(deps.storage, None, None, Order::Descending)
.take(100)
.map(|res| match res {
Ok((_, v)) => {
let total: u64 = v.total();
Expand Down

0 comments on commit c270ce4

Please sign in to comment.