Struct PubKey
pub struct PubKey { /* private fields */ }Expand description
Represents the public parameters of a multisignature authotization policy.
Defines the weight each key is associated with, and the minimal threshold above which a subset of signers can emit a valid signature.
Each PubKey defines a unique owner.
Implementations§
§impl PubKey
impl PubKey
pub const fn new(signers: BTreeMap<OwnerId, u64>, threshold: u64) -> PubKey
pub const fn new(signers: BTreeMap<OwnerId, u64>, threshold: u64) -> PubKey
Construct a new multisig account from its parts
pub const fn signers(&self) -> &BTreeMap<OwnerId, u64>
pub const fn signers(&self) -> &BTreeMap<OwnerId, u64>
Returns the signers and their associated weights
pub fn get_weight(&self, id: &OwnerId) -> Option<u64>
pub fn get_weight(&self, id: &OwnerId) -> Option<u64>
Returns the weight associated with the given id. Returns None if the id is not found in the owner list.
Trait Implementations§
§impl<'de> Deserialize<'de> for PubKey
impl<'de> Deserialize<'de> for PubKey
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PubKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PubKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for PubKey
impl Serialize for PubKey
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl VerifyingKey for PubKey
impl VerifyingKey for PubKey
§type VerificationError = Error
type VerificationError = Error
The verification error type.
§fn verify_serialized(
&self,
data: impl AsRef<[u8]>,
signatures: &<PubKey as VerifyingKey>::Signature,
) -> Result<(), <PubKey as VerifyingKey>::VerificationError>
fn verify_serialized( &self, data: impl AsRef<[u8]>, signatures: &<PubKey as VerifyingKey>::Signature, ) -> Result<(), <PubKey as VerifyingKey>::VerificationError>
Verify a signature against serialized bytes
§fn verify_signature(
&self,
data: &impl Serialize,
signature: &Self::Signature,
) -> Result<(), Self::VerificationError>
fn verify_signature( &self, data: &impl Serialize, signature: &Self::Signature, ) -> Result<(), Self::VerificationError>
Verify a signature
impl Eq for PubKey
impl StructuralPartialEq for PubKey
Auto Trait Implementations§
impl Freeze for PubKey
impl RefUnwindSafe for PubKey
impl Send for PubKey
impl Sync for PubKey
impl Unpin for PubKey
impl UnwindSafe for PubKey
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request