[−][src]Struct exonum::blockchain::CallProof
Proof of authenticity for a single top-level call in a block, such as a transaction.
The proof consists of two parts:
block_proof
: block header with the proof of authenticitycall_proof
: proof from the error aggregator (i.e., aProofMapIndex
the Merkle root of which is recorded in the block header aserror_hash
).
For an execution that resulted in an error, call_proof
will be a proof of existence.
If a transaction was executed successfully, call_proof
will be a proof of absence.
Since the number of transactions in a block is mentioned in the block header, the user
will be able to distinguish absence of error (meaning successful execution) from
the absence of a transaction with such an index. Indeed, if the index is less
than amount of transactions in block, the proof denotes successful execution;
otherwise, the transaction with the given index does not exist in the block.
Similarly, execution errors of the before_transactions
/ after_transactions
hooks can be proven to external clients. Discerning successful execution
from a non-existing service requires prior knowledge though.
CallProof
s should not be confused with a proof of transaction commitment.
To verify that a certain transaction was committed, use a proof from
the block_transactions
index of the core schema.
Fields (Non-exhaustive)
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.block_proof: BlockProof
Proof of authenticity for the block header.
call_proof: MapProof<CallInBlock, ExecutionError>
Proof of authenticity for the call status. Must contain a single key corresponding
to the CallInBlock
in question.
The root hash of the proof must be equal to the error_hash
mentioned in block_proof
.
error_description: Option<String>
Human-readable description of an error if the call status is erroneous.
This description is not authenticated and thus should be used for diagnostic purposes only.
If the call is successful, the error description should be None
.
Methods
impl CallProof
[src]
pub fn verify(
&self,
validator_keys: &[PublicKey]
) -> Result<(CallInBlock, Result<(), ExecutionError>), ProofError>
[src]
&self,
validator_keys: &[PublicKey]
) -> Result<(CallInBlock, Result<(), ExecutionError>), ProofError>
Verifies this proof, returning the location of the proven call together with its status.
Note that a successful status is indistinguishable from the point of view of a proof from a non-existing one. It is up to caller to discern between these two possibilities.
Trait Implementations
impl BinaryValue for CallProof
[src]
fn to_bytes(&self) -> Vec<u8>
[src]
fn from_bytes(value: Cow<[u8]>) -> Result<Self, Error>
[src]
fn into_bytes(self) -> Vec<u8>
[src]
impl Clone for CallProof
[src]
impl Debug for CallProof
[src]
impl<'de> Deserialize<'de> for CallProof
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl ProtobufConvert for CallProof
[src]
type ProtoStruct = CallProof
Type generated from the Protobuf definition.
fn to_pb(&self) -> Self::ProtoStruct
[src]
fn from_pb(pb: Self::ProtoStruct) -> Result<Self, Error>
[src]
impl Serialize for CallProof
[src]
Auto Trait Implementations
impl RefUnwindSafe for CallProof
impl Send for CallProof
impl Sync for CallProof
impl Unpin for CallProof
impl UnwindSafe for CallProof
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,