[−][src]Struct solana_libra_bytecode_verifier::verifier::VerifiedScript
A script that has been verified for internal consistency.
This does not include cross-module checking -- that needs to be done separately.
Methods
impl VerifiedScript
[src]
pub fn new(
script: CompiledScript
) -> Result<Self, (CompiledScript, Vec<VerificationError>)>
[src]
script: CompiledScript
) -> Result<Self, (CompiledScript, Vec<VerificationError>)>
Verifies this CompiledScript
, returning a VerifiedScript
on success.
On failure, returns the original CompiledScript
and a list of verification errors.
Verification of a script is done in two steps:
- Convert the script into a module and run all the usual verification performed on a module
- Check the signature of the main function of the script
This approach works because critical operations such as MoveFrom, MoveToSender, and BorrowGlobal that are not allowed in the script function take a StructDefinitionIndex as an argument. Since the module constructed from a script is guaranteed to have an empty vector of struct definitions, the bounds checker will catch any occurrences of these illegal operations.
pub fn into_module(self) -> VerifiedModule
[src]
Returns the corresponding VerifiedModule
for this script.
Every VerifiedScript
is a VerifiedModule
, but the inverse is not true, so there's no
corresponding VerifiedModule::into_script
function.
pub fn serialize(&self, binary: &mut Vec<u8>) -> Result<(), Error>
[src]
Serializes a VerifiedScript
into a binary. The mutable Vec<u8>
will contain the
binary blob on return.
pub fn deserialize(binary: &[u8]) -> BinaryLoaderResult<Self>
[src]
Deserializes a &u8 slice into a VerifiedScript
instance.
pub fn as_inner(&self) -> &CompiledScript
[src]
Returns a reference to the CompiledScript
within.
pub fn into_inner(self) -> CompiledScript
[src]
Returns the CompiledScript
within. Conversion back to VerifiedScript
will require
going through the verifier again.
Trait Implementations
impl Clone for VerifiedScript
[src]
fn clone(&self) -> VerifiedScript
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<VerifiedScript> for VerifiedScript
[src]
fn eq(&self, other: &VerifiedScript) -> bool
[src]
fn ne(&self, other: &VerifiedScript) -> bool
[src]
impl Eq for VerifiedScript
[src]
impl Display for VerifiedScript
[src]
impl Debug for VerifiedScript
[src]
impl ScriptAccess for VerifiedScript
[src]
fn as_script(&self) -> &CompiledScript
[src]
fn module_handle_at(&self, idx: ModuleHandleIndex) -> &ModuleHandle
fn struct_handle_at(&self, idx: StructHandleIndex) -> &StructHandle
fn function_handle_at(&self, idx: FunctionHandleIndex) -> &FunctionHandle
fn type_signature_at(&self, idx: TypeSignatureIndex) -> &TypeSignature
fn function_signature_at(
&self,
idx: FunctionSignatureIndex
) -> &FunctionSignature
&self,
idx: FunctionSignatureIndex
) -> &FunctionSignature
fn locals_signature_at(&self, idx: LocalsSignatureIndex) -> &LocalsSignature
fn string_at(&self, idx: StringPoolIndex) -> &str
fn byte_array_at(&self, idx: ByteArrayPoolIndex) -> &ByteArray
fn address_at(&self, idx: AddressPoolIndex) -> &AccountAddress
fn module_handles(&self) -> &[ModuleHandle]
fn struct_handles(&self) -> &[StructHandle]
fn function_handles(&self) -> &[FunctionHandle]
fn type_signatures(&self) -> &[TypeSignature]
fn function_signatures(&self) -> &[FunctionSignature]
fn locals_signatures(&self) -> &[LocalsSignature]
fn byte_array_pool(&self) -> &[ByteArray]
fn address_pool(&self) -> &[AccountAddress]
fn string_pool(&self) -> &[String]
fn main(&self) -> &FunctionDefinition
Auto Trait Implementations
impl Sync for VerifiedScript
impl Send for VerifiedScript
impl Unpin for VerifiedScript
impl RefUnwindSafe for VerifiedScript
impl UnwindSafe for VerifiedScript
Blanket Implementations
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> Erased for T
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,