Struct jormungandr::leadership::Enclave
source · pub struct Enclave {
inner: Arc<Enclave>,
}
Expand description
represent the client side of an enclave. From there we will query the actual enclave about schedules and signing blocks
Fields§
§inner: Arc<Enclave>
TODO: we will need to remove this to instead query data to an
external service (running in the secure enclave). For now we
hold on the SecureEnclave
. But it will need to be separated
when we have the necessary crypto done.
Implementations§
source§impl Enclave
impl Enclave
sourcepub fn new(secure_enclave: SecureEnclave) -> Self
pub fn new(secure_enclave: SecureEnclave) -> Self
create a new enclave structure. This will need to change in the future with a parameter to contact the secure enclave instead of the dummy type.
sourcepub async fn query_schedules(
&self,
leadership: Arc<Leadership>,
slot_start: u32,
nb_slots: u32
) -> Result<Schedule, EnclaveError>
pub async fn query_schedules( &self, leadership: Arc<Leadership>, slot_start: u32, nb_slots: u32 ) -> Result<Schedule, EnclaveError>
ask the enclave to attempt computing some leadership schedule for the given settings
TODO: for now we are utilizing the Leadership object fully but on the long run this might be limited to only the required data.
sourcepub fn query_header_bft_finalize(
&self,
block_builder: HeaderBftBuilder<HeaderSetConsensusSignature>
) -> Result<HeaderBft, EnclaveError>
pub fn query_header_bft_finalize( &self, block_builder: HeaderBftBuilder<HeaderSetConsensusSignature> ) -> Result<HeaderBft, EnclaveError>
ask the leader associated to the LeaderEvent
to finalize the given
block by providing the proof.
TODO: for now we are querying the whole with the block builder but on the long run we will only need the block signing data.
sourcepub fn query_header_genesis_praos_finalize(
&self,
block_builder: HeaderGenesisPraosBuilder<HeaderSetConsensusSignature>
) -> Result<HeaderGenesisPraos, EnclaveError>
pub fn query_header_genesis_praos_finalize( &self, block_builder: HeaderGenesisPraosBuilder<HeaderSetConsensusSignature> ) -> Result<HeaderGenesisPraos, EnclaveError>
ask the leader associated to the LeaderEvent
to finalize the given
block by providing the proof.
TODO: for now we are querying the whole with the block builder but on the long run we will only need the block signing data.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Enclave
impl Send for Enclave
impl Sync for Enclave
impl Unpin for Enclave
impl UnwindSafe for Enclave
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request