Struct sp_statement_store::Statement
source · pub struct Statement { /* private fields */ }
Expand description
Statement structure.
Implementations§
source§impl Statement
impl Statement
sourcepub fn new_with_proof(proof: Proof) -> Statement
pub fn new_with_proof(proof: Proof) -> Statement
Create a new statement with a proof.
sourcepub fn sign_sr25519_public(&mut self, key: &Public) -> bool
pub fn sign_sr25519_public(&mut self, key: &Public) -> bool
Sign with a key that matches given public key in the keystore.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
sourcepub fn sign_sr25519_private(&mut self, key: &Pair)
pub fn sign_sr25519_private(&mut self, key: &Pair)
Sign with a given private key and add the signature proof field.
sourcepub fn sign_ed25519_public(&mut self, key: &Public) -> bool
pub fn sign_ed25519_public(&mut self, key: &Public) -> bool
Sign with a key that matches given public key in the keystore.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
sourcepub fn sign_ed25519_private(&mut self, key: &Pair)
pub fn sign_ed25519_private(&mut self, key: &Pair)
Sign with a given private key and add the signature proof field.
sourcepub fn sign_ecdsa_public(&mut self, key: &Public) -> bool
pub fn sign_ecdsa_public(&mut self, key: &Public) -> bool
Sign with a key that matches given public key in the keystore.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
sourcepub fn sign_ecdsa_private(&mut self, key: &Pair)
pub fn sign_ecdsa_private(&mut self, key: &Pair)
Sign with a given private key and add the signature proof field.
sourcepub fn verify_signature(&self) -> SignatureVerificationResult
pub fn verify_signature(&self) -> SignatureVerificationResult
Check proof signature, if any.
sourcepub fn decryption_key(&self) -> Option<DecryptionKey>
pub fn decryption_key(&self) -> Option<DecryptionKey>
Returns decryption key if any.
sourcepub fn account_id(&self) -> Option<AccountId>
pub fn account_id(&self) -> Option<AccountId>
Get proof account id, if any
sourcepub fn remove_proof(&mut self)
pub fn remove_proof(&mut self)
Remove the proof of this statement.
sourcepub fn set_proof(&mut self, proof: Proof)
pub fn set_proof(&mut self, proof: Proof)
Set statement proof. Any existing proof is overwritten.
sourcepub fn set_priority(&mut self, priority: u32)
pub fn set_priority(&mut self, priority: u32)
Set statement priority.
sourcepub fn set_channel(&mut self, channel: Channel)
pub fn set_channel(&mut self, channel: Channel)
Set statement channel.
sourcepub fn set_topic(&mut self, index: usize, topic: Topic)
pub fn set_topic(&mut self, index: usize, topic: Topic)
Set topic by index. Does noting if index is over MAX_TOPICS
.
sourcepub fn set_decryption_key(&mut self, key: DecryptionKey)
pub fn set_decryption_key(&mut self, key: DecryptionKey)
Set decryption key.
sourcepub fn set_plain_data(&mut self, data: Vec<u8>)
pub fn set_plain_data(&mut self, data: Vec<u8>)
Set unencrypted statement data.
Trait Implementations§
source§impl Decode for Statement
impl Decode for Statement
source§fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
source§impl Encode for Statement
impl Encode for Statement
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<T>(&self, dest: &mut T)where
T: Output + ?Sized,
fn encode_to<T>(&self, dest: &mut T)where T: Output + ?Sized,
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl PartialEq for Statement
impl PartialEq for Statement
impl Eq for Statement
impl StructuralEq for Statement
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
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
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> FromFFIValue for Twhere
T: PassBy,
impl<T> FromFFIValue for Twhere T: PassBy,
§type SelfInstance = T
type SelfInstance = T
Self
can be an unsized type, it needs to be represented by a sized type at the host.
This SelfInstance
is the sized type.§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> IntoFFIValue for Twhere
T: PassBy,
impl<T> IntoFFIValue for Twhere T: PassBy,
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> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§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
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.