Skip to content

refactor!: return signature SCVal from Auth.Signer for custom account contracts#806

Merged
overcat merged 3 commits into
masterfrom
feat/auth-scval-signer
Jun 18, 2026
Merged

refactor!: return signature SCVal from Auth.Signer for custom account contracts#806
overcat merged 3 commits into
masterfrom
feat/auth-scval-signer

Conversation

@overcat

@overcat overcat commented Jun 18, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Soroban authorization signing to support custom account contracts by changing Auth.Signer to return a signature SCVal directly (attached verbatim), and adds helper APIs to build the default Stellar Account signature shape and payload hash.

Changes:

  • Breaking API change: Auth.Signer.sign(HashIDPreimage) now returns SCVal (and Auth.Signature / client-side ed25519 verification are removed).
  • Added Auth.authorizationPayloadHash(...) and Auth.defaultAccountSignatureScVal(...) helpers; updated authorizeInvocation(..., publicKey) parameter naming to address.
  • Centralized lexicographic unsigned byte comparison into Util.compareBytesUnsigned(...) and updated comparators/sorting logic; added/updated tests and changelog notes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/test/kotlin/org/stellar/sdk/UtilTest.kt Adds unit tests for Util.compareBytesUnsigned.
src/test/java/org/stellar/sdk/AuthTest.java Updates signing tests for new Signer contract; adds coverage for custom signature SCVal behavior and helper methods.
src/main/java/org/stellar/sdk/Util.java Adds compareBytesUnsigned(byte[], byte[]) utility.
src/main/java/org/stellar/sdk/scval/ScvComparator.java Switches byte comparisons to Util.compareBytesUnsigned for SCVal/address ordering.
src/main/java/org/stellar/sdk/Auth.java Implements the Signer -> SCVal refactor; adds helper methods; updates delegate sorting to use shared unsigned byte comparator.
CHANGELOG.md Documents the breaking change and migration snippet for Auth.Signer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/org/stellar/sdk/scval/ScvComparator.java
Comment thread src/main/java/org/stellar/sdk/scval/ScvComparator.java
Comment thread src/main/java/org/stellar/sdk/Auth.java Outdated
Comment thread CHANGELOG.md
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.91%. Comparing base (d9632c9) to head (7e5dcd0).

Files with missing lines Patch % Lines
src/main/java/org/stellar/sdk/Auth.java 90.90% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #806      +/-   ##
============================================
- Coverage     82.92%   82.91%   -0.01%     
  Complexity     1660     1660              
============================================
  Files           232      232              
  Lines          6060     6046      -14     
  Branches        678      677       -1     
============================================
- Hits           5025     5013      -12     
+ Misses          658      656       -2     
  Partials        377      377              
Files with missing lines Coverage Δ
src/main/java/org/stellar/sdk/Util.java 80.00% <100.00%> (+2.22%) ⬆️
...main/java/org/stellar/sdk/scval/ScvComparator.java 93.52% <100.00%> (-0.19%) ⬇️
src/main/java/org/stellar/sdk/Auth.java 86.41% <90.90%> (+0.98%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@overcat overcat enabled auto-merge (squash) June 18, 2026 07:07
@overcat overcat merged commit 6fcf952 into master Jun 18, 2026
11 checks passed
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