pub struct MultiSigSignatureCollector { /* private fields */ }Expand description
Multi-signature transaction signature collector.
Helps collect signatures from multiple signers for multi-sig transactions.
After collecting signatures, use Signed::new_multi_sig to create the
signed transaction.
§Example
use alloy_primitives::Address;
use onemoney_protocol::{
MultiSigSignatureEntry, PaymentPayload, Signature, utils::MultiSigSignatureCollector,
};
let mut collector = MultiSigSignatureCollector::new();
collector.add_signature(signer_pubkey1, signature1);
collector.add_signature(signer_pubkey2, signature2);
// Get collected signatures
let signatures = collector.signatures();
// User creates Signed transaction:
// let signed = Signed::new_multi_sig(payload, multisig_account, signatures);Implementations§
Source§impl MultiSigSignatureCollector
impl MultiSigSignatureCollector
Sourcepub fn add_signature(
&mut self,
signer_pubkey: B264,
signature: Signature,
) -> &mut Self
pub fn add_signature( &mut self, signer_pubkey: B264, signature: Signature, ) -> &mut Self
Sourcepub fn add_signatures(
&mut self,
signatures: Vec<MultiSigSignatureEntry>,
) -> &mut Self
pub fn add_signatures( &mut self, signatures: Vec<MultiSigSignatureEntry>, ) -> &mut Self
Sourcepub fn signature_count(&self) -> usize
pub fn signature_count(&self) -> usize
Get the number of signatures collected so far.
Sourcepub fn signatures(self) -> Vec<MultiSigSignatureEntry>
pub fn signatures(self) -> Vec<MultiSigSignatureEntry>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiSigSignatureCollector
impl RefUnwindSafe for MultiSigSignatureCollector
impl Send for MultiSigSignatureCollector
impl Sync for MultiSigSignatureCollector
impl Unpin for MultiSigSignatureCollector
impl UnsafeUnpin for MultiSigSignatureCollector
impl UnwindSafe for MultiSigSignatureCollector
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> 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