Struct sp_keystore::testing::MemoryKeystore
source · pub struct MemoryKeystore { /* private fields */ }
Expand description
A keystore implementation usable in tests.
Implementations§
Trait Implementations§
source§impl Default for MemoryKeystore
impl Default for MemoryKeystore
source§fn default() -> MemoryKeystore
fn default() -> MemoryKeystore
Returns the “default value” for a type. Read more
source§impl Into<Arc<dyn Keystore>> for MemoryKeystore
impl Into<Arc<dyn Keystore>> for MemoryKeystore
source§fn into(self) -> KeystorePtr
fn into(self) -> KeystorePtr
Converts this type into the (usually inferred) input type.
source§impl Keystore for MemoryKeystore
impl Keystore for MemoryKeystore
source§fn sr25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn sr25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all the sr25519 public keys for the given key type.
source§fn sr25519_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, Error>
fn sr25519_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, Error>
Generate a new sr25519 key pair for the given key type and an optional seed. Read more
source§fn sr25519_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, Error>
fn sr25519_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, Error>
Generate an sr25519 signature for a given message. Read more
source§fn sr25519_vrf_sign(
&self,
key_type: KeyTypeId,
public: &Public,
data: &VrfSignData
) -> Result<Option<VrfSignature>, Error>
fn sr25519_vrf_sign( &self, key_type: KeyTypeId, public: &Public, data: &VrfSignData ) -> Result<Option<VrfSignature>, Error>
Generate an sr25519 VRF signature for the given data. Read more
source§fn sr25519_vrf_output(
&self,
key_type: KeyTypeId,
public: &Public,
input: &VrfInput
) -> Result<Option<VrfOutput>, Error>
fn sr25519_vrf_output( &self, key_type: KeyTypeId, public: &Public, input: &VrfInput ) -> Result<Option<VrfOutput>, Error>
Generate an sr25519 VRF output for a given input data. Read more
source§fn ed25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn ed25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all ed25519 public keys for the given key type.
source§fn ed25519_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, Error>
fn ed25519_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, Error>
Generate a new ed25519 key pair for the given key type and an optional seed. Read more
source§fn ed25519_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, Error>
fn ed25519_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, Error>
Generate an ed25519 signature for a given message. Read more
source§fn ecdsa_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn ecdsa_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all ecdsa public keys for the given key type.
source§fn ecdsa_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, Error>
fn ecdsa_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, Error>
Generate a new ecdsa key pair for the given key type and an optional seed. Read more
source§fn ecdsa_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, Error>
fn ecdsa_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, Error>
Generate an ecdsa signature for a given message. Read more
source§fn ecdsa_sign_prehashed(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8; 32]
) -> Result<Option<Signature>, Error>
fn ecdsa_sign_prehashed( &self, key_type: KeyTypeId, public: &Public, msg: &[u8; 32] ) -> Result<Option<Signature>, Error>
Generate an ecdsa signature for a given pre-hashed message. Read more
source§fn insert(
&self,
key_type: KeyTypeId,
suri: &str,
public: &[u8]
) -> Result<(), ()>
fn insert( &self, key_type: KeyTypeId, suri: &str, public: &[u8] ) -> Result<(), ()>
Insert a new secret key.
source§fn keys(&self, key_type: KeyTypeId) -> Result<Vec<Vec<u8>>, Error>
fn keys(&self, key_type: KeyTypeId) -> Result<Vec<Vec<u8>>, Error>
List all supported keys of a given type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryKeystore
impl Send for MemoryKeystore
impl Sync for MemoryKeystore
impl Unpin for MemoryKeystore
impl !UnwindSafe for MemoryKeystore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.