From dc8b2f00ee721ce345cfad60013815666ded4cdf Mon Sep 17 00:00:00 2001 From: sydhds Date: Tue, 30 Apr 2024 12:48:58 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20massalab?= =?UTF-8?q?s/massa-sc-runtime@1b81fe0375eb5dfde710b8e9d55455689a1c4012=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementors/core/clone/trait.Clone.js | 2 +- implementors/core/convert/trait.From.js | 2 +- implementors/core/fmt/trait.Debug.js | 2 +- massa_sc_runtime/enum.RuntimeModule.html | 6 +- massa_sc_runtime/enum.VMError.html | 2 +- massa_sc_runtime/struct.GasCosts.html | 2 +- massa_sc_runtime/trait.Interface.html | 332 +++++++++++------------ 7 files changed, 174 insertions(+), 174 deletions(-) diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js index 3554077a..3851e853 100644 --- a/implementors/core/clone/trait.Clone.js +++ b/implementors/core/clone/trait.Clone.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"massa_sc_runtime":[["impl Clone for VMError"],["impl Clone for GasCosts"],["impl Clone for Box<dyn Interface>"],["impl Clone for RuntimeModule"],["impl Clone for Compiler"]] +"massa_sc_runtime":[["impl Clone for VMError"],["impl Clone for Compiler"],["impl Clone for RuntimeModule"],["impl Clone for Box<dyn Interface>"],["impl Clone for GasCosts"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/convert/trait.From.js b/implementors/core/convert/trait.From.js index 63ab0589..c27610c0 100644 --- a/implementors/core/convert/trait.From.js +++ b/implementors/core/convert/trait.From.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"massa_sc_runtime":[["impl From<Error> for VMError"]] +"massa_sc_runtime":[["impl From<Error> for VMError"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js index 4546b487..f9787f2b 100644 --- a/implementors/core/fmt/trait.Debug.js +++ b/implementors/core/fmt/trait.Debug.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"massa_sc_runtime":[["impl Debug for VMError"],["impl Debug for Response"],["impl Debug for GasCosts"]] +"massa_sc_runtime":[["impl Debug for Response"],["impl Debug for VMError"],["impl Debug for GasCosts"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/massa_sc_runtime/enum.RuntimeModule.html b/massa_sc_runtime/enum.RuntimeModule.html index f1305b2b..dea86efa 100644 --- a/massa_sc_runtime/enum.RuntimeModule.html +++ b/massa_sc_runtime/enum.RuntimeModule.html @@ -5,19 +5,19 @@ bytecode: &[u8], gas_costs: GasCosts, compiler: Compiler -) -> Result<Self>

Dispatch module creation corresponding to the first bytecode byte

+) -> Result<Self>

Dispatch module creation corresponding to the first bytecode byte

  • (0): legacy AssemblyScript module
  • (1): new agnostic module
  • (_): unsupported module
source

pub fn compiler(&self) -> Compiler

Used compiler for the current module

-
source

pub fn serialize(&self) -> Result<Vec<u8>>

Serialize a RuntimeModule, prepending its byte id

+
source

pub fn serialize(&self) -> Result<Vec<u8>>

Serialize a RuntimeModule, prepending its byte id

source

pub fn deserialize( ser_module: &[u8], limit: u64, gas_costs: GasCosts -) -> Result<Self>

Deserialize a RuntimeModule

+) -> Result<Self>

Deserialize a RuntimeModule

Trait Implementations§

source§

impl Clone for RuntimeModule

source§

fn clone(&self) -> RuntimeModule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for RuntimeModule

§

impl Send for RuntimeModule

§

impl Sync for RuntimeModule

§

impl Unpin for RuntimeModule

§

impl !UnwindSafe for RuntimeModule

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata diff --git a/massa_sc_runtime/enum.VMError.html b/massa_sc_runtime/enum.VMError.html index 718c5f18..b7f04f4a 100644 --- a/massa_sc_runtime/enum.VMError.html +++ b/massa_sc_runtime/enum.VMError.html @@ -6,7 +6,7 @@ }, }

Variants§

§

InstanceError(String)

VM instance error: {0}

§

ExecutionError

Fields

§error: String
§init_gas_cost: u64

VM execution error: {error}

-

Trait Implementations§

source§

impl Clone for VMError

source§

fn clone(&self) -> VMError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VMError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VMError

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for VMError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for VMError

source§

fn from(value: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +

Trait Implementations§

source§

impl Clone for VMError

source§

fn clone(&self) -> VMError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VMError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VMError

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for VMError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for VMError

source§

fn from(value: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for Twhere diff --git a/massa_sc_runtime/struct.GasCosts.html b/massa_sc_runtime/struct.GasCosts.html index c0704a86..df9d2dbe 100644 --- a/massa_sc_runtime/struct.GasCosts.html +++ b/massa_sc_runtime/struct.GasCosts.html @@ -3,7 +3,7 @@ pub sp_compilation_cost: u64, pub max_instance_cost: u64, /* private fields */ -}

Fields§

§cl_compilation_cost: u64§sp_compilation_cost: u64§max_instance_cost: u64

Implementations§

source§

impl GasCosts

source

pub fn new(abi_cost_file: PathBuf, wasm_abi_file: PathBuf) -> Result<Self>

Trait Implementations§

source§

impl Clone for GasCosts

source§

fn clone(&self) -> GasCosts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasCosts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +}

Fields§

§cl_compilation_cost: u64§sp_compilation_cost: u64§max_instance_cost: u64

Implementations§

source§

impl GasCosts

source

pub fn new(abi_cost_file: PathBuf, wasm_abi_file: PathBuf) -> Result<Self>

Trait Implementations§

source§

impl Clone for GasCosts

source§

fn clone(&self) -> GasCosts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasCosts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for Twhere diff --git a/massa_sc_runtime/trait.Interface.html b/massa_sc_runtime/trait.Interface.html index 2daa0042..18bec2ca 100644 --- a/massa_sc_runtime/trait.Interface.html +++ b/massa_sc_runtime/trait.Interface.html @@ -1,151 +1,151 @@ Interface in massa_sc_runtime - Rust
pub trait Interface: Send + Sync + InterfaceClone {
 
Show 96 methods // Required methods - fn init_call(&self, address: &str, raw_coins: u64) -> Result<Vec<u8>>; + fn init_call(&self, address: &str, raw_coins: u64) -> Result<Vec<u8>>; fn init_call_wasmv1( &self, address: &str, raw_coins: NativeAmount - ) -> Result<Vec<u8>>; - fn finish_call(&self) -> Result<()>; - fn get_balance(&self) -> Result<u64>; - fn get_balance_for(&self, address: &str) -> Result<u64>; + ) -> Result<Vec<u8>>; + fn finish_call(&self) -> Result<()>; + fn get_balance(&self) -> Result<u64>; + fn get_balance_for(&self, address: &str) -> Result<u64>; fn get_balance_wasmv1( &self, address: Option<String> - ) -> Result<NativeAmount>; - fn transfer_coins(&self, to_address: &str, raw_amount: u64) -> Result<()>; + ) -> Result<NativeAmount>; + fn transfer_coins(&self, to_address: &str, raw_amount: u64) -> Result<()>; fn transfer_coins_for( &self, from_address: &str, to_address: &str, raw_amount: u64 - ) -> Result<()>; + ) -> Result<()>; fn transfer_coins_wasmv1( &self, to_address: String, raw_amount: NativeAmount, from_address: Option<String> - ) -> Result<()>; - fn get_call_coins_wasmv1(&self) -> Result<NativeAmount>; - fn raw_set_bytecode(&self, bytecode: &[u8]) -> Result<()>; - fn raw_set_bytecode_for(&self, address: &str, bytecode: &[u8]) -> Result<()>; + ) -> Result<()>; + fn get_call_coins_wasmv1(&self) -> Result<NativeAmount>; + fn raw_set_bytecode(&self, bytecode: &[u8]) -> Result<()>; + fn raw_set_bytecode_for(&self, address: &str, bytecode: &[u8]) -> Result<()>; fn set_bytecode_wasmv1( &self, bytecode: &[u8], address: Option<String> - ) -> Result<()>; - fn create_module(&self, module: &[u8]) -> Result<String>; - fn print(&self, message: &str) -> Result<()>; - fn get_keys(&self, prefix: Option<&[u8]>) -> Result<BTreeSet<Vec<u8>>>; + ) -> Result<()>; + fn create_module(&self, module: &[u8]) -> Result<String>; + fn print(&self, message: &str) -> Result<()>; + fn get_keys(&self, prefix: Option<&[u8]>) -> Result<BTreeSet<Vec<u8>>>; fn get_keys_for( &self, address: &str, prefix: Option<&[u8]> - ) -> Result<BTreeSet<Vec<u8>>>; + ) -> Result<BTreeSet<Vec<u8>>>; fn get_ds_keys_wasmv1( &self, prefix: &[u8], address: Option<String> - ) -> Result<BTreeSet<Vec<u8>>>; - fn raw_get_data(&self, key: &[u8]) -> Result<Vec<u8>>; - fn raw_get_data_for(&self, address: &str, key: &[u8]) -> Result<Vec<u8>>; + ) -> Result<BTreeSet<Vec<u8>>>; + fn raw_get_data(&self, key: &[u8]) -> Result<Vec<u8>>; + fn raw_get_data_for(&self, address: &str, key: &[u8]) -> Result<Vec<u8>>; fn get_ds_value_wasmv1( &self, key: &[u8], address: Option<String> - ) -> Result<Vec<u8>>; - fn raw_set_data(&self, key: &[u8], value: &[u8]) -> Result<()>; + ) -> Result<Vec<u8>>; + fn raw_set_data(&self, key: &[u8], value: &[u8]) -> Result<()>; fn raw_set_data_for( &self, address: &str, key: &[u8], value: &[u8] - ) -> Result<()>; + ) -> Result<()>; fn set_ds_value_wasmv1( &self, key: &[u8], value: &[u8], address: Option<String> - ) -> Result<()>; - fn raw_append_data(&self, key: &[u8], value: &[u8]) -> Result<()>; + ) -> Result<()>; + fn raw_append_data(&self, key: &[u8], value: &[u8]) -> Result<()>; fn raw_append_data_for( &self, address: &str, key: &[u8], value: &[u8] - ) -> Result<()>; + ) -> Result<()>; fn append_ds_value_wasmv1( &self, key: &[u8], value: &[u8], address: Option<String> - ) -> Result<()>; - fn raw_delete_data(&self, key: &[u8]) -> Result<()>; - fn raw_delete_data_for(&self, address: &str, key: &[u8]) -> Result<()>; + ) -> Result<()>; + fn raw_delete_data(&self, key: &[u8]) -> Result<()>; + fn raw_delete_data_for(&self, address: &str, key: &[u8]) -> Result<()>; fn delete_ds_entry_wasmv1( &self, key: &[u8], address: Option<String> - ) -> Result<()>; - fn has_data(&self, key: &[u8]) -> Result<bool>; - fn has_data_for(&self, address: &str, key: &[u8]) -> Result<bool>; + ) -> Result<()>; + fn has_data(&self, key: &[u8]) -> Result<bool>; + fn has_data_for(&self, address: &str, key: &[u8]) -> Result<bool>; fn ds_entry_exists_wasmv1( &self, key: &[u8], address: Option<String> - ) -> Result<bool>; - fn raw_get_bytecode(&self) -> Result<Vec<u8>>; - fn raw_get_bytecode_for(&self, address: &str) -> Result<Vec<u8>>; - fn get_bytecode_wasmv1(&self, address: Option<String>) -> Result<Vec<u8>>; - fn get_op_keys(&self, prefix: Option<&[u8]>) -> Result<Vec<Vec<u8>>>; - fn get_op_keys_wasmv1(&self, prefix: &[u8]) -> Result<Vec<Vec<u8>>>; - fn op_entry_exists(&self, key: &[u8]) -> Result<bool>; - fn get_op_data(&self, key: &[u8]) -> Result<Vec<u8>>; - fn caller_has_write_access(&self) -> Result<bool>; - fn hash(&self, data: &[u8]) -> Result<[u8; 32]>; - fn hash_blake3(&self, bytes: &[u8]) -> Result<[u8; 32]>; + ) -> Result<bool>; + fn raw_get_bytecode(&self) -> Result<Vec<u8>>; + fn raw_get_bytecode_for(&self, address: &str) -> Result<Vec<u8>>; + fn get_bytecode_wasmv1(&self, address: Option<String>) -> Result<Vec<u8>>; + fn get_op_keys(&self, prefix: Option<&[u8]>) -> Result<Vec<Vec<u8>>>; + fn get_op_keys_wasmv1(&self, prefix: &[u8]) -> Result<Vec<Vec<u8>>>; + fn op_entry_exists(&self, key: &[u8]) -> Result<bool>; + fn get_op_data(&self, key: &[u8]) -> Result<Vec<u8>>; + fn caller_has_write_access(&self) -> Result<bool>; + fn hash(&self, data: &[u8]) -> Result<[u8; 32]>; + fn hash_blake3(&self, bytes: &[u8]) -> Result<[u8; 32]>; fn signature_verify( &self, data: &[u8], signature: &str, public_key: &str - ) -> Result<bool>; + ) -> Result<bool>; fn evm_signature_verify( &self, message: &[u8], signature: &[u8], public_key: &[u8] - ) -> Result<bool>; - fn evm_get_address_from_pubkey(&self, public_key: &[u8]) -> Result<Vec<u8>>; + ) -> Result<bool>; + fn evm_get_address_from_pubkey(&self, public_key: &[u8]) -> Result<Vec<u8>>; fn evm_get_pubkey_from_signature( &self, hash: &[u8], signature: &[u8] - ) -> Result<Vec<u8>>; - fn is_address_eoa(&self, address: &str) -> Result<bool>; - fn address_from_public_key(&self, public_key: &str) -> Result<String>; - fn validate_address(&self, address: &str) -> Result<bool>; - fn get_time(&self) -> Result<u64>; - fn unsafe_random(&self) -> Result<i64>; - fn unsafe_random_f64(&self) -> Result<f64>; - fn unsafe_random_wasmv1(&self, num_bytes: u64) -> Result<Vec<u8>>; - fn get_current_period(&self) -> Result<u64>; - fn get_current_thread(&self) -> Result<u8>; - fn get_current_slot(&self) -> Result<Slot>; - fn get_owned_addresses(&self) -> Result<Vec<String>>; - fn get_call_stack(&self) -> Result<Vec<String>>; - fn generate_event(&self, _event: String) -> Result<()>; - fn generate_event_wasmv1(&self, _event: Vec<u8>) -> Result<()>; + ) -> Result<Vec<u8>>; + fn is_address_eoa(&self, address: &str) -> Result<bool>; + fn address_from_public_key(&self, public_key: &str) -> Result<String>; + fn validate_address(&self, address: &str) -> Result<bool>; + fn get_time(&self) -> Result<u64>; + fn unsafe_random(&self) -> Result<i64>; + fn unsafe_random_f64(&self) -> Result<f64>; + fn unsafe_random_wasmv1(&self, num_bytes: u64) -> Result<Vec<u8>>; + fn get_current_period(&self) -> Result<u64>; + fn get_current_thread(&self) -> Result<u8>; + fn get_current_slot(&self) -> Result<Slot>; + fn get_owned_addresses(&self) -> Result<Vec<String>>; + fn get_call_stack(&self) -> Result<Vec<String>>; + fn generate_event(&self, _event: String) -> Result<()>; + fn generate_event_wasmv1(&self, _event: Vec<u8>) -> Result<()>; fn get_module( &self, bytecode: &[u8], gas_limit: u64 - ) -> Result<RuntimeModule>; + ) -> Result<RuntimeModule>; fn get_tmp_module( &self, bytecode: &[u8], gas_limit: u64 - ) -> Result<RuntimeModule>; + ) -> Result<RuntimeModule>; fn send_message( &self, target_address: &str, @@ -157,248 +157,248 @@ raw_coins: u64, data: &[u8], filter: Option<(&str, Option<&[u8]>)> - ) -> Result<()>; - fn get_origin_operation_id(&self) -> Result<Option<String>>; - fn hash_sha256(&self, bytes: &[u8]) -> Result<[u8; 32]>; - fn hash_keccak256(&self, bytes: &[u8]) -> Result<[u8; 32]>; - fn chain_id(&self) -> Result<u64>; + ) -> Result<()>; + fn get_origin_operation_id(&self) -> Result<Option<String>>; + fn hash_sha256(&self, bytes: &[u8]) -> Result<[u8; 32]>; + fn hash_keccak256(&self, bytes: &[u8]) -> Result<[u8; 32]>; + fn chain_id(&self) -> Result<u64>; fn native_amount_from_str_wasmv1( &self, amount: &str - ) -> Result<NativeAmount>; + ) -> Result<NativeAmount>; fn native_amount_to_string_wasmv1( &self, amount: &NativeAmount - ) -> Result<String>; - fn check_native_amount_wasmv1(&self, amount: &NativeAmount) -> Result<bool>; + ) -> Result<String>; + fn check_native_amount_wasmv1(&self, amount: &NativeAmount) -> Result<bool>; fn add_native_amount_wasmv1( &self, amount1: &NativeAmount, amount2: &NativeAmount - ) -> Result<NativeAmount>; + ) -> Result<NativeAmount>; fn sub_native_amount_wasmv1( &self, amount1: &NativeAmount, amount2: &NativeAmount - ) -> Result<NativeAmount>; + ) -> Result<NativeAmount>; fn scalar_mul_native_amount_wasmv1( &self, amount: &NativeAmount, factor: u64 - ) -> Result<NativeAmount>; + ) -> Result<NativeAmount>; fn scalar_div_rem_native_amount_wasmv1( &self, dividend: &NativeAmount, divisor: u64 - ) -> Result<(NativeAmount, NativeAmount)>; + ) -> Result<(NativeAmount, NativeAmount)>; fn div_rem_native_amount_wasmv1( &self, dividend: &NativeAmount, divisor: &NativeAmount - ) -> Result<(u64, NativeAmount)>; - fn check_address_wasmv1(&self, to_check: &str) -> Result<bool>; - fn check_pubkey_wasmv1(&self, to_check: &str) -> Result<bool>; - fn check_signature_wasmv1(&self, to_check: &str) -> Result<bool>; + ) -> Result<(u64, NativeAmount)>; + fn check_address_wasmv1(&self, to_check: &str) -> Result<bool>; + fn check_pubkey_wasmv1(&self, to_check: &str) -> Result<bool>; + fn check_signature_wasmv1(&self, to_check: &str) -> Result<bool>; fn get_address_category_wasmv1( &self, to_check: &str - ) -> Result<AddressCategory>; - fn get_address_version_wasmv1(&self, address: &str) -> Result<u64>; - fn get_pubkey_version_wasmv1(&self, pubkey: &str) -> Result<u64>; - fn get_signature_version_wasmv1(&self, signature: &str) -> Result<u64>; + ) -> Result<AddressCategory>; + fn get_address_version_wasmv1(&self, address: &str) -> Result<u64>; + fn get_pubkey_version_wasmv1(&self, pubkey: &str) -> Result<u64>; + fn get_signature_version_wasmv1(&self, signature: &str) -> Result<u64>; fn checked_add_native_time_wasmv1( &self, time1: &NativeTime, time2: &NativeTime - ) -> Result<NativeTime>; + ) -> Result<NativeTime>; fn checked_sub_native_time_wasmv1( &self, time1: &NativeTime, time2: &NativeTime - ) -> Result<NativeTime>; + ) -> Result<NativeTime>; fn checked_mul_native_time_wasmv1( &self, time: &NativeTime, factor: u64 - ) -> Result<NativeTime>; + ) -> Result<NativeTime>; fn checked_scalar_div_native_time_wasmv1( &self, dividend: &NativeTime, divisor: u64 - ) -> Result<(NativeTime, NativeTime)>; + ) -> Result<(NativeTime, NativeTime)>; fn checked_div_native_time_wasmv1( &self, dividend: &NativeTime, divisor: &NativeTime - ) -> Result<(u64, NativeTime)>; - fn base58_check_to_bytes_wasmv1(&self, s: &str) -> Result<Vec<u8>>; + ) -> Result<(u64, NativeTime)>; + fn base58_check_to_bytes_wasmv1(&self, s: &str) -> Result<Vec<u8>>; fn bytes_to_base58_check_wasmv1(&self, bytes: &[u8]) -> String; fn compare_address_wasmv1( &self, left: &str, right: &str - ) -> Result<ComparisonResult>; + ) -> Result<ComparisonResult>; fn compare_native_amount_wasmv1( &self, left: &NativeAmount, right: &NativeAmount - ) -> Result<ComparisonResult>; + ) -> Result<ComparisonResult>; fn compare_native_time_wasmv1( &self, left: &NativeTime, right: &NativeTime - ) -> Result<ComparisonResult>; + ) -> Result<ComparisonResult>; fn compare_pub_key_wasmv1( &self, left: &str, right: &str - ) -> Result<ComparisonResult>; + ) -> Result<ComparisonResult>; fn save_gas_remaining_before_subexecution(&self, gas_used_until: u64); // Provided method - fn get_call_coins(&self) -> Result<u64> { ... } -
}

Required Methods§

source

fn init_call(&self, address: &str, raw_coins: u64) -> Result<Vec<u8>>

Prepare the execution of a module at the given address and transfer a + fn get_call_coins(&self) -> Result<u64> { ... } +

}

Required Methods§

source

fn init_call(&self, address: &str, raw_coins: u64) -> Result<Vec<u8>>

Prepare the execution of a module at the given address and transfer a given amount of coins

source

fn init_call_wasmv1( &self, address: &str, raw_coins: NativeAmount -) -> Result<Vec<u8>>

Prepare the execution of a module at the given address and transfer a +) -> Result<Vec<u8>>

Prepare the execution of a module at the given address and transfer a given amount of coins

-
source

fn finish_call(&self) -> Result<()>

Finish a call

-
source

fn get_balance(&self) -> Result<u64>

Get the SCE ledger balance for the current address. +

source

fn finish_call(&self) -> Result<()>

Finish a call

+
source

fn get_balance(&self) -> Result<u64>

Get the SCE ledger balance for the current address. Defaults to zero if the address is not found.

-
source

fn get_balance_for(&self, address: &str) -> Result<u64>

Get the SCE ledger balance for an address. +

source

fn get_balance_for(&self, address: &str) -> Result<u64>

Get the SCE ledger balance for an address. Defaults to zero if the address is not found.

-
source

fn get_balance_wasmv1(&self, address: Option<String>) -> Result<NativeAmount>

source

fn transfer_coins(&self, to_address: &str, raw_amount: u64) -> Result<()>

Transfer an amount from the address on the current call stack to a +

source

fn get_balance_wasmv1(&self, address: Option<String>) -> Result<NativeAmount>

source

fn transfer_coins(&self, to_address: &str, raw_amount: u64) -> Result<()>

Transfer an amount from the address on the current call stack to a target address.

source

fn transfer_coins_for( &self, from_address: &str, to_address: &str, raw_amount: u64 -) -> Result<()>

Transfer an amount from the specified address to a target address.

+) -> Result<()>

Transfer an amount from the specified address to a target address.

source

fn transfer_coins_wasmv1( &self, to_address: String, raw_amount: NativeAmount, from_address: Option<String> -) -> Result<()>

source

fn get_call_coins_wasmv1(&self) -> Result<NativeAmount>

Get the native amount of coins that have been made available for use by +) -> Result<()>

source

fn get_call_coins_wasmv1(&self) -> Result<NativeAmount>

Get the native amount of coins that have been made available for use by the caller of the currently executing code.

-
source

fn raw_set_bytecode(&self, bytecode: &[u8]) -> Result<()>

Sets the executable bytecode at a current address.

-
source

fn raw_set_bytecode_for(&self, address: &str, bytecode: &[u8]) -> Result<()>

Sets the executable bytecode at a target address. +

source

fn raw_set_bytecode(&self, bytecode: &[u8]) -> Result<()>

Sets the executable bytecode at a current address.

+
source

fn raw_set_bytecode_for(&self, address: &str, bytecode: &[u8]) -> Result<()>

Sets the executable bytecode at a target address. The target address must exist and the current context must have access rights.

source

fn set_bytecode_wasmv1( &self, bytecode: &[u8], address: Option<String> -) -> Result<()>

source

fn create_module(&self, module: &[u8]) -> Result<String>

Requires a new address that contains the sent &u8

-
source

fn print(&self, message: &str) -> Result<()>

Print function for examples

-
source

fn get_keys(&self, prefix: Option<&[u8]>) -> Result<BTreeSet<Vec<u8>>>

Return datastore keys +) -> Result<()>

source

fn create_module(&self, module: &[u8]) -> Result<String>

Requires a new address that contains the sent &u8

+
source

fn print(&self, message: &str) -> Result<()>

Print function for examples

+
source

fn get_keys(&self, prefix: Option<&[u8]>) -> Result<BTreeSet<Vec<u8>>>

Return datastore keys Will only return keys with a given prefix if provided in args

source

fn get_keys_for( &self, address: &str, prefix: Option<&[u8]> -) -> Result<BTreeSet<Vec<u8>>>

Return datastore keys +) -> Result<BTreeSet<Vec<u8>>>

Return datastore keys Will only return keys with a given prefix if provided in args

source

fn get_ds_keys_wasmv1( &self, prefix: &[u8], address: Option<String> -) -> Result<BTreeSet<Vec<u8>>>

source

fn raw_get_data(&self, key: &[u8]) -> Result<Vec<u8>>

Return the datastore value of the corresponding key

-
source

fn raw_get_data_for(&self, address: &str, key: &[u8]) -> Result<Vec<u8>>

Requires the data at the address

+) -> Result<BTreeSet<Vec<u8>>>
source

fn raw_get_data(&self, key: &[u8]) -> Result<Vec<u8>>

Return the datastore value of the corresponding key

+
source

fn raw_get_data_for(&self, address: &str, key: &[u8]) -> Result<Vec<u8>>

Requires the data at the address

source

fn get_ds_value_wasmv1( &self, key: &[u8], address: Option<String> -) -> Result<Vec<u8>>

source

fn raw_set_data(&self, key: &[u8], value: &[u8]) -> Result<()>

Set the datastore value for the corresponding key

+) -> Result<Vec<u8>>
source

fn raw_set_data(&self, key: &[u8], value: &[u8]) -> Result<()>

Set the datastore value for the corresponding key

source

fn raw_set_data_for( &self, address: &str, key: &[u8], value: &[u8] -) -> Result<()>

Set the datastore value for the corresponding key of the given address

+) -> Result<()>

Set the datastore value for the corresponding key of the given address

source

fn set_ds_value_wasmv1( &self, key: &[u8], value: &[u8], address: Option<String> -) -> Result<()>

source

fn raw_append_data(&self, key: &[u8], value: &[u8]) -> Result<()>

Append a value to the current datastore value for the corresponding key

+) -> Result<()>
source

fn raw_append_data(&self, key: &[u8], value: &[u8]) -> Result<()>

Append a value to the current datastore value for the corresponding key

source

fn raw_append_data_for( &self, address: &str, key: &[u8], value: &[u8] -) -> Result<()>

Append a value to the current datastore value for the corresponding key +) -> Result<()>

Append a value to the current datastore value for the corresponding key and the given address

source

fn append_ds_value_wasmv1( &self, key: &[u8], value: &[u8], address: Option<String> -) -> Result<()>

source

fn raw_delete_data(&self, key: &[u8]) -> Result<()>

Delete a datastore entry

-
source

fn raw_delete_data_for(&self, address: &str, key: &[u8]) -> Result<()>

Delete a datastore entry at of the given address

+) -> Result<()>
source

fn raw_delete_data(&self, key: &[u8]) -> Result<()>

Delete a datastore entry

+
source

fn raw_delete_data_for(&self, address: &str, key: &[u8]) -> Result<()>

Delete a datastore entry at of the given address

source

fn delete_ds_entry_wasmv1( &self, key: &[u8], address: Option<String> -) -> Result<()>

source

fn has_data(&self, key: &[u8]) -> Result<bool>

Requires to replace the data in the current address

+) -> Result<()>
source

fn has_data(&self, key: &[u8]) -> Result<bool>

Requires to replace the data in the current address

Note: The execution lib will always use the current context address for the update

-
source

fn has_data_for(&self, address: &str, key: &[u8]) -> Result<bool>

Check if a datastore entry exists

+
source

fn has_data_for(&self, address: &str, key: &[u8]) -> Result<bool>

Check if a datastore entry exists

source

fn ds_entry_exists_wasmv1( &self, key: &[u8], address: Option<String> -) -> Result<bool>

source

fn raw_get_bytecode(&self) -> Result<Vec<u8>>

Returns bytecode of the current address

-
source

fn raw_get_bytecode_for(&self, address: &str) -> Result<Vec<u8>>

Returns bytecode of the target address

-
source

fn get_bytecode_wasmv1(&self, address: Option<String>) -> Result<Vec<u8>>

source

fn get_op_keys(&self, prefix: Option<&[u8]>) -> Result<Vec<Vec<u8>>>

Return operation datastore keys

-
source

fn get_op_keys_wasmv1(&self, prefix: &[u8]) -> Result<Vec<Vec<u8>>>

source

fn op_entry_exists(&self, key: &[u8]) -> Result<bool>

Check if operation in datastore exists

-
source

fn get_op_data(&self, key: &[u8]) -> Result<Vec<u8>>

Return operation datastore data for a given key

-
source

fn caller_has_write_access(&self) -> Result<bool>

Check whether or not the caller has write access in the current context

-
source

fn hash(&self, data: &[u8]) -> Result<[u8; 32]>

Hash data

-
source

fn hash_blake3(&self, bytes: &[u8]) -> Result<[u8; 32]>

Returns the blake3 hash of the given bytes

+) -> Result<bool>
source

fn raw_get_bytecode(&self) -> Result<Vec<u8>>

Returns bytecode of the current address

+
source

fn raw_get_bytecode_for(&self, address: &str) -> Result<Vec<u8>>

Returns bytecode of the target address

+
source

fn get_bytecode_wasmv1(&self, address: Option<String>) -> Result<Vec<u8>>

source

fn get_op_keys(&self, prefix: Option<&[u8]>) -> Result<Vec<Vec<u8>>>

Return operation datastore keys

+
source

fn get_op_keys_wasmv1(&self, prefix: &[u8]) -> Result<Vec<Vec<u8>>>

source

fn op_entry_exists(&self, key: &[u8]) -> Result<bool>

Check if operation in datastore exists

+
source

fn get_op_data(&self, key: &[u8]) -> Result<Vec<u8>>

Return operation datastore data for a given key

+
source

fn caller_has_write_access(&self) -> Result<bool>

Check whether or not the caller has write access in the current context

+
source

fn hash(&self, data: &[u8]) -> Result<[u8; 32]>

Hash data

+
source

fn hash_blake3(&self, bytes: &[u8]) -> Result<[u8; 32]>

Returns the blake3 hash of the given bytes

source

fn signature_verify( &self, data: &[u8], signature: &str, public_key: &str -) -> Result<bool>

Verify signature

+) -> Result<bool>

Verify signature

source

fn evm_signature_verify( &self, message: &[u8], signature: &[u8], public_key: &[u8] -) -> Result<bool>

Verify signature (EVM)

-
source

fn evm_get_address_from_pubkey(&self, public_key: &[u8]) -> Result<Vec<u8>>

Get address from public key (EVM)

+) -> Result<bool>

Verify signature (EVM)

+
source

fn evm_get_address_from_pubkey(&self, public_key: &[u8]) -> Result<Vec<u8>>

Get address from public key (EVM)

source

fn evm_get_pubkey_from_signature( &self, hash: &[u8], signature: &[u8] -) -> Result<Vec<u8>>

Get public key from signature (EVM)

-
source

fn is_address_eoa(&self, address: &str) -> Result<bool>

Return true if the address is a User address, false if it is an SC +) -> Result<Vec<u8>>

Get public key from signature (EVM)

+
source

fn is_address_eoa(&self, address: &str) -> Result<bool>

Return true if the address is a User address, false if it is an SC address

-
source

fn address_from_public_key(&self, public_key: &str) -> Result<String>

Convert a public key to an address

-
source

fn validate_address(&self, address: &str) -> Result<bool>

Validate an address

-
source

fn get_time(&self) -> Result<u64>

Returns the current time (millisecond unix timestamp)

-
source

fn unsafe_random(&self) -> Result<i64>

Returns a random number (unsafe: can be predicted and manipulated)

-
source

fn unsafe_random_f64(&self) -> Result<f64>

Returns a random number (unsafe: can be predicted and manipulated)

-
source

fn unsafe_random_wasmv1(&self, num_bytes: u64) -> Result<Vec<u8>>

Returns a random number (unsafe: can be predicted and manipulated)

-
source

fn get_current_period(&self) -> Result<u64>

Returns the period of the current execution slot

-
source

fn get_current_thread(&self) -> Result<u8>

Returns the thread of the current execution slot

-
source

fn get_current_slot(&self) -> Result<Slot>

Returns the current execution slot

-
source

fn get_owned_addresses(&self) -> Result<Vec<String>>

Expect to return a list of owned addresses

+
source

fn address_from_public_key(&self, public_key: &str) -> Result<String>

Convert a public key to an address

+
source

fn validate_address(&self, address: &str) -> Result<bool>

Validate an address

+
source

fn get_time(&self) -> Result<u64>

Returns the current time (millisecond unix timestamp)

+
source

fn unsafe_random(&self) -> Result<i64>

Returns a random number (unsafe: can be predicted and manipulated)

+
source

fn unsafe_random_f64(&self) -> Result<f64>

Returns a random number (unsafe: can be predicted and manipulated)

+
source

fn unsafe_random_wasmv1(&self, num_bytes: u64) -> Result<Vec<u8>>

Returns a random number (unsafe: can be predicted and manipulated)

+
source

fn get_current_period(&self) -> Result<u64>

Returns the period of the current execution slot

+
source

fn get_current_thread(&self) -> Result<u8>

Returns the thread of the current execution slot

+
source

fn get_current_slot(&self) -> Result<Slot>

Returns the current execution slot

+
source

fn get_owned_addresses(&self) -> Result<Vec<String>>

Expect to return a list of owned addresses

Required on smart-contract execute the imported function assembly_script_get_owned_addresses

-
source

fn get_call_stack(&self) -> Result<Vec<String>>

Expect to return a list of addresses in the call stack

+
source

fn get_call_stack(&self) -> Result<Vec<String>>

Expect to return a list of addresses in the call stack

Required on smart-contract execute the imported function assembly_script_get_call_stack

-
source

fn generate_event(&self, _event: String) -> Result<()>

Generate a smart contract event

-
source

fn generate_event_wasmv1(&self, _event: Vec<u8>) -> Result<()>

Generate a smart contract event

-
source

fn get_module(&self, bytecode: &[u8], gas_limit: u64) -> Result<RuntimeModule>

For the given bytecode:

+
source

fn generate_event(&self, _event: String) -> Result<()>

Generate a smart contract event

+
source

fn generate_event_wasmv1(&self, _event: Vec<u8>) -> Result<()>

Generate a smart contract event

+
source

fn get_module(&self, bytecode: &[u8], gas_limit: u64) -> Result<RuntimeModule>

For the given bytecode:

  • Get the corresponding runtime module if it already exists
  • Compile it if not
  • @@ -408,7 +408,7 @@ &self, bytecode: &[u8], gas_limit: u64 -) -> Result<RuntimeModule>

    Compile a temportary module from the given bytecode

    +) -> Result<RuntimeModule>

    Compile a temportary module from the given bytecode

    Returns a SP compiled module and the remaining gas after loading

source

fn send_message( &self, @@ -421,7 +421,7 @@ raw_coins: u64, data: &[u8], filter: Option<(&str, Option<&[u8]>)> -) -> Result<()>

Sends an async message

+) -> Result<()>

Sends an async message

Arguments
  • target_address - Destination address hash in format string
  • @@ -435,74 +435,74 @@
    Arguments
  • coins - Coins of the sender
  • data - Message data
-
source

fn get_origin_operation_id(&self) -> Result<Option<String>>

source

fn hash_sha256(&self, bytes: &[u8]) -> Result<[u8; 32]>

source

fn hash_keccak256(&self, bytes: &[u8]) -> Result<[u8; 32]>

source

fn chain_id(&self) -> Result<u64>

source

fn native_amount_from_str_wasmv1(&self, amount: &str) -> Result<NativeAmount>

source

fn native_amount_to_string_wasmv1( +

source

fn get_origin_operation_id(&self) -> Result<Option<String>>

source

fn hash_sha256(&self, bytes: &[u8]) -> Result<[u8; 32]>

source

fn hash_keccak256(&self, bytes: &[u8]) -> Result<[u8; 32]>

source

fn chain_id(&self) -> Result<u64>

source

fn native_amount_from_str_wasmv1(&self, amount: &str) -> Result<NativeAmount>

source

fn native_amount_to_string_wasmv1( &self, amount: &NativeAmount -) -> Result<String>

source

fn check_native_amount_wasmv1(&self, amount: &NativeAmount) -> Result<bool>

source

fn add_native_amount_wasmv1( +) -> Result<String>

source

fn check_native_amount_wasmv1(&self, amount: &NativeAmount) -> Result<bool>

source

fn add_native_amount_wasmv1( &self, amount1: &NativeAmount, amount2: &NativeAmount -) -> Result<NativeAmount>

source

fn sub_native_amount_wasmv1( +) -> Result<NativeAmount>

source

fn sub_native_amount_wasmv1( &self, amount1: &NativeAmount, amount2: &NativeAmount -) -> Result<NativeAmount>

source

fn scalar_mul_native_amount_wasmv1( +) -> Result<NativeAmount>

source

fn scalar_mul_native_amount_wasmv1( &self, amount: &NativeAmount, factor: u64 -) -> Result<NativeAmount>

source

fn scalar_div_rem_native_amount_wasmv1( +) -> Result<NativeAmount>

source

fn scalar_div_rem_native_amount_wasmv1( &self, dividend: &NativeAmount, divisor: u64 -) -> Result<(NativeAmount, NativeAmount)>

source

fn div_rem_native_amount_wasmv1( +) -> Result<(NativeAmount, NativeAmount)>

source

fn div_rem_native_amount_wasmv1( &self, dividend: &NativeAmount, divisor: &NativeAmount -) -> Result<(u64, NativeAmount)>

source

fn check_address_wasmv1(&self, to_check: &str) -> Result<bool>

source

fn check_pubkey_wasmv1(&self, to_check: &str) -> Result<bool>

source

fn check_signature_wasmv1(&self, to_check: &str) -> Result<bool>

source

fn get_address_category_wasmv1(&self, to_check: &str) -> Result<AddressCategory>

source

fn get_address_version_wasmv1(&self, address: &str) -> Result<u64>

source

fn get_pubkey_version_wasmv1(&self, pubkey: &str) -> Result<u64>

source

fn get_signature_version_wasmv1(&self, signature: &str) -> Result<u64>

source

fn checked_add_native_time_wasmv1( +) -> Result<(u64, NativeAmount)>

source

fn check_address_wasmv1(&self, to_check: &str) -> Result<bool>

source

fn check_pubkey_wasmv1(&self, to_check: &str) -> Result<bool>

source

fn check_signature_wasmv1(&self, to_check: &str) -> Result<bool>

source

fn get_address_category_wasmv1(&self, to_check: &str) -> Result<AddressCategory>

source

fn get_address_version_wasmv1(&self, address: &str) -> Result<u64>

source

fn get_pubkey_version_wasmv1(&self, pubkey: &str) -> Result<u64>

source

fn get_signature_version_wasmv1(&self, signature: &str) -> Result<u64>

source

fn checked_add_native_time_wasmv1( &self, time1: &NativeTime, time2: &NativeTime -) -> Result<NativeTime>

source

fn checked_sub_native_time_wasmv1( +) -> Result<NativeTime>

source

fn checked_sub_native_time_wasmv1( &self, time1: &NativeTime, time2: &NativeTime -) -> Result<NativeTime>

source

fn checked_mul_native_time_wasmv1( +) -> Result<NativeTime>

source

fn checked_mul_native_time_wasmv1( &self, time: &NativeTime, factor: u64 -) -> Result<NativeTime>

source

fn checked_scalar_div_native_time_wasmv1( +) -> Result<NativeTime>

source

fn checked_scalar_div_native_time_wasmv1( &self, dividend: &NativeTime, divisor: u64 -) -> Result<(NativeTime, NativeTime)>

source

fn checked_div_native_time_wasmv1( +) -> Result<(NativeTime, NativeTime)>

source

fn checked_div_native_time_wasmv1( &self, dividend: &NativeTime, divisor: &NativeTime -) -> Result<(u64, NativeTime)>

source

fn base58_check_to_bytes_wasmv1(&self, s: &str) -> Result<Vec<u8>>

source

fn bytes_to_base58_check_wasmv1(&self, bytes: &[u8]) -> String

source

fn compare_address_wasmv1( +) -> Result<(u64, NativeTime)>

source

fn base58_check_to_bytes_wasmv1(&self, s: &str) -> Result<Vec<u8>>

source

fn bytes_to_base58_check_wasmv1(&self, bytes: &[u8]) -> String

source

fn compare_address_wasmv1( &self, left: &str, right: &str -) -> Result<ComparisonResult>

source

fn compare_native_amount_wasmv1( +) -> Result<ComparisonResult>

source

fn compare_native_amount_wasmv1( &self, left: &NativeAmount, right: &NativeAmount -) -> Result<ComparisonResult>

source

fn compare_native_time_wasmv1( +) -> Result<ComparisonResult>

source

fn compare_native_time_wasmv1( &self, left: &NativeTime, right: &NativeTime -) -> Result<ComparisonResult>

source

fn compare_pub_key_wasmv1( +) -> Result<ComparisonResult>

source

fn compare_pub_key_wasmv1( &self, left: &str, right: &str -) -> Result<ComparisonResult>

source

fn save_gas_remaining_before_subexecution(&self, gas_used_until: u64)

Provided Methods§

source

fn get_call_coins(&self) -> Result<u64>

Get the amount of coins that have been made available for use by the +) -> Result<ComparisonResult>

source

fn save_gas_remaining_before_subexecution(&self, gas_used_until: u64)

Provided Methods§

source

fn get_call_coins(&self) -> Result<u64>

Get the amount of coins that have been made available for use by the caller of the currently executing code.

-

Implementations§

source§

impl dyn Interface

source

pub fn get_data<T: DeserializeOwned>(&self, key: &[u8]) -> Result<T>

source

pub fn get_data_for<T: DeserializeOwned>( +

Implementations§

source§

impl dyn Interface

source

pub fn get_data<T: DeserializeOwned>(&self, key: &[u8]) -> Result<T>

source

pub fn get_data_for<T: DeserializeOwned>( &self, address: &str, key: &[u8] -) -> Result<T>

source

pub fn set_data<T: Serialize>(&self, key: &[u8], value: &T) -> Result<()>

source

pub fn set_data_for<T: Serialize>( +) -> Result<T>

source

pub fn set_data<T: Serialize>(&self, key: &[u8], value: &T) -> Result<()>

source

pub fn set_data_for<T: Serialize>( &self, address: &str, key: &[u8], value: &T -) -> Result<()>

Trait Implementations§

source§

impl Clone for Box<dyn Interface>

source§

fn clone(&self) -> Box<dyn Interface>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§

\ No newline at end of file +) -> Result<()>

Trait Implementations§

source§

impl Clone for Box<dyn Interface>

source§

fn clone(&self) -> Box<dyn Interface>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§

\ No newline at end of file