pub struct SessionUpdate {
pub session: [u8; 32],
pub nonce: [u8; 32],
pub recipient: BoundedVec<u8, 32>,
}Expand description
A session update info.
Fields§
§session: [u8; 32]The session id.
nonce: [u8; 32]The nonce for the session generated by the worker.
recipient: BoundedVec<u8, 32>The account address that used to receive the settlement payment.
Implementations§
Source§impl SessionUpdate
impl SessionUpdate
Sourcepub fn calc_session_id<Crypto: CryptoProvider>(
nonce: [u8; 32],
metrics_nonce: &[u8],
) -> [u8; 32]
pub fn calc_session_id<Crypto: CryptoProvider>( nonce: [u8; 32], metrics_nonce: &[u8], ) -> [u8; 32]
Calculate the session id from the seed and nonce.
The session id is calculated as blake2b_256(nonce || metrics_nonce) where nonce is generated
on-the-fly by the worker and metrics_nonce should be the last metrics nonce submitted to the chain.
Trait Implementations§
Source§impl Clone for SessionUpdate
impl Clone for SessionUpdate
Source§fn clone(&self) -> SessionUpdate
fn clone(&self) -> SessionUpdate
Returns a duplicate 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 Debug for SessionUpdate
impl Debug for SessionUpdate
Source§impl Decode for SessionUpdate
impl Decode for SessionUpdate
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
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,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl Encode for SessionUpdate
impl Encode for SessionUpdate
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
Source§impl MaxEncodedLen for SessionUpdate
impl MaxEncodedLen for SessionUpdate
Source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
Source§impl PartialEq for SessionUpdate
impl PartialEq for SessionUpdate
Source§impl TypeInfo for SessionUpdate
impl TypeInfo for SessionUpdate
impl EncodeLike for SessionUpdate
impl Eq for SessionUpdate
impl StructuralPartialEq for SessionUpdate
Auto Trait Implementations§
impl Freeze for SessionUpdate
impl RefUnwindSafe for SessionUpdate
impl Send for SessionUpdate
impl Sync for SessionUpdate
impl Unpin for SessionUpdate
impl UnwindSafe for SessionUpdate
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