Documentation ¶
Index ¶
- Variables
- func SignECDSA(k *ecdsa.PrivateKey, digest []byte) (signature []byte, err error)
- type MockEndorserServer
- func (m *MockEndorserServer) GetMockPeer() *MockPeer
- func (m *MockEndorserServer) ProcessProposal(context context.Context, proposal *pb.SignedProposal) (*pb.ProposalResponse, error)
- func (m *MockEndorserServer) SetMockPeer(mPeer *MockPeer)
- func (m *MockEndorserServer) Start(address string, filteredChannel chan *pb.FilteredBlock) string
- func (m *MockEndorserServer) Stop()
- type MockPeer
- func (p *MockPeer) EnrollmentCertificate() *pem.Block
- func (p *MockPeer) MSPID() string
- func (p MockPeer) Name() string
- func (p *MockPeer) ProcessTransactionProposal(tp fab.TransactionProposal, funcName []byte) (*fab.TransactionProposalResponse, error)
- func (p *MockPeer) Roles() []string
- func (p *MockPeer) SetEnrollmentCertificate(pem *pem.Block)
- func (p *MockPeer) SetMSPID(mspID string)
- func (p *MockPeer) SetName(name string)
- func (p *MockPeer) SetRoles(roles []string)
- func (p *MockPeer) URL() string
Constants ¶
This section is empty.
Variables ¶
var CertPem = `` /* 768-byte string literal not displayed */
CertPem certificate
var KeyPem = []byte(`-----BEGIN EC PRIVATE KEY-----
MHcCAQEEICfXQtVmdQAlp/l9umWJqCXNTDurmciDNmGHPpxHwUK/oAoGCCqGSM49
AwEHoUQDQgAECb7YJmFuaycD4cpDKdcrPt9Vm+/CW/8N02Dcx2DuUhw/bPRvTv94
BnnRyF0k1yM0B39ACP+aYYbh05t6jihMoQ==
-----END EC PRIVATE KEY-----`)
KeyPem ec private key
Functions ¶
Types ¶
type MockEndorserServer ¶
type MockEndorserServer struct { ProposalError error Creds credentials.TransportCredentials AddkvWrite bool DeliveriesListener chan *cb.Block FilteredDelListener chan *pb.FilteredBlock // contains filtered or unexported fields }
MockEndorserServer mock endorser server to process endorsement proposals
func (*MockEndorserServer) GetMockPeer ¶
func (m *MockEndorserServer) GetMockPeer() *MockPeer
GetMockPeer will return the mock endorser's mock peer in a thread safe way
func (*MockEndorserServer) ProcessProposal ¶
func (m *MockEndorserServer) ProcessProposal(context context.Context, proposal *pb.SignedProposal) (*pb.ProposalResponse, error)
ProcessProposal mock implementation that returns success (through mockPeer) if error is not set error if it is
func (*MockEndorserServer) SetMockPeer ¶
func (m *MockEndorserServer) SetMockPeer(mPeer *MockPeer)
SetMockPeer will write the mock endorser's mock peer in a thread safe way
func (*MockEndorserServer) Start ¶
func (m *MockEndorserServer) Start(address string, filteredChannel chan *pb.FilteredBlock) string
Start the mock endorser server
func (*MockEndorserServer) Stop ¶
func (m *MockEndorserServer) Stop()
Stop the mock broadcast server and wait for completion.
type MockPeer ¶
type MockPeer struct { RWLock *sync.RWMutex Error error MockName string MockURL string MockRoles []string MockCert *pem.Block Payload map[string][]byte ResponseMessage string MockMSP string Status int32 KVWrite bool ProcessProposalCalls int Endorser []byte }
MockPeer is a mock fabricsdk.Peer
func NewMockPeer ¶
NewMockPeer creates basic mock peer
func (*MockPeer) EnrollmentCertificate ¶
EnrollmentCertificate returns the mock peer's mock enrollment certificate
func (*MockPeer) ProcessTransactionProposal ¶
func (p *MockPeer) ProcessTransactionProposal(tp fab.TransactionProposal, funcName []byte) (*fab.TransactionProposalResponse, error)
ProcessTransactionProposal does not send anything anywhere but returns an empty mock ProposalResponse
func (*MockPeer) SetEnrollmentCertificate ¶
SetEnrollmentCertificate sets the mock peer's mock enrollment certificate