/
state_based_validator.go
46 lines (38 loc) · 1.79 KB
/
state_based_validator.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
37
38
39
40
41
42
43
44
45
46
//此源码被清华学神尹成大魔王专业翻译分析并修改
//尹成QQ77025077
//尹成微信18510341407
//尹成所在QQ群721929980
//尹成邮箱 yinc13@mails.tsinghua.edu.cn
//尹成毕业于清华大学,微软区块链领域全球最有价值专家
//https://mvp.microsoft.com/zh-cn/PublicProfile/4033620
//Code generated by mockery v1.0.0. 不要编辑。
package mocks
import common "github.com/hyperledger/fabric/protos/common"
import errors "github.com/hyperledger/fabric/common/errors"
import mock "github.com/stretchr/testify/mock"
import peer "github.com/hyperledger/fabric/protos/peer"
//StateBasedvalidator是StateBasedvalidator类型的自动生成的模拟类型
type StateBasedValidator struct {
mock.Mock
}
//postvalidate提供了一个具有给定字段的模拟函数:cc、blocknum、txnum、err
func (_m *StateBasedValidator) PostValidate(cc string, blockNum uint64, txNum uint64, err error) {
_m.Called(cc, blockNum, txNum, err)
}
//prevalidate提供具有给定字段的模拟函数:txnum,block
func (_m *StateBasedValidator) PreValidate(txNum uint64, block *common.Block) {
_m.Called(txNum, block)
}
//validate提供具有给定字段的模拟函数:cc、blocknum、txnum、rwset、prp、ep、背书
func (_m *StateBasedValidator) Validate(cc string, blockNum uint64, txNum uint64, rwset []byte, prp []byte, ep []byte, endorsements []*peer.Endorsement) errors.TxValidationError {
ret := _m.Called(cc, blockNum, txNum, rwset, prp, ep, endorsements)
var r0 errors.TxValidationError
if rf, ok := ret.Get(0).(func(string, uint64, uint64, []byte, []byte, []byte, []*peer.Endorsement) errors.TxValidationError); ok {
r0 = rf(cc, blockNum, txNum, rwset, prp, ep, endorsements)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(errors.TxValidationError)
}
}
return r0
}