pub trait SignerSync<Sig = Signature> {
// Required methods
fn sign_hash_sync(&self, hash: &B256) -> Result<Sig>;
fn chain_id_sync(&self) -> Option<ChainId>;
// Provided method
fn sign_message_sync(&self, message: &[u8]) -> Result<Sig> { ... }
}Expand description
Synchronous Ethereum signer.
All provided implementations rely on sign_hash_sync. A signer
may not always be able to implement this method, in which case it should return
UnsupportedOperation, and implement all the signing
methods directly.
Synchronous signers should also implement Signer, as they are always able to by delegating
the asynchronous methods to the synchronous ones.
Required Methods§
Sourcefn sign_hash_sync(&self, hash: &B256) -> Result<Sig>
fn sign_hash_sync(&self, hash: &B256) -> Result<Sig>
Signs the given hash.
Sourcefn chain_id_sync(&self) -> Option<ChainId>
fn chain_id_sync(&self) -> Option<ChainId>
Returns the signer’s chain ID.
Provided Methods§
Sourcefn sign_message_sync(&self, message: &[u8]) -> Result<Sig>
fn sign_message_sync(&self, message: &[u8]) -> Result<Sig>
Signs the hash of the provided message after prefixing it, as specified in EIP-191.