Implement newCommit method in Network interface#1057
Implement newCommit method in Network interface#1057akash-R-A-J wants to merge 2 commits intohyperledger:mainfrom
Conversation
Added newCommit method to create Commit objects for transactions. Signed-off-by: Akash Raj <103271263+akash-R-A-J@users.noreply.github.com>
|
Scenario tests are failing for Go 1.25. Investigating integration behavior around commit handling and will push a fix. |
- Add gateway import to fabric-protos imports - Implement #newSignedCommitStatusRequest() helper method - Implement #newCommitStatusRequest() helper method - Follow exact pattern from Transaction class (lines 123-135) - Remove direct channelName parameter from CommitImpl constructor - Pass signedRequest containing channelId, transactionId, and identity Fixes TypeScript compilation error TS2353: Object literal may only specify known properties, and 'channelName' does not exist in type 'Readonly<CommitImplOptions>' Resolves hyperledger#195 Signed-off-by: Akash Raj <103271263+akash-R-A-J@users.noreply.github.com>
|
Update: Since the initial version of this PR, the The earlier approach attempted to pass This resolves the TypeScript compilation error (TS2353) and aligns the implementation with the expected constructor inputs. No API surface changes were introduced beyond what’s described in issue #195. |
|
@bestbeforetoday could you please review this PR? |
This PR implements the
newCommitmethod in the Network interface as requested in issue #195.Changes Made:
newCommit(transactionId: string): Commitmethod to the Network interfaceImplementation Details:
The method creates a new CommitImpl instance with the required parameters:
client: Gateway client for communicationsigningIdentity: Identity for signing operationstransactionId: The ID of the transaction to create a Commit forchannelName: The channel where the transaction existsThis allows users to create Commit objects for transactions that have already been submitted, enabling them to query transaction status and access transaction details.
Testing:
The implementation follows the same pattern as other factory methods in the Network class (e.g.,
newChaincodeEventsRequest,newBlockEventsRequest) and integrates seamlessly with the existing codebase.Fixes #195