Skip to content

Conversation

@pauldelucia
Copy link
Member

@pauldelucia pauldelucia commented Jan 29, 2026

Issue being fixed or feature implemented

rs-sdk required user to include platform address nonce when funding a new identity with platform address, rather than doing it internally like it does with most other state transitions.

What was done?

Add a convenience method that automatically fetches and increments nonces for identity creation from addresses, matching the pattern used by other address-based operations (top_up_from_addresses, transfer_address_funds, etc.).

  • Add put_from_addresses for automatic nonce handling
  • Rename put_with_address_funding to put_from_addresses_with_nonce for consistency
  • Update wasm-sdk to use the renamed method

How Has This Been Tested?

DET

Breaking Changes

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced automatic nonce handling for identity creation workflows, simplifying client-side address management.
  • Breaking Changes

    • Replaced the previous identity creation method with two updated variants that handle nonce fetching automatically and include explicit signer parameters for improved control.

✏️ Tip: You can customize this high-level summary in your review settings.

…ation

Add a convenience method that automatically fetches and increments nonces
for identity creation from addresses, matching the pattern used by other
address-based operations (top_up_from_addresses, transfer_address_funds, etc.).

- Add `put_from_addresses` for automatic nonce handling
- Rename `put_with_address_funding` to `put_from_addresses_with_nonce` for consistency
- Update wasm-sdk to use the renamed method

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@github-actions github-actions bot added this to the v3.1.0 milestone Jan 29, 2026
@github-actions
Copy link

✅ gRPC Query Coverage Report

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

Total queries in proto: 53
Previously known queries: 47
New queries found: 6

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

New Query Implementation Status:
--------------------------------------------------------------------------------
✓ getAddressInfo                                /home/runner/work/platform/platform/packages/rs-sdk/src/platform/query.rs
✓ getAddressesBranchState                       /home/runner/work/platform/platform/packages/rs-sdk/src/platform/address_sync/mod.rs
✓ getAddressesInfos                             /home/runner/work/platform/platform/packages/rs-sdk/src/platform/fetch_many.rs
✓ getAddressesTrunkState                        /home/runner/work/platform/platform/packages/rs-sdk/src/platform/query.rs
✓ getRecentAddressBalanceChanges                /home/runner/work/platform/platform/packages/rs-sdk/src/platform/query.rs
✓ getRecentCompactedAddressBalanceChanges       /home/runner/work/platform/platform/packages/rs-sdk/src/platform/query.rs

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

Total known queries: 53
  - Implemented: 50
  - Not implemented: 2
  - Excluded: 1

Not implemented queries:
  - getConsensusParams
  - getTokenPreProgrammedDistributions

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Updated the PutIdentity trait API by replacing put_with_address_funding with two new methods, put_from_addresses and put_from_addresses_with_nonce, that introduce automatic nonce fetching and handling for input addresses. Updated corresponding calls in the Wasm SDK bindings.

Changes

Cohort / File(s) Summary
Rust SDK - PutIdentity trait
packages/rs-sdk/src/platform/transition/put_identity.rs
Replaced put_with_address_funding with put_from_addresses (auto-fetches and increments nonces) and put_from_addresses_with_nonce (accepts pre-computed nonces). Added imports for nonce handling functions. New methods delegate to underlying put_identity_with_address_funding after nonce preprocessing.
Wasm SDK - Address bindings
packages/wasm-sdk/src/state_transitions/addresses.rs
Updated identity_create_from_addresses flow to call put_from_addresses_with_nonce instead of put_with_address_funding. Input map now contains (AddressNonce, Credits) pairs instead of plain Credits; signer parameters adjusted to match new API.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 A nonce by any other name would still increment,
Now fetched and handled in one gentle flow,
Identity blooms from addresses with care,
No manual nonce dance, just put and go! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a convenience method for identity creation from addresses that automatically handles nonce management.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

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.

2 participants