pub trait Authorization: Clone {
// Required methods
fn authority(&self) -> Option<Address>;
fn chain_id(&self) -> u64;
fn nonce(&self) -> u64;
fn address(&self) -> Address;
fn is_invalid(&self) -> bool;
}
Expand description
Authorization trait.
Required Methods§
Authority address.
§Note
Authority signature can be invalid, so this method returns None if the authority could not be recovered.
Valid signature Parity should be 0 or 1 and signature s-value should be less than SECP256K1N_HALF.
Sourcefn nonce(&self) -> u64
fn nonce(&self) -> u64
Returns the nonce.
§Note
If nonce is not same as the nonce of the signer account, the authorization is skipped.
Sourcefn is_invalid(&self) -> bool
fn is_invalid(&self) -> bool
Returns true if the authorization is valid.
Temporary method needed for older EIP spec and will removed in future when test get updated.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Authorization for RecoveredAuthorization
impl Authorization for RecoveredAuthorization
Authority address. Obtained by recovering of the signature.
Source§fn nonce(&self) -> u64
fn nonce(&self) -> u64
Returns the nonce.
§Note
If nonce is not same as the nonce of the signer account, authorization is skipped and considered invalidated.
Source§fn is_invalid(&self) -> bool
fn is_invalid(&self) -> bool
Returns true if the authorization is valid.
Temporary method needed for older EIP spec and will removed in future