Skip to content

chore: make vc-issuer-registry release-ready - #15

Merged
aguilar1x merged 1 commit into
ACTA-Team:mainfrom
Abdulmajeed82:main
Jul 8, 2026
Merged

chore: make vc-issuer-registry release-ready#15
aguilar1x merged 1 commit into
ACTA-Team:mainfrom
Abdulmajeed82:main

Conversation

@Abdulmajeed82

@Abdulmajeed82 Abdulmajeed82 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1

Summary by CodeRabbit

  • Documentation

    • Expanded the public-facing contract guide with clearer governance, safety, and storage behavior details.
    • Added a structured API reference, including initialization, issuer management, queries, validation rules, and integration guidance.
    • Included new CLI examples for common issuer actions and updated build/test instructions.
  • Style

    • Improved formatting and readability across implementation and test code without changing behavior.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Abdulmajeed82 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The vc-issuer-registry README is rewritten with a purpose/threat model section, a structured public API reference (signatures, semantics, error codes, events), CLI examples, and updated build instructions. Source files (contract.rs, storage.rs, test.rs) receive formatting-only reformats with no logic changes.

vc-issuer-registry docs and formatting

Layer / File(s) Summary
README: purpose, API reference, CLI examples, build instructions
contracts/vc-issuer-registry/README.md
Prior overview replaced with a purpose/threat model section and a consolidated public API reference covering all entry points, error codes, events, CLI examples for key flows, and workspace-level build/test commands.
Formatting-only source reformats
contracts/vc-issuer-registry/src/contract.rs, contracts/vc-issuer-registry/src/storage.rs, contracts/vc-issuer-registry/src/test.rs
Import list, IssuerRecord literal, storage helper chains, and test call sites reformatted to multi-line style; no logic, signatures, or assertions changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐇 A README once thin, now full of delight,
With threat models, CLI calls, and API in sight.
The code just got tidier, line by line spread,
No logic was touched — just formatting instead.
Hop hop, ship it! The docs look just right. 🌟

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The README and examples were updated, but the required CI change to run soroban contract build for both contracts is missing. Add the workflow update in .github/workflows/rust.yml to run soroban contract build and keep cargo test coverage for both contracts.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the PR's main release-readiness goal for vc-issuer-registry.
Out of Scope Changes check ✅ Passed The changes stay within the release-readiness scope and are limited to docs, tests, and formatting updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@contracts/vc-issuer-registry/README.md`:
- Around line 126-193: The CLI example for add_issuer uses plain strings for the
optional Bytes arguments, which will not parse correctly. Update the README
example for the add_issuer invocation so the --did and --url values match the
expected Option<Bytes> format used by the contract CLI, or omit those flags
entirely when representing None. Keep the example aligned with the add_issuer
contract interface and the surrounding soroban contract invoke examples.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 13e24326-4de0-444f-9f97-cfbbd4a0c3a8

📥 Commits

Reviewing files that changed from the base of the PR and between 01b522a and 7fa1697.

📒 Files selected for processing (4)
  • contracts/vc-issuer-registry/README.md
  • contracts/vc-issuer-registry/src/contract.rs
  • contracts/vc-issuer-registry/src/storage.rs
  • contracts/vc-issuer-registry/src/test.rs

Comment on lines +126 to 193
## CLI examples

These snippets assume that the contract is already deployed, the admin identity is funded, and the relevant environment variables are set.

```bash
export CONTRACT_ID="<deployed-contract-id>"
export ADMIN_ADDRESS="<admin-address>"
export ADMIN_SECRET="<admin-secret>"
export ISSUER_ADDRESS="<issuer-address>"
export NETWORK="testnet"
```

### 1. Initialize the contract

```bash
soroban contract invoke \
--id "$CONTRACT_ID" \
--source "$ADMIN_SECRET" \
--network "$NETWORK" \
-- initialize \
--admin "$ADMIN_ADDRESS"
```

### 2. Add an issuer

```bash
soroban contract invoke \
--id "$CONTRACT_ID" \
--source "$ADMIN_SECRET" \
--network "$NETWORK" \
-- add_issuer \
--issuer "$ISSUER_ADDRESS" \
--name "ExampleIssuer" \
--did "did:example:issuer-1" \
--url "https://issuer.example"
```

### 3. Query whether an issuer is allowed

```bash
soroban contract invoke \
--id "$CONTRACT_ID" \
--network "$NETWORK" \
-- is_issuer_allowed \
--issuer "$ISSUER_ADDRESS"
```

### 4. Disable an issuer without deleting it

```bash
soroban contract invoke \
--id "$CONTRACT_ID" \
--source "$ADMIN_SECRET" \
--network "$NETWORK" \
-- set_issuer_allowed \
--issuer "$ISSUER_ADDRESS" \
--allowed false
```

## Build & test
## Build and test

```bash
# from repo root
cargo build -p vc-issuer-registry-contract
cargo test -p vc-issuer-registry-contract
# from the repository root
cargo test --workspace

# WASM
stellar contract build
# from contracts/vc-issuer-registry
soroban contract build
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verification script: check if README CLI examples are syntactically plausible
# and if soroban CLI is available in the environment.

# Check soroban CLI availability
which soroban && soroban --version

# Dry-run syntax check for each example (requires funded identities and deployment)
# Note: Actual execution requires a deployed contract and funded accounts.
echo "Check README examples manually with:"
echo "  soroban contract invoke --id ... --source ... --network testnet -- initialize --admin ..."
echo "  soroban contract invoke --id ... --source ... --network testnet -- add_issuer --issuer ... --name ... --did ... --url ..."
echo "  soroban contract invoke --id ... --network testnet -- is_issuer_allowed --issuer ..."
echo "  soroban contract invoke --id ... --source ... --network testnet -- set_issuer_allowed --issuer ... --allowed false"

Repository: ACTA-Team/contracts-acta-spikes

Length of output: 665


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the contract interface and any existing CLI usage/docs for vc-issuer-registry.

printf '\n== Files ==\n'
git ls-files 'contracts/vc-issuer-registry/**' | sed -n '1,200p'

printf '\n== Outline: README.md ==\n'
ast-grep outline contracts/vc-issuer-registry/README.md --view expanded || true

printf '\n== Search for contract functions / CLI examples ==\n'
rg -n "initialize|add_issuer|is_issuer_allowed|set_issuer_allowed|Option<Symbol>|Option<Bytes>|soroban contract invoke" contracts/vc-issuer-registry -S

printf '\n== Interface files ==\n'
fd -a -t f '.*\.(rs|md|toml)$' contracts/vc-issuer-registry

printf '\n== Line counts for likely contract sources ==\n'
for f in $(fd -a -t f '.*\.rs$' contracts/vc-issuer-registry); do wc -l "$f"; done

Repository: ACTA-Team/contracts-acta-spikes

Length of output: 11369


🌐 Web query:

Soroban CLI contract invoke optional Symbol Bytes bool argument syntax --name --did --url --allowed false

💡 Result:

When invoking a Soroban contract using the Stellar CLI, arguments passed after the double dash (--) are parsed based on the contract's specific schema [1][2][3]. To correctly invoke a function with the arguments provided (Name, DID, URL, and Allowed), you should use the flag-based syntax corresponding to your contract's argument names [1][3]. Assuming your function arguments are named exactly as you specified, the syntax follows this pattern: stellar contract invoke --id <CONTRACT_ID> -- <FUNCTION_NAME> --name "<NAME_VALUE>" --did "<DID_VALUE>" --url "<URL_VALUE>" --allowed false Key Considerations: 1. Boolean Arguments: For boolean types, use the bare keyword false or true [4]. The CLI automatically converts these and other simple types (like strings and numbers) to their required representation [4]. 2. Symbol and Bytes: Symbols and strings are generally passed as standard text values [4]. If the CLI misinterprets a Symbol as an integer, ensure you wrap the value in extra quotes (e.g., '"123"') to ensure the shell passes the literal string to the CLI parser [5]. For Bytes types, provide the value as a hexadecimal string [5]. 3. Verification: You can always verify the exact expected argument names and types for your specific contract by running the command with the --help flag [1][6][2]: stellar contract invoke --id <CONTRACT_ID> -- --help This command fetches the on-chain interface types and prints the specific flags required for each argument [6].

Citations:


🌐 Web query:

Stellar CLI fully typed contract Bytes optional parameter flag syntax string hex example

💡 Result:

To invoke a Stellar smart contract using the Stellar CLI with optional parameters or hex-encoded bytes, you utilize the CLI's generated "implicit CLI" syntax, which is constructed dynamically from the contract's schema [1][2][3]. Optional Parameters For any parameter defined as an Option type in your contract, you simply omit the corresponding flag when invoking the function [4][5]. The Stellar CLI will automatically supply a void (null) value for that parameter [4]. Example: If a function takes an optional parameter --memo, you can invoke the function without it to pass None: stellar contract invoke --id mycontract -- my_function --amount 100 Bytes and Hex Strings Parameters expecting Bytes (such as BytesN) are passed as hex strings [6]. When providing these values via the CLI, you should provide the raw hex characters directly [6]. If the parameter is part of an array or collection, the hex string is typically provided within the expected JSON-like structure [6]. Example: For a function expecting a BytesN<32> type, you provide the 64-character hex string: stellar contract invoke --id mycontract -- my_function --hash "efefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefef" If the argument is a list or vector of bytes, provide them as a JSON array of hex strings: stellar contract invoke --id mycontract -- choose_from --hashes '[ "efefefefefefefefefefefefefefefefefefefefefefefefefefefefefefefef" ]' General Guidance To determine the exact flags and expected formats for your specific contract, you can generate a help menu for that contract's functions by running: stellar contract invoke --id <CONTRACT_ID> -- --help You can further inspect specific functions by running: stellar contract invoke --id <CONTRACT_ID> -- <FUNCTION_NAME> --help This will display the generated CLI options, including the required format for complex types like Bytes [1][6].

Citations:


Fix the add_issuer metadata example
contracts/vc-issuer-registry/README.md:152-162 passes plain text to --did and --url, but those args are Option<Bytes> and need hex-encoded byte strings (or the flags should be omitted for None). As written, this invocation won’t parse.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@contracts/vc-issuer-registry/README.md` around lines 126 - 193, The CLI
example for add_issuer uses plain strings for the optional Bytes arguments,
which will not parse correctly. Update the README example for the add_issuer
invocation so the --did and --url values match the expected Option<Bytes> format
used by the contract CLI, or omit those flags entirely when representing None.
Keep the example aligned with the add_issuer contract interface and the
surrounding soroban contract invoke examples.

@aguilar1x
aguilar1x merged commit 9ca0c7f into ACTA-Team:main Jul 8, 2026
2 of 3 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.

chore: make vc-issuer-registry release-ready (docs + examples + CI + wasm build)

2 participants