diff --git a/common/proxies/src/enshrine_esdt_safe_proxy.rs b/common/proxies/src/enshrine_esdt_safe_proxy.rs index c778e062..c239166a 100644 --- a/common/proxies/src/enshrine_esdt_safe_proxy.rs +++ b/common/proxies/src/enshrine_esdt_safe_proxy.rs @@ -189,94 +189,6 @@ where .original_result() } - pub fn set_max_tx_batch_size< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_size: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchSize") - .argument(&new_max_tx_batch_size) - .original_result() - } - - pub fn set_max_tx_batch_block_duration< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_block_duration: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchBlockDuration") - .argument(&new_max_tx_batch_block_duration) - .original_result() - } - - pub fn get_current_tx_batch( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getCurrentTxBatch") - .original_result() - } - - pub fn get_first_batch_any_status( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchAnyStatus") - .original_result() - } - - pub fn get_batch< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatch") - .argument(&batch_id) - .original_result() - } - - pub fn get_batch_status< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatchStatus") - .argument(&batch_id) - .original_result() - } - - pub fn first_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchId") - .original_result() - } - - pub fn last_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getLastBatchId") - .original_result() - } - pub fn set_max_bridged_amount< Arg0: ProxyArg>, Arg1: ProxyArg>, diff --git a/common/proxies/src/esdt_safe_proxy.rs b/common/proxies/src/esdt_safe_proxy.rs index a6d93e5e..3d4dd625 100644 --- a/common/proxies/src/esdt_safe_proxy.rs +++ b/common/proxies/src/esdt_safe_proxy.rs @@ -192,94 +192,6 @@ where .original_result() } - pub fn set_max_tx_batch_size< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_size: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchSize") - .argument(&new_max_tx_batch_size) - .original_result() - } - - pub fn set_max_tx_batch_block_duration< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_block_duration: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchBlockDuration") - .argument(&new_max_tx_batch_block_duration) - .original_result() - } - - pub fn get_current_tx_batch( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getCurrentTxBatch") - .original_result() - } - - pub fn get_first_batch_any_status( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchAnyStatus") - .original_result() - } - - pub fn get_batch< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatch") - .argument(&batch_id) - .original_result() - } - - pub fn get_batch_status< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatchStatus") - .argument(&batch_id) - .original_result() - } - - pub fn first_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchId") - .original_result() - } - - pub fn last_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getLastBatchId") - .original_result() - } - pub fn set_max_bridged_amount< Arg0: ProxyArg>, Arg1: ProxyArg>, diff --git a/common/tx-batch-module/src/batch_status.rs b/common/tx-batch-module/src/batch_status.rs deleted file mode 100644 index cdf6f902..00000000 --- a/common/tx-batch-module/src/batch_status.rs +++ /dev/null @@ -1,16 +0,0 @@ -multiversx_sc::derive_imports!(); - -use multiversx_sc::{api::ManagedTypeApi, types::ManagedVec}; -use transaction::{BlockNonce, TxNonce}; - -#[derive(TopEncode, TopDecode, TypeAbi)] -pub enum BatchStatus { - AlreadyProcessed, - Empty, - PartiallyFull { - end_block_nonce: BlockNonce, - tx_ids: ManagedVec, - }, - Full, - WaitingForSignatures, -} diff --git a/common/tx-batch-module/src/lib.rs b/common/tx-batch-module/src/lib.rs index 527f2795..6e94ebe7 100644 --- a/common/tx-batch-module/src/lib.rs +++ b/common/tx-batch-module/src/lib.rs @@ -3,247 +3,10 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -pub use batch_status::BatchStatus; -use transaction::{BatchId, Transaction, TxBatchSplitInFields, TxNonce, MIN_BLOCKS_FOR_FINALITY}; -use tx_batch_mapper::TxBatchMapper; - -pub const FIRST_BATCH_ID: BatchId = 1; - -pub mod batch_status; -pub mod tx_batch_mapper; +use transaction::TxNonce; #[multiversx_sc::module] pub trait TxBatchModule { - // endpoints - owner-only - - #[only_owner] - #[endpoint(setMaxTxBatchSize)] - fn set_max_tx_batch_size(&self, new_max_tx_batch_size: usize) { - require!( - new_max_tx_batch_size > 0, - "Max tx batch size must be more than 0" - ); - - self.max_tx_batch_size().set(new_max_tx_batch_size); - } - - #[only_owner] - #[endpoint(setMaxTxBatchBlockDuration)] - fn set_max_tx_batch_block_duration(&self, new_max_tx_batch_block_duration: u64) { - require!( - new_max_tx_batch_block_duration > 0, - "Max tx batch block duration must be more than 0" - ); - - self.max_tx_batch_block_duration() - .set(new_max_tx_batch_block_duration); - } - - // views - - #[view(getCurrentTxBatch)] - fn get_current_tx_batch(&self) -> OptionalValue> { - let first_batch_id = self.first_batch_id().get(); - let first_batch = self.pending_batches(first_batch_id); - - if self.is_batch_full(&first_batch, first_batch_id, first_batch_id) - && self.is_batch_final(&first_batch) - { - let mut result_vec = MultiValueEncoded::new(); - for tx in first_batch.iter() { - result_vec.push(tx.into_multiresult()); - } - - return OptionalValue::Some((first_batch_id, result_vec).into()); - } - - OptionalValue::None - } - - #[view(getFirstBatchAnyStatus)] - fn get_first_batch_any_status(&self) -> OptionalValue> { - let first_batch_id = self.first_batch_id().get(); - self.get_batch(first_batch_id) - } - - #[view(getBatch)] - fn get_batch(&self, batch_id: BatchId) -> OptionalValue> { - let tx_batch = self.pending_batches(batch_id); - if tx_batch.is_empty() { - return OptionalValue::None; - } - - let mut result_vec = MultiValueEncoded::new(); - for tx in tx_batch.iter() { - result_vec.push(tx.into_multiresult()); - } - - OptionalValue::Some((batch_id, result_vec).into()) - } - - #[view(getBatchStatus)] - fn get_batch_status(&self, batch_id: BatchId) -> BatchStatus { - let first_batch_id = self.first_batch_id().get(); - if batch_id < first_batch_id { - return BatchStatus::AlreadyProcessed; - } - - let tx_batch = self.pending_batches(batch_id); - if tx_batch.is_empty() { - return BatchStatus::Empty; - } - - if self.is_batch_full(&tx_batch, batch_id, first_batch_id) { - if batch_id == first_batch_id { - return BatchStatus::WaitingForSignatures; - } else { - return BatchStatus::Full; - } - } - - let mut tx_ids = ManagedVec::new(); - for tx in tx_batch.iter() { - tx_ids.push(tx.nonce); - } - - let max_tx_batch_block_duration = self.max_tx_batch_block_duration().get(); - let first_tx_in_batch_block_nonce = tx_batch.get_first_tx().block_nonce; - - BatchStatus::PartiallyFull { - end_block_nonce: first_tx_in_batch_block_nonce + max_tx_batch_block_duration, - tx_ids, - } - } - - // private - - fn add_to_batch(&self, transaction: Transaction) -> BatchId { - let first_batch_id = self.first_batch_id().get(); - let last_batch_id = self.last_batch_id().get(); - let mut last_batch = self.pending_batches(last_batch_id); - - if self.is_batch_full(&last_batch, last_batch_id, first_batch_id) { - let (new_batch_id, _) = self.create_new_batch(transaction); - - new_batch_id - } else { - last_batch.push(transaction); - - last_batch_id - } - } - - // optimized to prevent reading/storing the batch over and over - fn add_multiple_tx_to_batch( - &self, - transactions: &ManagedVec>, - ) -> ManagedVec { - if transactions.is_empty() { - return ManagedVec::new(); - } - - let first_batch_id = self.first_batch_id().get(); - let mut last_batch_id = self.last_batch_id().get(); - let mut last_batch = self.pending_batches(last_batch_id); - let mut batch_ids = ManagedVec::new(); - - for tx in transactions { - if self.is_batch_full(&last_batch, last_batch_id, first_batch_id) { - (last_batch_id, last_batch) = self.create_new_batch(tx); - } else { - last_batch.push(tx); - } - - batch_ids.push(last_batch_id); - } - - batch_ids - } - - fn create_new_batch( - &self, - transaction: Transaction, - ) -> (BatchId, TxBatchMapper) { - let last_batch_id = self.last_batch_id().get(); - let new_batch_id = last_batch_id + 1; - - let mut new_batch = self.pending_batches(new_batch_id); - new_batch.push(transaction); - - self.last_batch_id().set(new_batch_id); - - (new_batch_id, new_batch) - } - - fn is_batch_full( - &self, - tx_batch: &TxBatchMapper, - batch_id: BatchId, - first_batch_id: BatchId, - ) -> bool { - if tx_batch.is_empty() { - return false; - } - - let max_batch_size = self.max_tx_batch_size().get(); - if tx_batch.len() == max_batch_size { - return true; - } - - // if this is not the first batch, we ignore the timestamp checks - // we only check for max len - if batch_id > first_batch_id { - return false; - } - - let current_block_nonce = self.blockchain().get_block_nonce(); - let first_tx_in_batch_block_nonce = tx_batch.get_first_tx().block_nonce; - - // reorg protection - if current_block_nonce < first_tx_in_batch_block_nonce { - return false; - } - - let block_diff = current_block_nonce - first_tx_in_batch_block_nonce; - let max_tx_batch_block_duration = self.max_tx_batch_block_duration().get(); - - block_diff >= max_tx_batch_block_duration - } - - fn is_batch_final(&self, tx_batch: &TxBatchMapper) -> bool { - if tx_batch.is_empty() { - return false; - } - - let last_tx_in_batch = tx_batch.get_last_tx(); - let current_block = self.blockchain().get_block_nonce(); - - // reorg protection - if current_block < last_tx_in_batch.block_nonce { - return false; - } - - let block_diff = current_block - last_tx_in_batch.block_nonce; - - block_diff > MIN_BLOCKS_FOR_FINALITY - } - - fn clear_first_batch(&self, mapper: &mut TxBatchMapper) { - let first_batch_id = self.first_batch_id().get(); - let new_first_batch_id = first_batch_id + 1; - - // for the case when the last existing batch was processed - // otherwise, we'd create a batch with the same ID again - self.last_batch_id().update(|last_batch_id| { - if *last_batch_id == first_batch_id { - *last_batch_id = new_first_batch_id; - } - }); - self.first_batch_id().set(new_first_batch_id); - - mapper.clear(); - } - fn get_and_save_next_tx_id(&self) -> TxNonce { self.last_tx_nonce().update(|last_tx_nonce| { *last_tx_nonce += 1; @@ -251,27 +14,6 @@ pub trait TxBatchModule { }) } - // storage - - #[view(getFirstBatchId)] - #[storage_mapper("firstBatchId")] - fn first_batch_id(&self) -> SingleValueMapper; - - #[view(getLastBatchId)] - #[storage_mapper("lastBatchId")] - fn last_batch_id(&self) -> SingleValueMapper; - - #[storage_mapper("pendingBatches")] - fn pending_batches(&self, batch_id: BatchId) -> TxBatchMapper; - #[storage_mapper("lastTxNonce")] fn last_tx_nonce(&self) -> SingleValueMapper; - - // configurable - - #[storage_mapper("maxTxBatchSize")] - fn max_tx_batch_size(&self) -> SingleValueMapper; - - #[storage_mapper("maxTxBatchBlockDuration")] - fn max_tx_batch_block_duration(&self) -> SingleValueMapper; } diff --git a/common/tx-batch-module/src/tx_batch_mapper.rs b/common/tx-batch-module/src/tx_batch_mapper.rs deleted file mode 100644 index 589d7c08..00000000 --- a/common/tx-batch-module/src/tx_batch_mapper.rs +++ /dev/null @@ -1,141 +0,0 @@ -use multiversx_sc::{ - api::{ErrorApiImpl, StorageMapperApi}, - storage::{ - mappers::{StorageClearable, StorageMapper, VecMapper}, - StorageKey, - }, -}; -use transaction::Transaction; - -static EMPTY_VEC_ERR_MSG: &[u8] = b"Empty vec"; - -pub struct TxBatchMapper -where - SA: StorageMapperApi, -{ - vec_mapper: VecMapper>, - vec_len: usize, - first_tx: Option>, - last_tx: Option>, -} - -impl StorageMapper for TxBatchMapper -where - SA: StorageMapperApi, -{ - fn new(base_key: StorageKey) -> Self { - let vec_mapper = VecMapper::new(base_key); - let vec_len = vec_mapper.len(); - - let (first_tx, last_tx) = if vec_len > 0 { - (Some(vec_mapper.get(1)), Some(vec_mapper.get(vec_len))) - } else { - (None, None) - }; - - TxBatchMapper { - vec_mapper, - vec_len, - first_tx, - last_tx, - } - } -} - -impl StorageClearable for TxBatchMapper -where - SA: StorageMapperApi, -{ - fn clear(&mut self) { - self.vec_mapper.clear(); - } -} - -impl TxBatchMapper -where - SA: StorageMapperApi, -{ - #[inline] - pub fn len(&self) -> usize { - self.vec_len - } - - #[inline] - pub fn is_empty(&self) -> bool { - self.len() == 0 - } - - pub fn get_first_tx(&self) -> &Transaction { - if self.is_empty() { - SA::error_api_impl().signal_error(EMPTY_VEC_ERR_MSG); - } - - unsafe { self.first_tx.as_ref().unwrap_unchecked() } - } - - pub fn get_last_tx(&self) -> &Transaction { - if self.is_empty() { - SA::error_api_impl().signal_error(EMPTY_VEC_ERR_MSG); - } - - unsafe { self.last_tx.as_ref().unwrap_unchecked() } - } - - pub fn push(&mut self, tx: Transaction) { - if self.is_empty() { - self.first_tx = Some(tx.clone()); - } - - self.vec_mapper.push(&tx); - self.vec_len += 1; - self.last_tx = Some(tx); - } - - /// Provides a forward iterator. - pub fn iter(&self) -> Iter<'_, SA> { - Iter::new(self) - } -} - -pub struct Iter<'a, SA> -where - SA: StorageMapperApi, -{ - index: usize, - mapper: &'a TxBatchMapper, -} - -impl<'a, SA> Iter<'a, SA> -where - SA: StorageMapperApi, -{ - fn new(mapper: &'a TxBatchMapper) -> Iter<'a, SA> { - Iter { index: 1, mapper } - } -} - -impl<'a, SA> Iterator for Iter<'a, SA> -where - SA: StorageMapperApi, -{ - type Item = Transaction; - - #[inline] - fn next(&mut self) -> Option { - let current_index = self.index; - if current_index > self.mapper.len() { - return None; - } - - self.index += 1; - - if current_index == 1 { - return Some(self.mapper.get_first_tx().clone()); - } - if current_index == self.mapper.len() { - return Some(self.mapper.get_last_tx().clone()); - } - - Some(self.mapper.vec_mapper.get_unchecked(current_index)) - } -} diff --git a/enshrine-esdt-safe/interactor/src/proxy.rs b/enshrine-esdt-safe/interactor/src/proxy.rs index c778e062..c239166a 100644 --- a/enshrine-esdt-safe/interactor/src/proxy.rs +++ b/enshrine-esdt-safe/interactor/src/proxy.rs @@ -189,94 +189,6 @@ where .original_result() } - pub fn set_max_tx_batch_size< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_size: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchSize") - .argument(&new_max_tx_batch_size) - .original_result() - } - - pub fn set_max_tx_batch_block_duration< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_block_duration: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchBlockDuration") - .argument(&new_max_tx_batch_block_duration) - .original_result() - } - - pub fn get_current_tx_batch( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getCurrentTxBatch") - .original_result() - } - - pub fn get_first_batch_any_status( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchAnyStatus") - .original_result() - } - - pub fn get_batch< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatch") - .argument(&batch_id) - .original_result() - } - - pub fn get_batch_status< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatchStatus") - .argument(&batch_id) - .original_result() - } - - pub fn first_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchId") - .original_result() - } - - pub fn last_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getLastBatchId") - .original_result() - } - pub fn set_max_bridged_amount< Arg0: ProxyArg>, Arg1: ProxyArg>, diff --git a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/src/lib.rs b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/src/lib.rs index 599d8a96..0813353d 100644 --- a/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/src/lib.rs +++ b/enshrine-esdt-safe/wasm-enshrine-esdt-safe-full/src/lib.rs @@ -6,9 +6,9 @@ // Init: 1 // Upgrade: 1 -// Endpoints: 27 +// Endpoints: 19 // Async Callback: 1 -// Total number of exported functions: 30 +// Total number of exported functions: 22 #![no_std] @@ -27,14 +27,6 @@ multiversx_sc_wasm_adapter::endpoints! { deposit => deposit executeBridgeOps => execute_operations registerNewTokenID => register_new_token_id - setMaxTxBatchSize => set_max_tx_batch_size - setMaxTxBatchBlockDuration => set_max_tx_batch_block_duration - getCurrentTxBatch => get_current_tx_batch - getFirstBatchAnyStatus => get_first_batch_any_status - getBatch => get_batch - getBatchStatus => get_batch_status - getFirstBatchId => first_batch_id - getLastBatchId => last_batch_id setMaxBridgedAmount => set_max_bridged_amount getMaxBridgedAmount => max_bridged_amount endSetupPhase => end_setup_phase diff --git a/enshrine-esdt-safe/wasm/src/lib.rs b/enshrine-esdt-safe/wasm/src/lib.rs index 599d8a96..0813353d 100644 --- a/enshrine-esdt-safe/wasm/src/lib.rs +++ b/enshrine-esdt-safe/wasm/src/lib.rs @@ -6,9 +6,9 @@ // Init: 1 // Upgrade: 1 -// Endpoints: 27 +// Endpoints: 19 // Async Callback: 1 -// Total number of exported functions: 30 +// Total number of exported functions: 22 #![no_std] @@ -27,14 +27,6 @@ multiversx_sc_wasm_adapter::endpoints! { deposit => deposit executeBridgeOps => execute_operations registerNewTokenID => register_new_token_id - setMaxTxBatchSize => set_max_tx_batch_size - setMaxTxBatchBlockDuration => set_max_tx_batch_block_duration - getCurrentTxBatch => get_current_tx_batch - getFirstBatchAnyStatus => get_first_batch_any_status - getBatch => get_batch - getBatchStatus => get_batch_status - getFirstBatchId => first_batch_id - getLastBatchId => last_batch_id setMaxBridgedAmount => set_max_bridged_amount getMaxBridgedAmount => max_bridged_amount endSetupPhase => end_setup_phase diff --git a/esdt-safe/interactor/src/proxy.rs b/esdt-safe/interactor/src/proxy.rs index a6d93e5e..3d4dd625 100644 --- a/esdt-safe/interactor/src/proxy.rs +++ b/esdt-safe/interactor/src/proxy.rs @@ -192,94 +192,6 @@ where .original_result() } - pub fn set_max_tx_batch_size< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_size: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchSize") - .argument(&new_max_tx_batch_size) - .original_result() - } - - pub fn set_max_tx_batch_block_duration< - Arg0: ProxyArg, - >( - self, - new_max_tx_batch_block_duration: Arg0, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("setMaxTxBatchBlockDuration") - .argument(&new_max_tx_batch_block_duration) - .original_result() - } - - pub fn get_current_tx_batch( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getCurrentTxBatch") - .original_result() - } - - pub fn get_first_batch_any_status( - self, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchAnyStatus") - .original_result() - } - - pub fn get_batch< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall, ManagedAddress, ManagedVec>, ManagedVec>, Option>>>>>> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatch") - .argument(&batch_id) - .original_result() - } - - pub fn get_batch_status< - Arg0: ProxyArg, - >( - self, - batch_id: Arg0, - ) -> TxTypedCall> { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getBatchStatus") - .argument(&batch_id) - .original_result() - } - - pub fn first_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getFirstBatchId") - .original_result() - } - - pub fn last_batch_id( - self, - ) -> TxTypedCall { - self.wrapped_tx - .payment(NotPayable) - .raw_call("getLastBatchId") - .original_result() - } - pub fn set_max_bridged_amount< Arg0: ProxyArg>, Arg1: ProxyArg>, diff --git a/esdt-safe/wasm-esdt-safe-full/src/lib.rs b/esdt-safe/wasm-esdt-safe-full/src/lib.rs index 64f9d0a1..aa3bfcc9 100644 --- a/esdt-safe/wasm-esdt-safe-full/src/lib.rs +++ b/esdt-safe/wasm-esdt-safe-full/src/lib.rs @@ -6,10 +6,10 @@ // Init: 1 // Upgrade: 1 -// Endpoints: 27 +// Endpoints: 19 // Async Callback (empty): 1 // Promise callbacks: 2 -// Total number of exported functions: 32 +// Total number of exported functions: 24 #![no_std] @@ -28,14 +28,6 @@ multiversx_sc_wasm_adapter::endpoints! { deposit => deposit registerToken => register_token executeBridgeOps => execute_operations - setMaxTxBatchSize => set_max_tx_batch_size - setMaxTxBatchBlockDuration => set_max_tx_batch_block_duration - getCurrentTxBatch => get_current_tx_batch - getFirstBatchAnyStatus => get_first_batch_any_status - getBatch => get_batch - getBatchStatus => get_batch_status - getFirstBatchId => first_batch_id - getLastBatchId => last_batch_id setMaxBridgedAmount => set_max_bridged_amount getMaxBridgedAmount => max_bridged_amount endSetupPhase => end_setup_phase diff --git a/esdt-safe/wasm/src/lib.rs b/esdt-safe/wasm/src/lib.rs index 64f9d0a1..aa3bfcc9 100644 --- a/esdt-safe/wasm/src/lib.rs +++ b/esdt-safe/wasm/src/lib.rs @@ -6,10 +6,10 @@ // Init: 1 // Upgrade: 1 -// Endpoints: 27 +// Endpoints: 19 // Async Callback (empty): 1 // Promise callbacks: 2 -// Total number of exported functions: 32 +// Total number of exported functions: 24 #![no_std] @@ -28,14 +28,6 @@ multiversx_sc_wasm_adapter::endpoints! { deposit => deposit registerToken => register_token executeBridgeOps => execute_operations - setMaxTxBatchSize => set_max_tx_batch_size - setMaxTxBatchBlockDuration => set_max_tx_batch_block_duration - getCurrentTxBatch => get_current_tx_batch - getFirstBatchAnyStatus => get_first_batch_any_status - getBatch => get_batch - getBatchStatus => get_batch_status - getFirstBatchId => first_batch_id - getLastBatchId => last_batch_id setMaxBridgedAmount => set_max_bridged_amount getMaxBridgedAmount => max_bridged_amount endSetupPhase => end_setup_phase