forked from hyperledger/fabric-sdk-go
/
sender.go
36 lines (29 loc) · 959 Bytes
/
sender.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package fab
import (
pb "github.com/hyperledger/fabric-protos-go/peer"
)
// TransactionRequest holds endorsed Transaction Proposals.
type TransactionRequest struct {
Proposal *TransactionProposal
ProposalResponses []*TransactionProposalResponse
}
// Sender provides the ability for a transaction to be created and sent.
//
// TODO: CreateTransaction should be refactored as it is actually a factory method.
type Sender interface {
CreateTransaction(request TransactionRequest) (*Transaction, error)
SendTransaction(tx *Transaction) (*TransactionResponse, error)
}
// The Transaction object created from an endorsed proposal.
type Transaction struct {
Proposal *TransactionProposal
Transaction *pb.Transaction
}
// TransactionResponse contains information returned by the orderer.
type TransactionResponse struct {
Orderer string
}