代码拉取完成,页面将自动刷新
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package mocks
import (
"time"
pmsp "github.com/hyperledger/fabric-protos-go/msp"
"github.com/hyperledger/fabric/msp"
"github.com/stretchr/testify/mock"
)
type MockMSP struct {
mock.Mock
}
func (m *MockMSP) IsWellFormed(_ *pmsp.SerializedIdentity) error {
return nil
}
func (m *MockMSP) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error) {
args := m.Called(serializedIdentity)
return args.Get(0).(msp.Identity), args.Error(1)
}
func (m *MockMSP) Setup(config *pmsp.MSPConfig) error {
args := m.Called(config)
return args.Error(0)
}
func (m *MockMSP) GetVersion() msp.MSPVersion {
args := m.Called()
return args.Get(0).(msp.MSPVersion)
}
func (m *MockMSP) GetType() msp.ProviderType {
args := m.Called()
return args.Get(0).(msp.ProviderType)
}
func (m *MockMSP) GetIdentifier() (string, error) {
args := m.Called()
return args.String(0), args.Error(1)
}
func (m *MockMSP) GetSigningIdentity(identifier *msp.IdentityIdentifier) (msp.SigningIdentity, error) {
args := m.Called(identifier)
return args.Get(0).(msp.SigningIdentity), args.Error(1)
}
func (m *MockMSP) GetDefaultSigningIdentity() (msp.SigningIdentity, error) {
args := m.Called()
return args.Get(0).(msp.SigningIdentity), args.Error(1)
}
func (m *MockMSP) GetTLSRootCerts() [][]byte {
args := m.Called()
return args.Get(0).([][]byte)
}
func (m *MockMSP) GetTLSIntermediateCerts() [][]byte {
args := m.Called()
return args.Get(0).([][]byte)
}
func (m *MockMSP) Validate(id msp.Identity) error {
args := m.Called(id)
return args.Error(0)
}
func (m *MockMSP) SatisfiesPrincipal(id msp.Identity, principal *pmsp.MSPPrincipal) error {
args := m.Called(id, principal)
return args.Error(0)
}
type MockIdentity struct {
mock.Mock
ID string
}
func (m *MockIdentity) Anonymous() bool {
panic("implement me")
}
func (m *MockIdentity) ExpiresAt() time.Time {
panic("implement me")
}
func (m *MockIdentity) GetIdentifier() *msp.IdentityIdentifier {
args := m.Called()
return args.Get(0).(*msp.IdentityIdentifier)
}
func (*MockIdentity) GetMSPIdentifier() string {
panic("implement me")
}
func (m *MockIdentity) Validate() error {
return m.Called().Error(0)
}
func (*MockIdentity) GetOrganizationalUnits() []*msp.OUIdentifier {
panic("implement me")
}
func (*MockIdentity) Verify(msg []byte, sig []byte) error {
return nil
}
func (*MockIdentity) Serialize() ([]byte, error) {
panic("implement me")
}
func (m *MockIdentity) SatisfiesPrincipal(principal *pmsp.MSPPrincipal) error {
return m.Called(principal).Error(0)
}
type MockSigningIdentity struct {
mock.Mock
*MockIdentity
}
func (*MockSigningIdentity) Sign(msg []byte) ([]byte, error) {
panic("implement me")
}
func (*MockSigningIdentity) GetPublicVersion() msp.Identity {
panic("implement me")
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。