Closed pauldelucia closed 3 weeks ago
The pull request introduces significant updates to the testing framework for the run_chain_for_strategy
function and related components. It adds new test cases, modifies existing ones, and enhances error handling and assertions across various test files. Changes also include updates to method signatures and data structures, particularly around identity transfers and state transitions. The modifications aim to improve the robustness and clarity of the tests and the underlying logic related to identity management and operations.
File Path | Change Summary |
---|---|
packages/rs-drive-abci/tests/strategy_tests/main.rs |
- Added multiple new test cases for identity operations, including insertions and transfers. - Modified existing tests to include new parameters and logic changes. - Enhanced error handling and assertions. - Updated test configurations. |
packages/rs-drive-abci/tests/strategy_tests/strategy.rs |
- Removed import of instant_asset_lock_proof_fixture . - Updated identity_state_transitions_for_block method to use iterator with filter_map for handling identities. - Modified pattern matching for OperationType::IdentityTransfer . |
packages/rs-drive-abci/tests/strategy_tests/voting_tests.rs |
- Changed start_identities variable to define it as a vector of tuples (Identity, Option<StateTransition>) across multiple test functions, enhancing clarity. |
packages/strategy-tests/src/lib.rs |
- Updated hard_coded field in StartIdentities struct to allow optional StateTransition . - Modified identity_transfer operation in operations_based_transitions to accept an optional parameter. |
packages/strategy-tests/src/operations.rs |
- Introduced IdentityTransferInfo struct for identity transfer details. - Updated IdentityTransfer variant in OperationType to accept optional IdentityTransferInfo . |
packages/strategy-tests/src/transitions.rs |
- Changed create_identity_credit_transfer_transition function to accept an immutable reference for identity . - Added comments and documentation updates for clarity. |
enhancement
, rs-sdk
π "In the realm of code, we hop and play,
New tests and changes brighten the day.
With identities dancing, transfers in sight,
Our functions now shine, oh what a delight!
So letβs celebrate this code we adore,
With each little change, we discover much more!" π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Issue being fixed or feature implemented
Changed
StartIdentities
hard_coded
field so that theStateTransition
is optional. This way we can easily use identities that already exist in the chain.Also added handling for credit transfers where the sender and recipient are hardcoded, whereas before they were randomly selected from the known identities each time. This included optionally passing a new struct IdentityTransferInfo to OperationType::IdentityTransfer which specifies sender, recipient, and amount.
What was done?
How Has This Been Tested?
platform-tui
Breaking Changes
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Summary by CodeRabbit
New Features
IdentityTransferInfo
, to encapsulate identity transfer details.Bug Fixes
Refactor