use std::error::Error;
use p2panda_auth::group::GroupCrdtState;
use p2panda_auth::traits::{Conditions, Operation as AuthOperation};
use p2panda_core::{Hash, VerifyingKey};
pub type GroupsStoreState<M, C> = GroupCrdtState<VerifyingKey, Hash, M, C>;
pub trait GroupsStore<M, C>
where
M: AuthOperation<VerifyingKey, Hash, C>,
C: Conditions,
{
type Error: Error;
fn set_groups_state_tx(
&self,
id: Hash,
state: &GroupsStoreState<M, C>,
) -> impl Future<Output = Result<(), Self::Error>>;
fn get_groups_state_tx(
&self,
id: Hash,
) -> impl Future<Output = Result<Option<GroupsStoreState<M, C>>, Self::Error>>;
}