pub struct MultiEd25519Signature { /* private fields */ }Available on crate feature
ed25519 only.Expand description
A multi-Ed25519 signature.
This contains individual Ed25519 signatures along with a bitmap indicating which signers provided signatures.
Implementations§
Source§impl MultiEd25519Signature
impl MultiEd25519Signature
Sourcepub fn new(signatures: Vec<(u8, Ed25519Signature)>) -> AptosResult<Self>
pub fn new(signatures: Vec<(u8, Ed25519Signature)>) -> AptosResult<Self>
Creates a new multi-Ed25519 signature from individual signatures.
§Arguments
signatures- Vec of (signer_index, signature) pairs
The signer indices must be in ascending order and within bounds.
§Errors
Returns AptosError::InvalidSignature if:
- No signatures are provided
- More than 32 signatures are provided
- A signer index is out of bounds (>= 32)
- Duplicate signer indices are present
Sourcepub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
pub fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
Creates a signature from bytes.
Format: signature_1 || signature_2 || … || signature_m || bitmap (4 bytes)
§Errors
Returns AptosError::InvalidSignature if:
- The bytes are too short (less than 4 bytes for bitmap)
- The signature bytes length doesn’t match the expected number of signatures from the bitmap
- Any individual signature fails to parse
Sourcepub fn num_signatures(&self) -> usize
pub fn num_signatures(&self) -> usize
Returns the number of signatures.
Sourcepub fn signatures(&self) -> &[(u8, Ed25519Signature)]
pub fn signatures(&self) -> &[(u8, Ed25519Signature)]
Returns the individual signatures with their indices.
Sourcepub fn has_signature(&self, index: u8) -> bool
pub fn has_signature(&self, index: u8) -> bool
Checks if a particular index signed.
Trait Implementations§
Source§impl Clone for MultiEd25519Signature
impl Clone for MultiEd25519Signature
Source§fn clone(&self) -> MultiEd25519Signature
fn clone(&self) -> MultiEd25519Signature
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultiEd25519Signature
impl Debug for MultiEd25519Signature
Source§impl<'de> Deserialize<'de> for MultiEd25519Signature
impl<'de> Deserialize<'de> for MultiEd25519Signature
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MultiEd25519Signature
impl Display for MultiEd25519Signature
Source§impl PartialEq for MultiEd25519Signature
impl PartialEq for MultiEd25519Signature
Source§impl Serialize for MultiEd25519Signature
impl Serialize for MultiEd25519Signature
Source§impl Signature for MultiEd25519Signature
impl Signature for MultiEd25519Signature
Source§type PublicKey = MultiEd25519PublicKey
type PublicKey = MultiEd25519PublicKey
The public key type for this signature scheme.
Source§fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
fn from_bytes(bytes: &[u8]) -> AptosResult<Self>
Creates a signature from bytes. Read more
impl Eq for MultiEd25519Signature
impl StructuralPartialEq for MultiEd25519Signature
Auto Trait Implementations§
impl Freeze for MultiEd25519Signature
impl RefUnwindSafe for MultiEd25519Signature
impl Send for MultiEd25519Signature
impl Sync for MultiEd25519Signature
impl Unpin for MultiEd25519Signature
impl UnwindSafe for MultiEd25519Signature
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> IntoMoveArg for Twhere
T: Serialize,
impl<T> IntoMoveArg for Twhere
T: Serialize,
Source§fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
fn into_move_arg(self) -> Result<Vec<u8>, AptosError>
Converts this value into BCS-encoded bytes. Read more
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.