Struct iota_types::message_envelope::VerifiedEnvelope
source · pub struct VerifiedEnvelope<T: Message, S>(/* private fields */);
Implementations§
source§impl VerifiedEnvelope<SenderSignedData, CertificateProof>
impl VerifiedEnvelope<SenderSignedData, CertificateProof>
pub fn certificate_sig(&self) -> Option<&AuthorityStrongQuorumSignInfo>
pub fn gas_budget(&self) -> u64
source§impl<T: Message, S> VerifiedEnvelope<T, S>
impl<T: Message, S> VerifiedEnvelope<T, S>
sourcepub fn new_from_verified(inner: Envelope<T, S>) -> Self
pub fn new_from_verified(inner: Envelope<T, S>) -> Self
This API should only be called when the input is already verified.
sourcepub fn new_unchecked(inner: Envelope<T, S>) -> Self
pub fn new_unchecked(inner: Envelope<T, S>) -> Self
There are some situations (e.g. fragment verification) where its very awkward and/or inefficient to obtain verified certificates from calling CertifiedTransaction::verify() Use this carefully.
pub fn into_inner(self) -> Envelope<T, S>
pub fn inner(&self) -> &Envelope<T, S>
pub fn into_message(self) -> T
sourcepub fn serializable_ref(&self) -> &TrustedEnvelope<T, S>
pub fn serializable_ref(&self) -> &TrustedEnvelope<T, S>
Use this when you need to serialize a verified envelope. This should generally only be used for database writes. never use over the network!
sourcepub fn serializable(self) -> TrustedEnvelope<T, S>
pub fn serializable(self) -> TrustedEnvelope<T, S>
Use this when you need to serialize a verified envelope. This should generally only be used for database writes. never use over the network!
sourcepub fn into_unsigned(self) -> VerifiedEnvelope<T, EmptySignInfo>
pub fn into_unsigned(self) -> VerifiedEnvelope<T, EmptySignInfo>
Remove the authority signatures S
from this envelope.
source§impl<T: Message> VerifiedEnvelope<T, CertificateProof>
impl<T: Message> VerifiedEnvelope<T, CertificateProof>
The following implementation provides two ways to construct a VerifiedEnvelope with CertificateProof. It is implemented in this file such that we could reuse the digest without having to recompute it. We allow converting a VerifiedCertificate into a VerifiedEnvelope with CertificateProof::Certificate; and converting a VerifiedTransaction along with checkpoint information into a VerifiedEnvelope with CertificateProof::Checkpoint.
pub fn new_from_certificate( certificate: VerifiedEnvelope<T, AuthorityStrongQuorumSignInfo>, ) -> Self
pub fn new_from_checkpoint( transaction: VerifiedEnvelope<T, EmptySignInfo>, epoch: EpochId, checkpoint: CheckpointSequenceNumber, ) -> Self
pub fn new_system( transaction: VerifiedEnvelope<T, EmptySignInfo>, epoch: EpochId, ) -> Self
pub fn new_from_quorum_execution( transaction: VerifiedEnvelope<T, EmptySignInfo>, epoch: EpochId, ) -> Self
pub fn epoch(&self) -> EpochId
source§impl VerifiedEnvelope<CheckpointSummary, AuthorityQuorumSignInfo<true>>
impl VerifiedEnvelope<CheckpointSummary, AuthorityQuorumSignInfo<true>>
pub fn into_summary_and_sequence( self, ) -> (CheckpointSequenceNumber, CheckpointSummary)
source§impl VerifiedEnvelope<SenderSignedData, EmptySignInfo>
impl VerifiedEnvelope<SenderSignedData, EmptySignInfo>
pub fn new_genesis_transaction( objects: Vec<GenesisObject>, events: Vec<Event>, ) -> Self
pub fn new_consensus_commit_prologue_v1( epoch: u64, round: u64, commit_timestamp_ms: CheckpointTimestamp, consensus_commit_digest: ConsensusCommitDigest, cancelled_txn_version_assignment: Vec<(TransactionDigest, Vec<(ObjectID, SequenceNumber)>)>, ) -> Self
pub fn new_authenticator_state_update( epoch: u64, round: u64, new_active_jwks: Vec<ActiveJwk>, authenticator_obj_initial_shared_version: SequenceNumber, ) -> Self
pub fn new_randomness_state_update( epoch: u64, randomness_round: RandomnessRound, random_bytes: Vec<u8>, randomness_obj_initial_shared_version: SequenceNumber, ) -> Self
pub fn new_end_of_epoch_transaction( txns: Vec<EndOfEpochTransactionKind>, ) -> Self
source§impl VerifiedEnvelope<SenderSignedData, AuthoritySignInfo>
impl VerifiedEnvelope<SenderSignedData, AuthoritySignInfo>
sourcepub fn new(
epoch: EpochId,
transaction: VerifiedTransaction,
authority: AuthorityName,
secret: &dyn Signer<AuthoritySignature>,
) -> Self
pub fn new( epoch: EpochId, transaction: VerifiedTransaction, authority: AuthorityName, secret: &dyn Signer<AuthoritySignature>, ) -> Self
Use signing key to create a signed object.
Methods from Deref<Target = Envelope<T, S>>§
pub fn data(&self) -> &T
pub fn auth_sig(&self) -> &S
pub fn digest(&self) -> &T::DigestType
pub fn epoch(&self) -> EpochId
pub fn verify_committee_sigs_only(&self, committee: &Committee) -> IotaResult
pub fn epoch(&self) -> EpochId
pub fn verify_with_contents( &self, committee: &Committee, contents: Option<&CheckpointContents>, ) -> IotaResult
pub fn sender_address(&self) -> IotaAddress
pub fn gas(&self) -> &[ObjectRef]
pub fn key(&self) -> TransactionKey
pub fn non_digest_key(&self) -> Option<TransactionKey>
pub fn is_system_tx(&self) -> bool
pub fn is_sponsored_tx(&self) -> bool
sourcepub fn to_tx_bytes_and_signatures(&self) -> (Base64, Vec<Base64>)
pub fn to_tx_bytes_and_signatures(&self) -> (Base64, Vec<Base64>)
Returns the Base64 encoded tx_bytes and a list of Base64 encoded [enum GenericSignature].
pub fn verify_signature_for_testing( &self, current_epoch: EpochId, verify_params: &VerifyParams, ) -> IotaResult
pub fn verify_signatures_authenticated_for_testing( &self, committee: &Committee, verify_params: &VerifyParams, ) -> IotaResult
pub fn certificate_digest(&self) -> CertificateDigest
pub fn gas_price(&self) -> u64
pub fn verify_signatures_authenticated( &self, committee: &Committee, verify_params: &VerifyParams, zklogin_inputs_cache: Arc<VerifiedDigestCache<ZKLoginInputsDigest>>, ) -> IotaResult
pub fn verify_committee_sigs_only(&self, committee: &Committee) -> IotaResult
Trait Implementations§
source§impl<T: Clone + Message, S: Clone> Clone for VerifiedEnvelope<T, S>
impl<T: Clone + Message, S: Clone> Clone for VerifiedEnvelope<T, S>
source§fn clone(&self) -> VerifiedEnvelope<T, S>
fn clone(&self) -> VerifiedEnvelope<T, S>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T, S: Debug> Debug for VerifiedEnvelope<T, S>
impl<T, S: Debug> Debug for VerifiedEnvelope<T, S>
source§impl<T: Message, S> Deref for VerifiedEnvelope<T, S>
impl<T: Message, S> Deref for VerifiedEnvelope<T, S>
source§impl<T, S> Display for VerifiedEnvelope<T, S>
impl<T, S> Display for VerifiedEnvelope<T, S>
source§impl<T: Message, S> From<TrustedEnvelope<T, S>> for VerifiedEnvelope<T, S>
impl<T: Message, S> From<TrustedEnvelope<T, S>> for VerifiedEnvelope<T, S>
After deserialization, a TrustedTransactionEnvelope can be turned back into a VerifiedTransactionEnvelope.
source§fn from(e: TrustedEnvelope<T, S>) -> Self
fn from(e: TrustedEnvelope<T, S>) -> Self
source§impl<T: Message, S> From<VerifiedEnvelope<T, S>> for Envelope<T, S>
impl<T: Message, S> From<VerifiedEnvelope<T, S>> for Envelope<T, S>
source§fn from(v: VerifiedEnvelope<T, S>) -> Self
fn from(v: VerifiedEnvelope<T, S>) -> Self
source§impl<T: Message, S> PartialEq for VerifiedEnvelope<T, S>
impl<T: Message, S> PartialEq for VerifiedEnvelope<T, S>
impl<T: Message, S> Eq for VerifiedEnvelope<T, S>
Auto Trait Implementations§
impl<T, S> !Freeze for VerifiedEnvelope<T, S>
impl<T, S> RefUnwindSafe for VerifiedEnvelope<T, S>
impl<T, S> Send for VerifiedEnvelope<T, S>
impl<T, S> Sync for VerifiedEnvelope<T, S>
impl<T, S> Unpin for VerifiedEnvelope<T, S>
impl<T, S> UnwindSafe for VerifiedEnvelope<T, S>
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Conv for T
impl<T> Conv for T
§impl<T> ConvertTo<T> for Twhere
T: Send,
impl<T> ConvertTo<T> for Twhere
T: Send,
fn convert(self) -> Result<T, Error>
fn convert_unchecked(self) -> T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a 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
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.