use crate::network::NetworkMultiplexer;
use round_based::PartyIndex;
use std::collections::BTreeMap;
use std::sync::Arc;
use subxt_core::utils::AccountId32;
#[async_trait::async_trait]
pub trait MPCContext {
fn config(&self) -> &crate::config::StdGadgetConfiguration;
fn network_protocol(&self) -> String;
fn create_network_delivery_wrapper<M>(
&self,
mux: Arc<NetworkMultiplexer>,
party_index: PartyIndex,
task_hash: [u8; 32],
parties: BTreeMap<PartyIndex, subxt_core::ext::sp_core::ecdsa::Public>,
) -> color_eyre::Result<
crate::network::round_based_compat::NetworkDeliveryWrapper<M>,
crate::Error,
>
where
M: Clone
+ Send
+ Unpin
+ 'static
+ serde::Serialize
+ serde::de::DeserializeOwned
+ round_based::ProtocolMessage;
async fn get_party_index(&self) -> color_eyre::Result<PartyIndex, crate::Error>;
async fn get_participants(
&self,
client: &subxt::OnlineClient<crate::clients::tangle::runtime::TangleConfig>,
) -> color_eyre::Result<BTreeMap<PartyIndex, AccountId32>, crate::Error>;
fn blueprint_id(&self) -> color_eyre::Result<u64>;
async fn get_party_index_and_operators(
&self,
) -> color_eyre::Result<(
usize,
BTreeMap<AccountId32, crate::subxt_core::ext::sp_core::ecdsa::Public>,
)>;
async fn current_service_operators_ecdsa_keys(
&self,
) -> color_eyre::Result<BTreeMap<AccountId32, crate::subxt_core::ext::sp_core::ecdsa::Public>>;
async fn current_call_id(&self) -> color_eyre::Result<u64>;
}