Skip to content

Resolve SAC asset identity before constructing clients (Core 2.0) - #164

Merged
fazzatti merged 3 commits into
devfrom
feat/sac-resolved-identity
Sep 28, 2026
Merged

fazzatti merged 3 commits into
devfrom
feat/sac-resolved-identity

Conversation

@fazzatti

Copy link
Copy Markdown
Owner

SAC clients created from a contract ID previously lacked code and issuer. await StellarAssetContract.fromContractId(...) now fetches the contract instance once, verifies the built-in Stellar Asset executable, reads its canonical asset metadata, and checks that the recovered identity derives the requested contract ID on the configured network. The returned client always exposes readonly code and issuer; current admin changes do not affect asset identity.

  • Require complete asset identity for synchronous construction. fromAsset() and NativeXLM() remain synchronous; contract-id-only constructor calls migrate to the awaited factory. XLM exposes code XLM and issuer marker native.
  • Add typed errors for non-SAC executables and malformed metadata, while preserving missing-entry/RPC errors and the existing mismatched-ID error metadata.
  • Add unit cases for native and issued identities (including long codes and issued XLM), changed contract admins, both decoded storage shapes, custom RPC/cache options, malformed metadata, mismatched assets/networks, non-SAC executables, unavailable entries and RPC failures. Update the live integration suite to resolve only after deployment and verify issuer identity after an admin change.
  • Update the SAC guide, checked example, README examples, generated error reference, installation guide and Core 2.0 migration guidance.

This is an intentional Core 2.0.0 API change. The reviewed release plan also moves dependent packages to Core 2.0 (major releases for stable packages, minor releases for previews), with matching React dependency versions. JSR import requirements cannot express a union of the existing Core 1.x range and Core 2.x. The public API snapshot, Build Verification version constant and frozen bundle dependency fixture are synchronized; external dependency resolutions are unchanged.

Validation with the pinned Deno 2.9.6:

  • Targeted implementation and test type checks, scoped lint and whitespace checks passed.
  • Documentation checks passed: 259 Markdown files, 350 TypeScript snippets and 126 complete examples type-checked without execution.
  • Release-plan and public-API checks passed; no unreviewed declaration changes.

Unit/integration tests were deliberately not run locally, and CI completion is not a prerequisite for opening this PR, as requested. Tests target every new implementation branch and the existing 100% coverage goal. Measured coverage is not yet verified; CI will report it. Coverage thresholds and test gates are unchanged.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T17:22:29.406556Z e6a94b3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

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.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 7117c107-a7e4-406f-83ac-ef0c24b15505

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6a94b34ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread core/asset/sac/index.ts Resolved
Comment thread identicon/deno.json Resolved
Comment thread build-verification/deno.json Resolved
@fazzatti fazzatti self-assigned this Sep 28, 2026
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.99%. Comparing base (28091af) to head (e5697d4).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #164   +/-   ##
=======================================
  Coverage   99.99%   99.99%           
=======================================
  Files         573      573           
  Lines       42178    42218   +40     
  Branches     5589     5588    -1     
=======================================
+ Hits        42176    42216   +40     
  Partials        2        2           
Flag Coverage Δ
all-tests 99.99% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
build-verification/src/core/evidence/accumulate.ts 100.00% <100.00%> (ø)
core/asset/sac/error.ts 100.00% <100.00%> (ø)
core/asset/sac/index.ts 100.00% <100.00%> (ø)
core/asset/sac/types.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fazzatti
fazzatti merged commit 95799b8 into dev Sep 28, 2026
34 checks passed
@fazzatti
fazzatti deleted the feat/sac-resolved-identity branch September 28, 2026 18:05
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.

1 participant