fix: support multiple pools in stake snapshot query (#396)

This commit is contained in:
Alexsander Falcucci 2024-02-11 16:51:35 +01:00 committed by GitHub
parent 43cdb74ee0
commit 4362341b43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 7 deletions

View file

@ -1,4 +1,7 @@
use std::collections::BTreeSet;
use pallas::{
codec::utils::Bytes,
ledger::{addresses::Address, traverse::MultiEraBlock},
network::{
facades::NodeClient,
@ -55,8 +58,8 @@ async fn do_localstate_query(client: &mut NodeClient) {
println!("result: {:?}", result);
// Stake pool ID/verification key hash (either Bech32-decoded or hex-decoded).
// Empty Vec means all pools.
let pools = vec![];
// Empty Set means all pools.
let pools: BTreeSet<Bytes> = BTreeSet::new();
let result = queries_v16::get_stake_snapshots(client, era, pools)
.await
.unwrap();