Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions mvx-esdt-safe/tests/mvx_esdt_safe_blackbox_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use structs::configs::{
UpdateEsdtSafeConfigOperation,
};
use structs::forge::ScArray;
use structs::OperationHashStatus;
use structs::{
aliases::{OptionalValueTransferDataTuple, PaymentsVec},
configs::EsdtSafeConfig,
Expand Down Expand Up @@ -441,6 +442,44 @@ impl MvxEsdtSafeTestState {
.assert_expected_error_message(result, expected_error_message);
}

pub fn register_and_execute_operation(
&mut self,
operation: &Operation<StaticApi>,
hash_of_hashes: &ManagedBuffer<StaticApi>,
signature: ManagedBuffer<StaticApi>,
num_validators: usize,
expected_logs: Vec<ExpectedLogs>,
check_hash_status: bool,
) {
let epoch = 0;
let operation_hash = self.common_setup.get_operation_hash(operation);
let bitmap = self.common_setup.full_bitmap(num_validators as u64);

let operations_hashes =
MultiValueEncoded::from(ManagedVec::from(vec![operation_hash.clone()]));

self.common_setup.register_operation(
OWNER_ADDRESS,
signature,
hash_of_hashes,
bitmap,
epoch,
operations_hashes,
);

if check_hash_status {
self.common_setup
.check_operation_hash_status(&operation_hash, OperationHashStatus::NotLocked);
}

self.execute_operation(hash_of_hashes, operation, expected_logs);

if check_hash_status {
self.common_setup
.check_operation_hash_status_is_empty(&operation_hash);
}
}

pub fn execute_operation(
&mut self,
hash_of_hashes: &ManagedBuffer<StaticApi>,
Expand Down
Loading
Loading