-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-5133] Split txn proposal APIs into their own pkg
Change-Id: I303708523f07909aaf0b95b35b9789171350e324 Signed-off-by: Troy Ronda <[email protected]>
- Loading branch information
Showing
19 changed files
with
224 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// Package txnapi allows SDK users to plugin their own implementations of transaction processing. | ||
package txnapi | ||
|
||
import ( | ||
pb "github.com/hyperledger/fabric/protos/peer" | ||
) | ||
|
||
// TxnProposalProcessor simulates transaction proposal, so that a client can submit the result for ordering. | ||
type TxnProposalProcessor interface { | ||
ProcessTransactionProposal(proposal TransactionProposal) (TransactionProposalResult, error) | ||
} | ||
|
||
// TransactionProposal requests simulation of a proposed transaction from transaction processors. | ||
type TransactionProposal struct { | ||
TransactionID string | ||
|
||
SignedProposal *pb.SignedProposal | ||
Proposal *pb.Proposal | ||
} | ||
|
||
// TransactionProposalResponse encapsulates both the result of transaction proposal processing and errors. | ||
type TransactionProposalResponse struct { | ||
TransactionProposalResult | ||
Err error // TODO: consider refactoring | ||
} | ||
|
||
// TransactionProposalResult respresents the result of transaction proposal processing. | ||
type TransactionProposalResult struct { | ||
Endorser string | ||
Status int32 | ||
|
||
Proposal TransactionProposal | ||
ProposalResponse *pb.ProposalResponse | ||
} | ||
|
||
// TODO: TransactionProposalResponse and TransactionProposalResult may need better names. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.