Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new wrapper function register_and_execute_operation to reduce code duplication in tests and refactors multiple test functions to use this wrapper. It also includes some code quality improvements such as replacing repeated code with loops.
Key Changes:
- Added
register_and_execute_operationhelper function that combines operation registration, status checking, and execution into a single call - Refactored 8 test functions to use the new wrapper, eliminating repetitive boilerplate code
- Simplified repetitive checks by introducing loops for checking multiple addresses and tokens
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mvx_esdt_safe_blackbox_setup.rs | Added new register_and_execute_operation wrapper function to consolidate operation registration, status checking, and execution logic |
| mvx_esdt_safe_blackbox_tests.rs | Refactored multiple test functions to use the new wrapper, moved variable declarations for better organization, and replaced repetitive assertion code with loops |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage SummaryTotals
FilesExpand
|
|
Contract comparison - from 9a8ae62 to 3e2c326
|
|
|
||
| state.common_setup.register_operation( | ||
| USER_ADDRESS, | ||
| OWNER_ADDRESS, |
There was a problem hiding this comment.
| OWNER_ADDRESS, | |
| USER_ADDRESS, |
The caller can be any address as long as it's in the same shard as the contract (otherwise the tx might fail) and the payload is correct.
-> Let's use USER_ADDRESS because that's what you check below.
| signature: ManagedBuffer<StaticApi>, | ||
| num_validators: usize, | ||
| expected_logs: Vec<ExpectedLogs>, | ||
| check_status: bool, |
There was a problem hiding this comment.
rename to check_hash_status
No description provided.