pub struct Sig(pub (Signature, RecoveryId));
Expand description
Represents Ethereum-style “recoverable signatures”. By default serializes as hex string.
Tuple Fields§
§0: (Signature, RecoveryId)
Implementations§
source§impl Sig
impl Sig
sourcepub fn from_bytes(b: &[u8]) -> Result<Self>
pub fn from_bytes(b: &[u8]) -> Result<Self>
Loads the recoverable signature from the bytes.
sourcepub fn recover_public_key(&self, digest: &[u8]) -> Result<(Key, VerifyingKey)>
pub fn recover_public_key(&self, digest: &[u8]) -> Result<(Key, VerifyingKey)>
Recovers the public key from the 32-byte SHA256 output message using its signature.
pub fn r(&self) -> U256
pub fn s(&self) -> U256
Trait Implementations§
source§impl<'de> Deserialize<'de> for Sig
impl<'de> Deserialize<'de> for Sig
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
impl Eq for Sig
impl StructuralEq for Sig
impl StructuralPartialEq for Sig
Auto Trait Implementations§
impl RefUnwindSafe for Sig
impl Send for Sig
impl Sync for Sig
impl Unpin for Sig
impl UnwindSafe for Sig
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
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> 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