Struct holochain::prelude::AddRecordPayload
source · pub struct AddRecordPayload {
pub signed_action_msgpack: Vec<u8>,
pub signed_action_signature: Signature,
pub encrypted_entry: Option<(Arc<EncryptedEntry>, Signature)>,
}
Expand description
A Record to be added to the CHC.
The SignedActionHashed is constructed as usual. The Entry data is encrypted (TODO: by which key?), and the encrypted data is signed by the agent. This ensures that only the correct agent is adding records to its CHC. This EncryptedEntry signature is not used anywhere outside the context of the CHC.
Fields§
§signed_action_msgpack: Vec<u8>
The msgpack-encoded SignedActionHashed for the Record. This is encoded as such because the CHC needs to verify the signature, and these are the exact bytes which are signed, so this removes the need to deserialize and then re-serialize.
This must be deserialized as SignedActionHashed
.
signed_action_signature: Signature
The signature of the SignedActionHashed (NOTE: usually signatures are of just the Action, but in this case we want to include the entire struct in the signature so we don’t have to recalculate that on the CHC)
encrypted_entry: Option<(Arc<EncryptedEntry>, Signature)>
The entry, encrypted (TODO: by which key?), with the signature of of the encrypted bytes
Implementations§
source§impl AddRecordPayload
impl AddRecordPayload
sourcepub async fn from_records(
keystore: MetaLairClient,
agent_pubkey: HoloHash<Agent>,
records: Vec<Record>
) -> Result<Vec<AddRecordPayload>, ChcError>
pub async fn from_records( keystore: MetaLairClient, agent_pubkey: HoloHash<Agent>, records: Vec<Record> ) -> Result<Vec<AddRecordPayload>, ChcError>
Create a payload from a list of records. This performs the necessary signing and encryption the CHC requires.
Trait Implementations§
source§impl Clone for AddRecordPayload
impl Clone for AddRecordPayload
source§fn clone(&self) -> AddRecordPayload
fn clone(&self) -> AddRecordPayload
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AddRecordPayload
impl Debug for AddRecordPayload
source§impl<'de> Deserialize<'de> for AddRecordPayload
impl<'de> Deserialize<'de> for AddRecordPayload
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<AddRecordPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<AddRecordPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Serialize for AddRecordPayload
impl Serialize for AddRecordPayload
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl RefUnwindSafe for AddRecordPayload
impl Send for AddRecordPayload
impl Sync for AddRecordPayload
impl Unpin for AddRecordPayload
impl UnwindSafe for AddRecordPayload
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> 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> ⓘ
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.