Skip to content

fix: handle network selection and add new fixtures#15

Merged
rongquan1 merged 3 commits into
mainfrom
fix/cli-verify-command
Feb 6, 2026
Merged

fix: handle network selection and add new fixtures#15
rongquan1 merged 3 commits into
mainfrom
fix/cli-verify-command

Conversation

@pennhan-dex

@pennhan-dex pennhan-dex commented Feb 4, 2026

Copy link
Copy Markdown
Contributor
  1. Implement error handling for wrong network selection when prompted
  2. Add new fixture for OA v3 document without network information
  3. Add testcases to cover error handling

Summary by CodeRabbit

  • New Features

    • Added a handler to detect and surface expired credential warnings.
  • Bug Fixes

    • Clearer verification logs: explicit ERROR entries and improved INVALID warnings using fragment reasons.
    • Better fragment selection when multiple non-skipped results exist (selection priority updated).
  • Tests

    • Expanded tests for fragment selection priority, error-log aggregation, network-selection flows, and expired-warning handling.
    • Added and updated fixtures (including issuer/network and richer document structures) to support new test scenarios.

@coderabbitai

coderabbitai Bot commented Feb 4, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added exported handleExpiredCredentialWarning; changed getResultFromFragment to prefer non-SKIPPED fragments by status order (VALID > INVALID > ERROR); updated logResultStatus to explicitly handle ERROR and derive messages from fragment.reason.message when present. New/updated tests and fixtures added; dependency version bumped.

Changes

Cohort / File(s) Summary
Core Verify Logic
src/commands/verify.ts
Added exported handleExpiredCredentialWarning(warnings: unknown[][]). getResultFromFragment now filters out SKIPPED fragments and selects by priority (VALID, INVALID, ERROR) with existence checks; logResultStatus logs ERROR via signale.error and uses fragment.reason.message when available for messages.
Tests
tests/commands/verify.test.ts
Added signale error mocking and expanded tests: fragment selection priority (VALID > INVALID > ERROR), ERROR logging semantics, missing-reason cases, expired-credential warning scenarios, aggregated error log output, and network-selection prompt handling (including wrong-network case). Updated expected log formats and test wiring.
Fixtures
tests/fixtures/verify/oa/3.0/oa_dns_txt_token_registry_no_network_field_stability_v3.json, tests/fixtures/verify/oa/2.0/signed_wrapped_oa_dns_did_v2.json
Added a new OA 3.0 fixture lacking network field. Updated OA 2.0 fixture to a new public-issuer centered structure with issuers, network, transport/supply-chain blocks, attachments, and updated signatures and proofs.
Package Metadata
package.json
Bumped dependency @trustvc/trustvc from ^2.5.0 to ^2.6.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I hopped through fragments, sorted neat and spry,
VALID first I chose beneath the verification sky,
Errors I shouted, warnings softly ring,
Expired badges flagged — a tidy little thing,
My whiskers twitch in celebration of this spring.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@rongquan1 rongquan1 changed the title fix:handle network selection and add new fixtures fix: handle network selection and add new fixtures Feb 6, 2026
@rongquan1 rongquan1 merged commit 62b2031 into main Feb 6, 2026
5 checks passed
@rongquan1 rongquan1 deleted the fix/cli-verify-command branch February 6, 2026 06:42
tradetrustimda pushed a commit that referenced this pull request Mar 10, 2026
# 1.0.0 (2026-03-10)

### Bug Fixes

* add tamper check for all blockchain functions ([#21](#21)) ([ea64760](ea64760))
* base64 file format removal ([514f18b](514f18b))
* ether signer compatibility ([a3c36de](a3c36de))
* handle network selection and add new fixtures ([#15](#15)) ([62b2031](62b2031))
* one line command and interactive terminal fix ([23fb955](23fb955))
* package lock ([2e40722](2e40722))
* remove test output files ([f63a4b3](f63a4b3))
* remove the base64 encoding for the file encryption ([#23](#23)) ([d4600e4](d4600e4))
* remove unnecessary details in the readme ([6a9b8a2](6a9b8a2))
* update cli process ([#8](#8)) ([472a9e6](472a9e6))
* updated the file handling error and folder creation for outputs ([a07c6a3](a07c6a3))
* wallet creation ([#14](#14)) ([6499276](6499276))

### Features

* add mint function command ([#1](#1)) ([22ea11f](22ea11f))
* add verify command ([#7](#7)) ([da85177](da85177))
* add w3c sign function ([#4](#4)) ([ea31015](ea31015))
* added encrypt/decrypt functions to the OA feature ([6dab3e7](6dab3e7))
* added functionality for transaction cancel ([33d73f2](33d73f2))
* added husky for lint checks ([70f3ea5](70f3ea5))
* added the gracefull error handling ([27ef0cf](27ef0cf))
* credential status command ([fb83698](fb83698))
* deploy document store command ([#16](#16)) ([bee4e7a](bee4e7a))
* document store ownership ([#20](#20)) ([a3906da](a3906da))
* fixed the prettier formats ([661c27e](661c27e))
* issue and revoke command ([#17](#17)) ([1df37ff](1df37ff))
* oa sign command ([6fc14cb](6fc14cb))
* reject commands ([#5](#5)) ([f50ce1b](f50ce1b))
* remove example files ([eecf1fb](eecf1fb))
* return commands ([#6](#6)) ([d999e6c](d999e6c))
* token registry command ([#19](#19)) ([0f5c523](0f5c523))
* transfer commands ([#3](#3)) ([8414130](8414130))
* update command process and tests ([#12](#12)) ([97986f5](97986f5))
* update the transfer commands with new input process ([#10](#10)) ([603e534](603e534))
* updated package version for trustvc ([995b43f](995b43f))
* updated packages ([7f9712c](7f9712c))
* updated the readme ([8fa493a](8fa493a))
* wallet creation encryption ([#13](#13)) ([e4d368c](e4d368c))
* wrap unwrap oa command ([#9](#9)) ([4ca75f0](4ca75f0))
@tradetrustimda

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants