pub struct ScryptoRuntime<'y, Y>where
Y: SystemApi<RuntimeError>,{ /* private fields */ }
Expand description
A shim between SystemAPI and WASM, with buffer capability.
Implementations§
Source§impl<'y, Y> ScryptoRuntime<'y, Y>where
Y: SystemApi<RuntimeError>,
impl<'y, Y> ScryptoRuntime<'y, Y>where
Y: SystemApi<RuntimeError>,
pub fn new( api: &'y mut Y, package_address: PackageAddress, export_name: String, scrypto_vm_version: ScryptoVmVersion, ) -> ScryptoRuntime<'y, Y>
pub fn parse_blueprint_id( package_address: Vec<u8>, blueprint_name: Vec<u8>, ) -> Result<(PackageAddress, String), InvokeError<WasmRuntimeError>>
Trait Implementations§
Source§impl<'y, Y> WasmRuntime for ScryptoRuntime<'y, Y>where
Y: SystemApi<RuntimeError>,
impl<'y, Y> WasmRuntime for ScryptoRuntime<'y, Y>where
Y: SystemApi<RuntimeError>,
Source§fn crypto_utils_bls12381_v1_verify(
&mut self,
message: Vec<u8>,
public_key: Vec<u8>,
signature: Vec<u8>,
) -> Result<u32, InvokeError<WasmRuntimeError>>
fn crypto_utils_bls12381_v1_verify( &mut self, message: Vec<u8>, public_key: Vec<u8>, signature: Vec<u8>, ) -> Result<u32, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Anemone”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_bls12381_v1_aggregate_verify(
&mut self,
pub_keys_and_msgs: Vec<u8>,
signature: Vec<u8>,
) -> Result<u32, InvokeError<WasmRuntimeError>>
fn crypto_utils_bls12381_v1_aggregate_verify( &mut self, pub_keys_and_msgs: Vec<u8>, signature: Vec<u8>, ) -> Result<u32, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Anemone”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_bls12381_v1_fast_aggregate_verify(
&mut self,
message: Vec<u8>,
public_keys: Vec<u8>,
signature: Vec<u8>,
) -> Result<u32, InvokeError<WasmRuntimeError>>
fn crypto_utils_bls12381_v1_fast_aggregate_verify( &mut self, message: Vec<u8>, public_keys: Vec<u8>, signature: Vec<u8>, ) -> Result<u32, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Anemone”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_bls12381_g2_signature_aggregate(
&mut self,
signatures: Vec<u8>,
) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn crypto_utils_bls12381_g2_signature_aggregate( &mut self, signatures: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Anemone”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_keccak256_hash(
&mut self,
data: Vec<u8>,
) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn crypto_utils_keccak256_hash( &mut self, data: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Anemone”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_blake2b_256_hash(
&mut self,
data: Vec<u8>,
) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn crypto_utils_blake2b_256_hash( &mut self, data: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Cuttlefish”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_ed25519_verify(
&mut self,
message: Vec<u8>,
public_key: Vec<u8>,
signature: Vec<u8>,
) -> Result<u32, InvokeError<WasmRuntimeError>>
fn crypto_utils_ed25519_verify( &mut self, message: Vec<u8>, public_key: Vec<u8>, signature: Vec<u8>, ) -> Result<u32, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Cuttlefish”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_secp256k1_ecdsa_verify(
&mut self,
message: Vec<u8>,
public_key: Vec<u8>,
signature: Vec<u8>,
) -> Result<u32, InvokeError<WasmRuntimeError>>
fn crypto_utils_secp256k1_ecdsa_verify( &mut self, message: Vec<u8>, public_key: Vec<u8>, signature: Vec<u8>, ) -> Result<u32, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Cuttlefish”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_secp256k1_ecdsa_verify_and_key_recover(
&mut self,
message: Vec<u8>,
signature: Vec<u8>,
) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn crypto_utils_secp256k1_ecdsa_verify_and_key_recover( &mut self, message: Vec<u8>, signature: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Cuttlefish”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
Source§fn crypto_utils_secp256k1_ecdsa_verify_and_key_recover_uncompressed(
&mut self,
message: Vec<u8>,
signature: Vec<u8>,
) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn crypto_utils_secp256k1_ecdsa_verify_and_key_recover_uncompressed( &mut self, message: Vec<u8>, signature: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
This method is only available to packages uploaded after “Cuttlefish”
protocol update due to checks in ScryptoV1WasmValidator::validate
.
fn allocate_buffer( &mut self, buffer: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn buffer_consume( &mut self, buffer_id: u32, ) -> Result<Vec<u8>, InvokeError<WasmRuntimeError>>
fn object_call( &mut self, receiver: Vec<u8>, ident: Vec<u8>, args: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn object_call_module( &mut self, receiver: Vec<u8>, module_id: u32, ident: Vec<u8>, args: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn object_call_direct( &mut self, receiver: Vec<u8>, ident: Vec<u8>, args: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn blueprint_call( &mut self, package_address: Vec<u8>, blueprint_name: Vec<u8>, function_ident: Vec<u8>, args: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn object_new( &mut self, blueprint_name: Vec<u8>, object_states: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn address_allocate( &mut self, package_address: Vec<u8>, blueprint_name: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn address_get_reservation_address( &mut self, node_id: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn globalize_object( &mut self, node_id: Vec<u8>, modules: Vec<u8>, address_reservation: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn key_value_store_new( &mut self, schema: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn key_value_store_open_entry( &mut self, node_id: Vec<u8>, key: Vec<u8>, flags: u32, ) -> Result<u32, InvokeError<WasmRuntimeError>>
fn key_value_entry_get( &mut self, handle: u32, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn key_value_entry_set( &mut self, handle: u32, data: Vec<u8>, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn key_value_entry_remove( &mut self, handle: u32, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn key_value_entry_close( &mut self, handle: u32, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn key_value_store_remove_entry( &mut self, node_id: Vec<u8>, key: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn actor_open_field( &mut self, object_handle: u32, field: u8, flags: u32, ) -> Result<u32, InvokeError<WasmRuntimeError>>
fn field_entry_read( &mut self, handle: u32, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn field_entry_write( &mut self, handle: u32, data: Vec<u8>, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn field_entry_close( &mut self, handle: u32, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn actor_get_node_id( &mut self, actor_ref_handle: u32, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn actor_get_package_address( &mut self, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn actor_get_blueprint_name( &mut self, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn consume_wasm_execution_units( &mut self, n: u32, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn instance_of( &mut self, object_id: Vec<u8>, package_address: Vec<u8>, blueprint_name: Vec<u8>, ) -> Result<u32, InvokeError<WasmRuntimeError>>
fn blueprint_id( &mut self, object_id: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn get_outer_object( &mut self, node_id: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn actor_emit_event( &mut self, event_name: Vec<u8>, event_payload: Vec<u8>, event_flags: EventFlags, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn sys_log( &mut self, level: Vec<u8>, message: Vec<u8>, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn sys_bech32_encode_address( &mut self, address: Vec<u8>, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn sys_panic( &mut self, message: Vec<u8>, ) -> Result<(), InvokeError<WasmRuntimeError>>
fn sys_get_transaction_hash( &mut self, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn sys_generate_ruid(&mut self) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn costing_get_execution_cost_unit_limit( &mut self, ) -> Result<u32, InvokeError<WasmRuntimeError>>
fn costing_get_execution_cost_unit_price( &mut self, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn costing_get_finalization_cost_unit_limit( &mut self, ) -> Result<u32, InvokeError<WasmRuntimeError>>
fn costing_get_finalization_cost_unit_price( &mut self, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn costing_get_usd_price( &mut self, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
fn costing_get_tip_percentage( &mut self, ) -> Result<u32, InvokeError<WasmRuntimeError>>
fn costing_get_fee_balance( &mut self, ) -> Result<Buffer, InvokeError<WasmRuntimeError>>
Auto Trait Implementations§
impl<'y, Y> Freeze for ScryptoRuntime<'y, Y>
impl<'y, Y> RefUnwindSafe for ScryptoRuntime<'y, Y>where
Y: RefUnwindSafe,
impl<'y, Y> Send for ScryptoRuntime<'y, Y>where
Y: Send,
impl<'y, Y> Sync for ScryptoRuntime<'y, Y>where
Y: Sync,
impl<'y, Y> Unpin for ScryptoRuntime<'y, Y>
impl<'y, Y> !UnwindSafe for ScryptoRuntime<'y, Y>
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
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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