pub struct Multisig { /* private fields */ }Expand description
A multisig configuration
Implementations§
Source§impl Multisig
impl Multisig
Sourcepub fn new(
threshold: usize,
total: usize,
public_keys: Vec<PublicKey>,
) -> GovernanceResult<Self>
pub fn new( threshold: usize, total: usize, public_keys: Vec<PublicKey>, ) -> GovernanceResult<Self>
Create a new multisig configuration
Sourcepub fn verify(
&self,
message: &[u8],
signatures: &[Signature],
) -> GovernanceResult<bool>
pub fn verify( &self, message: &[u8], signatures: &[Signature], ) -> GovernanceResult<bool>
Verify a set of signatures against a message
Sourcepub fn collect_valid_signatures(
&self,
message: &[u8],
signatures: &[Signature],
) -> GovernanceResult<Vec<usize>>
pub fn collect_valid_signatures( &self, message: &[u8], signatures: &[Signature], ) -> GovernanceResult<Vec<usize>>
Collect valid signatures and return their indices
Sourcepub fn public_keys(&self) -> &[PublicKey]
pub fn public_keys(&self) -> &[PublicKey]
Get the public keys
Sourcepub fn is_valid_signature(
&self,
signature: &Signature,
message: &[u8],
) -> GovernanceResult<Option<usize>>
pub fn is_valid_signature( &self, signature: &Signature, message: &[u8], ) -> GovernanceResult<Option<usize>>
Check if a signature is valid for this multisig
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Multisig
impl RefUnwindSafe for Multisig
impl Send for Multisig
impl Sync for Multisig
impl Unpin for Multisig
impl UnsafeUnpin for Multisig
impl UnwindSafe for Multisig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more