Struct sp_keystore::testing::MemoryKeystore
source · pub struct MemoryKeystore { /* private fields */ }
Expand description
A keystore implementation usable in tests.
Implementations§
Trait Implementations§
source§impl Clone for MemoryKeystore
impl Clone for MemoryKeystore
source§fn clone(&self) -> MemoryKeystore
fn clone(&self) -> MemoryKeystore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§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_pre_output(
&self,
key_type: KeyTypeId,
public: &Public,
input: &VrfInput,
) -> Result<Option<VrfPreOutput>, Error>
fn sr25519_vrf_pre_output( &self, key_type: KeyTypeId, public: &Public, input: &VrfInput, ) -> Result<Option<VrfPreOutput>, Error>
Generate an sr25519 VRF pre-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 Freeze for MemoryKeystore
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
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
.