Skip to content

feat(drive-abci): extra strategy tests and some fixes to sdk - #2901

Merged
QuantumExplorer merged 5 commits into
feat/platformAddressesfrom
feat/extraStrategyTests
Dec 16, 2025
Merged

QuantumExplorer merged 5 commits into
feat/platformAddressesfrom
feat/extraStrategyTests

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Dec 16, 2025 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Adds support for IdentityCreateFromAddresses and IdentityTransferToAddresses operations in the strategy tests framework, enables the output parameter in identity creation from addresses, and moves shared test utilities to the strategy-tests
crate for better code reuse.

What was done?

  1. Added output parameter to IdentityCreateFromAddressesTransition::try_from_inputs_with_signer

Updated the method signature in three files to support specifying an output address:

  • Trait definition (methods/v0/mod.rs): Added output: Option<(PlatformAddress, Credits)> parameter
  • V0 implementation (v0/v0_methods.rs): Added parameter and explicit field initialization
  • Parent implementation (methods/mod.rs): Added parameter and delegation to V0
  1. Moved AddressesWithBalance to strategy-tests crate

Moved the AddressesWithBalance struct from rs-drive-abci/tests/strategy_tests/ to strategy-tests/src/addresses_with_balance.rs:

  • Added register_new_address(address, balance) method for registering newly created addresses
  • Re-exported from rs-drive-abci for backwards compatibility
  • Enables sharing this type between strategy-tests and other crates
  1. Added new OperationType variants

IdentityTransferToAddresses (operations.rs:647-652):
IdentityTransferToAddresses(
AmountRange,
OutputCountRange,
UseExistingAddressesAsOutputChance,
Option,
)

IdentityCreateFromAddresses (operations.rs:653-661):
IdentityCreateFromAddresses(
AmountRange,
MaybeOutputAmount,
Option,
KeyCount,
ExtraKeys,
)

Both variants include serialization/deserialization support.

  1. Added helper functions in transitions.rs
  • create_identity_credit_transfer_to_addresses_transition: Creates state transitions to transfer credits from identity to multiple newly created addresses
  • create_identity_credit_transfer_to_addresses_transition_with_outputs: Creates state transitions with pre-specified output addresses
  1. Added strategy test implementations in strategy.rs
  • IdentityCreateFromAddresses match arm (lines 1218-1246): Creates identities from funded addresses and adds them to current_identities
  • IdentityTransferToAddresses match arm: Transfers credits from identities to addresses
  • create_identity_from_addresses_transition method: Helper that creates identity + transition from address funds
  • Improved IdentityTransfer handling with specific sender/recipient support
  1. Added new tests

Strategy test (address_tests.rs):

  • run_chain_identity_to_addresses_transitions: Tests IdentityTransferToAddresses operation
  • run_chain_identity_create_from_addresses_transitions: Tests IdentityCreateFromAddresses operation

Unit test (identity_create_from_addresses/tests.rs):

  • test_identity_already_exists_with_same_id: Verifies that creating an identity with inputs that would produce the same ID as an existing identity returns IdentityAlreadyExistsError

How Has This Been Tested?

Verify compilation

cargo check -p strategy-tests
cargo check -p drive-abci --test strategy_tests

Run new unit test

cargo test -p drive-abci test_identity_already_exists_with_same_id

Run strategy tests

cargo test -p drive-abci --test strategy_tests run_chain_identity_to_addresses_transitions
cargo test -p drive-abci --test strategy_tests run_chain_identity_create_from_addresses_transitions

Breaking Changes

  • IdentityCreateFromAddressesTransitionMethodsV0::try_from_inputs_with_signer: Added new required parameter output: Option<(PlatformAddress, Credits)> after inputs. All existing callers must be updated to pass this parameter (can pass None to
    maintain previous behavior).

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@coderabbitai

coderabbitai Bot commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/extraStrategyTests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

✅ gRPC Query Coverage Report

================================================================================
gRPC Query Coverage Report - NEW QUERIES ONLY
================================================================================

Total queries in proto: 49
Previously known queries: 47
New queries found: 2

================================================================================

New Query Implementation Status:
--------------------------------------------------------------------------------
✓ getAddressInfo                                /home/runner/work/platform/platform/packages/rs-sdk/src/platform/query.rs
✓ getAddressesInfos                             /home/runner/work/platform/platform/packages/rs-sdk/src/platform/fetch_many.rs

================================================================================
Summary:
--------------------------------------------------------------------------------
New queries implemented: 2 (100.0%)
New queries missing: 0 (0.0%)

Total known queries: 49
  - Implemented: 46
  - Not implemented: 2
  - Excluded: 1

Not implemented queries:
  - getConsensusParams
  - getTokenPreProgrammedDistributions

@github-actions

Copy link
Copy Markdown
Contributor

✅ DashSDKFFI.xcframework built for this PR.

SwiftPM (host the zip at a stable URL, then use):

.binaryTarget(
  name: "DashSDKFFI",
  url: "https://your.cdn.example/DashSDKFFI.xcframework.zip",
  checksum: "b47755d05001ea5ed7c9f041214038ec89bebc6b3df2f41c849cc517bdd14b6c"
)

Xcode manual integration:

  • Download 'DashSDKFFI.xcframework' artifact from the run link above.
  • Drag it into your app target (Frameworks, Libraries & Embedded Content) and set Embed & Sign.
  • If using the Swift wrapper package, point its binaryTarget to the xcframework location or add the package and place the xcframework at the expected path.

@QuantumExplorer
QuantumExplorer merged commit a64e491 into feat/platformAddresses Dec 16, 2025
@QuantumExplorer
QuantumExplorer deleted the feat/extraStrategyTests branch December 16, 2025 13:09
@thephez thephez added this to the v3.0 milestone Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants