Skip to content

fix(sdk): missing getSignedBytes method - #3073

Merged
shumkov merged 2 commits into
v3.1-devfrom
fix/sdk/missing-get-signed-bytes
Feb 9, 2026
Merged

shumkov merged 2 commits into
v3.1-devfrom
fix/sdk/missing-get-signed-bytes

Conversation

@shumkov

@shumkov shumkov commented Feb 9, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Missing getSignedBytes method in StateTransition class (wasm-dpp2).
Failing tests in wasm-sdk packages.

What was done?

  • Added getSignableBytes() method to StateTransitionWasm in wasm-dpp2: The method was being tested but not exposed via wasm-bindgen. It delegates to the existing signable_bytes() on the inner StateTransition.
  • Fixed getSignableBytes test expectation in wasm-dpp2: Updated expected byte length from 229 to 230 to match actual serialization output.
  • Removed temporary "Platform Version Compatibility Matrix" tests from wasm-sdk.

How Has This Been Tested?

  • wasm-dpp2: yarn build && yarn test — 718 passing, 7 pending, 0 failing
  • wasm-sdk: yarn build && yarn test — 186 passing, 0 failing

Breaking Changes

None

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

  • New Features

    • Added getSignableBytes() to StateTransition objects to retrieve their signable byte representation.
  • Tests

    • Updated test expectations for signable bytes output.
    • Removed the Platform Version Compatibility Matrix test suite and its related utilities.

@github-actions github-actions Bot added this to the v3.1.0 milestone Feb 9, 2026
@coderabbitai

coderabbitai Bot commented Feb 9, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds a public get_signable_bytes (Wasm: getSignableBytes) to StateTransitionWasm, updates a unit test expectation (signable bytes length +1), and removes the Platform Version Compatibility Matrix tests from the data-contract test suite.

Changes

Cohort / File(s) Summary
State Transition WASM Wrapper
packages/wasm-dpp2/src/state_transitions/base/state_transition.rs
Adds public method get_signable_bytes (exposed as getSignableBytes in Wasm) which returns the underlying transition's signable_bytes().
IdentityCreateTransition test
packages/wasm-dpp2/tests/unit/IdentityCreateTransition.spec.ts
Updates expected signable bytes length from 229 to 230 in unit test assertion.
Data-contract tests cleanup
packages/wasm-sdk/tests/unit/data-contract.spec.ts
Removes Platform Version Compatibility Matrix tests and related helpers; minor trailing-character change noted.
Test lint comment removal
packages/wasm-sdk/tests/functional/fixtures/requiredTestData.ts
Removes an ESLint disable comment; no functional change.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • QuantumExplorer

Poem

🐰 I nibble at bytes, one extra I found,
Wrapped up for Wasm, all tidy and sound,
Tests trimmed and cleaned, matrices gone,
A tiny hop forward — then on with the brawn! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title references 'getSignedBytes' but the actual changes add 'getSignableBytes' method; this is a naming mismatch that creates confusion about what was actually implemented. Update the PR title to 'fix(sdk): missing getSignableBytes method' to accurately reflect the implemented method name.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/sdk/missing-get-signed-bytes

No actionable comments were generated in the recent review. 🎉


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/wasm-sdk/tests/unit/data-contract.spec.ts`:
- Line 467: Remove the stray character 's' that was accidentally left in the
test file (packages/wasm-sdk/tests/unit/data-contract.spec.ts) which will cause
a ReferenceError at runtime; locate the lone 's' outside any valid expression
(the single-character diff shown) and delete it so the file contains only valid
test code, then run the unit tests to confirm no syntax/runtime errors remain.

@shumkov
shumkov merged commit 8063222 into v3.1-dev Feb 9, 2026
32 checks passed
@shumkov
shumkov deleted the fix/sdk/missing-get-signed-bytes branch February 9, 2026 14:11
@thephez

thephez commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

Are the removed tests cases covered elsewhere? They were originally added to close a gap in test coverage that allowed a bug to go unnoticed.

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