Struct fathom_web3::types::Recovery
source · [−]pub struct Recovery {
pub message: RecoveryMessage,
pub v: u64,
pub r: H256,
pub s: H256,
}
Expand description
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
sourceimpl Recovery
impl Recovery
sourcepub fn new<M>(message: M, v: u64, r: H256, s: H256) -> Recoverywhere
M: Into<RecoveryMessage>,
pub fn new<M>(message: M, v: u64, r: H256, s: H256) -> Recoverywhere
M: Into<RecoveryMessage>,
Creates new recovery data from its parts.
sourcepub fn from_raw_signature<M, B>(
message: M,
raw_signature: B
) -> Result<Recovery, ParseSignatureError>where
M: Into<RecoveryMessage>,
B: AsRef<[u8]>,
pub fn from_raw_signature<M, B>(
message: M,
raw_signature: B
) -> Result<Recovery, ParseSignatureError>where
M: Into<RecoveryMessage>,
B: AsRef<[u8]>,
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.
sourcepub fn recovery_id(&self) -> Option<i32>
pub fn recovery_id(&self) -> Option<i32>
Retrieve the Recovery Id (“Standard V”)
Returns None
if v
value is invalid
(equivalent of returning 4
in some implementaions).
Trait Implementations
sourceimpl<'a> From<&'a SignedData> for Recovery
impl<'a> From<&'a SignedData> for Recovery
sourcefn from(signed: &'a SignedData) -> Self
fn from(signed: &'a SignedData) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<&'a SignedTransaction> for Recovery
impl<'a> From<&'a SignedTransaction> for Recovery
sourcefn from(tx: &'a SignedTransaction) -> Self
fn from(tx: &'a SignedTransaction) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Recovery
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more