bc049cb954
* Economic dynamics stats endpoint on the explorer API with dummy fixture data * Populating the endpoint with real data aggregated from validator api * Introduced new cache functionalities
24 lines
640 B
Rust
24 lines
640 B
Rust
// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use crate::client::ThreadsafeValidatorClient;
|
|
use mixnet_contract_common::Delegation;
|
|
|
|
pub(crate) async fn get_single_mixnode_delegations(
|
|
client: &ThreadsafeValidatorClient,
|
|
pubkey: &str,
|
|
) -> Vec<Delegation> {
|
|
let delegates = match client
|
|
.0
|
|
.get_all_nymd_single_mixnode_delegations(pubkey.to_string())
|
|
.await
|
|
{
|
|
Ok(result) => result,
|
|
Err(e) => {
|
|
error!("Could not get delegations for mix node {}: {:?}", pubkey, e);
|
|
vec![]
|
|
}
|
|
};
|
|
delegates
|
|
}
|