feat: issue and revoke command#17
Conversation
📝 WalkthroughWalkthroughTwo new CLI command modules for blockchain document store operations are introduced: one for issuing document hashes and one for revoking them. Both include wallet-aware flows with dry-run support and conditional gas estimation. Comprehensive test suites accompany both commands with extensive mocking of dependencies. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as Handler
participant Input as promptForInputs
participant Wallet as Wallet Utils
participant DryRun as DryRun Flow
participant DocStore as Document Store
participant Blockchain as Blockchain Network
participant Display as Result Display
User->>CLI: Execute issue/revoke command
CLI->>Input: Request user inputs
Input->>User: Prompt for document & wallet info
User-->>Input: Provide inputs
Input->>Wallet: Request wallet/signer
Wallet-->>Input: Return signer
Input-->>CLI: Return command payload
CLI->>DryRun: Perform dry-run with confirmation
DryRun->>DocStore: Connect to document store
DocStore->>DocStore: Populate transaction
DryRun->>User: Request confirmation
User-->>DryRun: Confirm
DryRun-->>CLI: Transaction ready
CLI->>DocStore: Check if gas estimation supported
alt EIP-1559 Supported
CLI->>Blockchain: Fetch gas fees (maxFeePerGas, maxPriorityFeePerGas)
Blockchain-->>CLI: Return gas parameters
CLI->>DocStore: Execute with EIP-1559 parameters
else Legacy Mode
CLI->>DocStore: Execute standard transaction
end
DocStore->>Blockchain: Send transaction
Blockchain-->>DocStore: Transaction hash
DocStore->>Blockchain: Wait for confirmation
Blockchain-->>DocStore: Confirmed
CLI->>Display: Show transaction details & link
Display->>User: Display results
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour 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 |
# 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))
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Commit Description: feat/issue-revoke
Overview
This commit adds the
issueandrevokecommands for document store operations in the TrustVC CLI. These commands allow users to issue and revoke document hashes in deployed document store contracts on various blockchain networks.Files Added
Source Files
src/commands/document-store/issue.ts(145 lines): Implements thedocument-store issuecommandsrc/commands/document-store/revoke.ts(146 lines): Implements thedocument-store revokecommandTest Files
tests/commands/document-store/issue.test.ts(677 lines): Comprehensive test suite for the issue commandtests/commands/document-store/revoke.test.ts(677 lines): Comprehensive test suite for the revoke commandFeatures Implemented
Document Store Issue Command
trustvc document-store issueDocument Store Revoke Command
trustvc document-store revokedocumentStoreRevokefunction from @trustvc/trustvcrevoke(bytes32))Technical Details
Command Structure
Both commands follow the established CLI pattern:
Dependencies
@trustvc/trustvclibrary functions:documentStoreIssue,documentStoreRevokeTesting
Usage Examples
Both commands will prompt for:
Summary by CodeRabbit
Release Notes
New Features
Tests