1 Star 0 Fork 0

venjia/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
validator.go 873 Bytes
一键复制 编辑 原始数据 按行查看 历史
yacovm 提交于 2018-04-23 03:12 +08:00 . [FAB-8535] Attach pluggable validation to the peer
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package validator
import (
"github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/peer"
"github.com/stretchr/testify/mock"
)
// MockValidator implements a mock validation useful for testing
type MockValidator struct {
mock.Mock
}
// Validate does nothing, returning no error
func (m *MockValidator) Validate(block *common.Block) error {
if len(m.ExpectedCalls) == 0 {
return nil
}
return m.Called().Error(0)
}
// MockVsccValidator is a mock implementation of the VSCC validation interface
type MockVsccValidator struct {
}
// VSCCValidateTx does nothing
func (v *MockVsccValidator) VSCCValidateTx(seq int, payload *common.Payload, envBytes []byte, block *common.Block) (error, peer.TxValidationCode) {
return nil, peer.TxValidationCode_VALID
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/venjia/fabric.git
git@gitee.com:venjia/fabric.git
venjia
fabric
fabric
v1.4.12

搜索帮助