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 + 'static>> for MemoryKeystore
impl Into<Arc<dyn Keystore + 'static>> 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 bandersnatch_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn bandersnatch_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all the bandersnatch public keys for the given key type.
source§fn bandersnatch_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, Error>
fn bandersnatch_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, Error>
Generate a new bandersnatch key pair for the given key type and an optional seed. Read more
source§fn bandersnatch_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, Error>
fn bandersnatch_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, Error>
Generate an bandersnatch signature for a given message. Read more
source§fn bandersnatch_vrf_sign(
&self,
key_type: KeyTypeId,
public: &Public,
data: &VrfSignData
) -> Result<Option<VrfSignature>, Error>
fn bandersnatch_vrf_sign( &self, key_type: KeyTypeId, public: &Public, data: &VrfSignData ) -> Result<Option<VrfSignature>, Error>
Generate a bandersnatch VRF signature for the given data. Read more
source§fn bandersnatch_ring_vrf_sign(
&self,
key_type: KeyTypeId,
public: &Public,
data: &VrfSignData,
prover: &RingProver
) -> Result<Option<RingVrfSignature>, Error>
fn bandersnatch_ring_vrf_sign( &self, key_type: KeyTypeId, public: &Public, data: &VrfSignData, prover: &RingProver ) -> Result<Option<RingVrfSignature>, Error>
Generate a bandersnatch ring-VRF signature for the given data. Read more
source§fn bandersnatch_vrf_output(
&self,
key_type: KeyTypeId,
public: &Public,
input: &VrfInput
) -> Result<Option<VrfOutput>, Error>
fn bandersnatch_vrf_output( &self, key_type: KeyTypeId, public: &Public, input: &VrfInput ) -> Result<Option<VrfOutput>, Error>
Generate a bandersnatch VRF (pre)output for a given input data. Read more
source§fn bls381_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn bls381_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all bls12-381 public keys for the given key type.
source§fn bls381_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, Error>
fn bls381_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, Error>
Generate a new bls381 key pair for the given key type and an optional seed. Read more
source§fn bls381_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, Error>
fn bls381_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, Error>
Generate a bls381 signature for a given message. Read more
source§fn bls377_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn bls377_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all bls12-377 public keys for the given key type.
source§fn bls377_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, Error>
fn bls377_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, Error>
Generate a new bls377 key pair for the given key type and an optional seed. Read more
source§fn bls377_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, Error>
fn bls377_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, Error>
Generate a bls377 signature for a given 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> 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, 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>,
§impl<T> Pointable for T
impl<T> Pointable 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
.