[][src]Struct web3::types::Recovery

pub struct Recovery {
    pub message: RecoveryMessage,
    pub v: u64,
    pub r: H256,
    pub s: H256,
}

Data for recovering the public address of signed data.

Note that the signature data is in 'Electrum' notation and may have chain replay protection applied. That means that v is expected to be 27, 28, or 35 + chain_id * 2 or 36 + chain_id * 2.

Fields

message: RecoveryMessage

The message to recover

v: u64

V value.

r: H256

R value.

s: H256

S value.

Implementations

impl Recovery[src]

pub fn new<M>(message: M, v: u64, r: H256, s: H256) -> Recovery where
    M: Into<RecoveryMessage>, 
[src]

Creates new recovery data from its parts.

pub fn from_raw_signature<M, B>(
    message: M,
    raw_signature: B
) -> Result<Recovery, ParseSignatureError> where
    M: Into<RecoveryMessage>,
    B: AsRef<[u8]>, 
[src]

Creates new recovery data from a raw signature.

This parses a raw signature which is expected to be 65 bytes long where the first 32 bytes is the r value, the second 32 bytes the s value and the final byte is the v value in 'Electrum' notation.

pub fn recovery_id(&self) -> Option<i32>[src]

Retrieve the Recovery Id ("Standard V")

Returns None if v value is invalid (equivalent of returning 4 in some implementaions).

pub fn as_signature(&self) -> Option<([u8; 64], i32)>[src]

Retrieves the recovery id & compact signature in it's raw form.

Trait Implementations

impl Clone for Recovery[src]

impl Debug for Recovery[src]

impl<'a> From<&'a SignedData> for Recovery[src]

impl<'a> From<&'a SignedTransaction> for Recovery[src]

impl PartialEq<Recovery> for Recovery[src]

impl StructuralPartialEq for Recovery[src]

Auto Trait Implementations

impl RefUnwindSafe for Recovery

impl Send for Recovery

impl Sync for Recovery

impl Unpin for Recovery

impl UnwindSafe for Recovery

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,