Skip to content

Commit

Permalink
Return list of requested messages with a boolean from IsVerified() query
Browse files Browse the repository at this point in the history
  • Loading branch information
themicp committed Nov 27, 2023
1 parent 4e2bc39 commit ee5eee3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions light-client/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
to_json_binary(&sync_committee)
}
Version {} => to_json_binary(&VERSION.load(deps.storage)?),
IsVerified { messages } => to_json_binary(
&messages
.into_iter()
.map(|message| {
let result = VERIFIED_MESSAGES.load(deps.storage, message.hash_id());
(message, result.is_ok())
})
.collect::<Vec<(Message, bool)>>(),
),
}
}

Expand Down

0 comments on commit ee5eee3

Please sign in to comment.