Type Alias massa_models::block::SecureShareBlock
source · pub type SecureShareBlock = SecureShare<Block, BlockId>;
Expand description
Block with assosciated meta-data and interfaces allowing trust of data in untrusted network
Aliased Type§
struct SecureShareBlock {
pub content: Block,
pub serialized_data: Vec<u8, Global>,
pub signature: Signature,
pub content_creator_pub_key: PublicKey,
pub content_creator_address: Address,
pub id: BlockId,
}
Fields§
§content: Block
Reference contents. Not required for the the security protocols.
Use the Lightweight equivilant structures when you need verifiable serialized data, but do not need to read the values directly (such as when sending)
serialized_data: Vec<u8, Global>
Content in sharable, deserializable form. Is used in the secure verification protocols.
signature: Signature
A cryptographically generated value using serialized_data
and a public key.
content_creator_pub_key: PublicKey
The public-key component used in the generation of the signature
content_creator_address: Address
Derived from the same public key used to generate the signature
id: BlockId
A secure hash of the data. See also massa_hash::Hash
Implementations§
sourcepub fn bytes_count(&self) -> u64
pub fn bytes_count(&self) -> u64
size in bytes of the whole block
sourcepub fn contains_operation(&self, op: SecureShareOperation) -> bool
pub fn contains_operation(&self, op: SecureShareOperation) -> bool
true if given operation is included in the block
sourcepub fn get_fitness(&self) -> u64
pub fn get_fitness(&self) -> u64
returns the fitness of the block
sourcepub fn sign(
keypair: &KeyPair,
content_hash: &Hash,
_content: &T
) -> Result<Signature, ModelsError>
pub fn sign( keypair: &KeyPair, content_hash: &Hash, _content: &T ) -> Result<Signature, ModelsError>
Sign the SecureShare given the content
sourcepub fn verify_signature(&self) -> Result<(), ModelsError>
pub fn verify_signature(&self) -> Result<(), ModelsError>
check if self has been signed by public key
sourcepub fn compute_signed_hash(&self) -> Hash
pub fn compute_signed_hash(&self) -> Hash
Compute the signed hash
sourcepub fn serialized_size(&self) -> usize
pub fn serialized_size(&self) -> usize
get full serialized size
Trait Implementations§
source§fn clone(&self) -> SecureShare<T, ID>
fn clone(&self) -> SecureShare<T, ID>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§fn eq(&self, other: &SecureShare<T, ID>) -> bool
fn eq(&self, other: &SecureShare<T, ID>) -> bool
self
and other
values to be equal, and is used
by ==
.