1 Star 0 Fork 0

妥協 / fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tx_mgr.go 21.34 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/txmgr"
"github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/version"
)
type TxMgr struct {
CommitStub func() error
commitMutex sync.RWMutex
commitArgsForCall []struct {
}
commitReturns struct {
result1 error
}
commitReturnsOnCall map[int]struct {
result1 error
}
CommitLostBlockStub func(*ledger.BlockAndPvtData) error
commitLostBlockMutex sync.RWMutex
commitLostBlockArgsForCall []struct {
arg1 *ledger.BlockAndPvtData
}
commitLostBlockReturns struct {
result1 error
}
commitLostBlockReturnsOnCall map[int]struct {
result1 error
}
GetLastSavepointStub func() (*version.Height, error)
getLastSavepointMutex sync.RWMutex
getLastSavepointArgsForCall []struct {
}
getLastSavepointReturns struct {
result1 *version.Height
result2 error
}
getLastSavepointReturnsOnCall map[int]struct {
result1 *version.Height
result2 error
}
NewQueryExecutorStub func(string) (ledger.QueryExecutor, error)
newQueryExecutorMutex sync.RWMutex
newQueryExecutorArgsForCall []struct {
arg1 string
}
newQueryExecutorReturns struct {
result1 ledger.QueryExecutor
result2 error
}
newQueryExecutorReturnsOnCall map[int]struct {
result1 ledger.QueryExecutor
result2 error
}
NewTxSimulatorStub func(string) (ledger.TxSimulator, error)
newTxSimulatorMutex sync.RWMutex
newTxSimulatorArgsForCall []struct {
arg1 string
}
newTxSimulatorReturns struct {
result1 ledger.TxSimulator
result2 error
}
newTxSimulatorReturnsOnCall map[int]struct {
result1 ledger.TxSimulator
result2 error
}
RemoveStaleAndCommitPvtDataOfOldBlocksStub func(map[uint64][]*ledger.TxPvtData) error
removeStaleAndCommitPvtDataOfOldBlocksMutex sync.RWMutex
removeStaleAndCommitPvtDataOfOldBlocksArgsForCall []struct {
arg1 map[uint64][]*ledger.TxPvtData
}
removeStaleAndCommitPvtDataOfOldBlocksReturns struct {
result1 error
}
removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall map[int]struct {
result1 error
}
RollbackStub func()
rollbackMutex sync.RWMutex
rollbackArgsForCall []struct {
}
ShouldRecoverStub func(uint64) (bool, uint64, error)
shouldRecoverMutex sync.RWMutex
shouldRecoverArgsForCall []struct {
arg1 uint64
}
shouldRecoverReturns struct {
result1 bool
result2 uint64
result3 error
}
shouldRecoverReturnsOnCall map[int]struct {
result1 bool
result2 uint64
result3 error
}
ShutdownStub func()
shutdownMutex sync.RWMutex
shutdownArgsForCall []struct {
}
ValidateAndPrepareStub func(*ledger.BlockAndPvtData, bool) ([]*txmgr.TxStatInfo, error)
validateAndPrepareMutex sync.RWMutex
validateAndPrepareArgsForCall []struct {
arg1 *ledger.BlockAndPvtData
arg2 bool
}
validateAndPrepareReturns struct {
result1 []*txmgr.TxStatInfo
result2 error
}
validateAndPrepareReturnsOnCall map[int]struct {
result1 []*txmgr.TxStatInfo
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *TxMgr) Commit() error {
fake.commitMutex.Lock()
ret, specificReturn := fake.commitReturnsOnCall[len(fake.commitArgsForCall)]
fake.commitArgsForCall = append(fake.commitArgsForCall, struct {
}{})
fake.recordInvocation("Commit", []interface{}{})
fake.commitMutex.Unlock()
if fake.CommitStub != nil {
return fake.CommitStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.commitReturns
return fakeReturns.result1
}
func (fake *TxMgr) CommitCallCount() int {
fake.commitMutex.RLock()
defer fake.commitMutex.RUnlock()
return len(fake.commitArgsForCall)
}
func (fake *TxMgr) CommitCalls(stub func() error) {
fake.commitMutex.Lock()
defer fake.commitMutex.Unlock()
fake.CommitStub = stub
}
func (fake *TxMgr) CommitReturns(result1 error) {
fake.commitMutex.Lock()
defer fake.commitMutex.Unlock()
fake.CommitStub = nil
fake.commitReturns = struct {
result1 error
}{result1}
}
func (fake *TxMgr) CommitReturnsOnCall(i int, result1 error) {
fake.commitMutex.Lock()
defer fake.commitMutex.Unlock()
fake.CommitStub = nil
if fake.commitReturnsOnCall == nil {
fake.commitReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.commitReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *TxMgr) CommitLostBlock(arg1 *ledger.BlockAndPvtData) error {
fake.commitLostBlockMutex.Lock()
ret, specificReturn := fake.commitLostBlockReturnsOnCall[len(fake.commitLostBlockArgsForCall)]
fake.commitLostBlockArgsForCall = append(fake.commitLostBlockArgsForCall, struct {
arg1 *ledger.BlockAndPvtData
}{arg1})
fake.recordInvocation("CommitLostBlock", []interface{}{arg1})
fake.commitLostBlockMutex.Unlock()
if fake.CommitLostBlockStub != nil {
return fake.CommitLostBlockStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.commitLostBlockReturns
return fakeReturns.result1
}
func (fake *TxMgr) CommitLostBlockCallCount() int {
fake.commitLostBlockMutex.RLock()
defer fake.commitLostBlockMutex.RUnlock()
return len(fake.commitLostBlockArgsForCall)
}
func (fake *TxMgr) CommitLostBlockCalls(stub func(*ledger.BlockAndPvtData) error) {
fake.commitLostBlockMutex.Lock()
defer fake.commitLostBlockMutex.Unlock()
fake.CommitLostBlockStub = stub
}
func (fake *TxMgr) CommitLostBlockArgsForCall(i int) *ledger.BlockAndPvtData {
fake.commitLostBlockMutex.RLock()
defer fake.commitLostBlockMutex.RUnlock()
argsForCall := fake.commitLostBlockArgsForCall[i]
return argsForCall.arg1
}
func (fake *TxMgr) CommitLostBlockReturns(result1 error) {
fake.commitLostBlockMutex.Lock()
defer fake.commitLostBlockMutex.Unlock()
fake.CommitLostBlockStub = nil
fake.commitLostBlockReturns = struct {
result1 error
}{result1}
}
func (fake *TxMgr) CommitLostBlockReturnsOnCall(i int, result1 error) {
fake.commitLostBlockMutex.Lock()
defer fake.commitLostBlockMutex.Unlock()
fake.CommitLostBlockStub = nil
if fake.commitLostBlockReturnsOnCall == nil {
fake.commitLostBlockReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.commitLostBlockReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *TxMgr) GetLastSavepoint() (*version.Height, error) {
fake.getLastSavepointMutex.Lock()
ret, specificReturn := fake.getLastSavepointReturnsOnCall[len(fake.getLastSavepointArgsForCall)]
fake.getLastSavepointArgsForCall = append(fake.getLastSavepointArgsForCall, struct {
}{})
fake.recordInvocation("GetLastSavepoint", []interface{}{})
fake.getLastSavepointMutex.Unlock()
if fake.GetLastSavepointStub != nil {
return fake.GetLastSavepointStub()
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.getLastSavepointReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *TxMgr) GetLastSavepointCallCount() int {
fake.getLastSavepointMutex.RLock()
defer fake.getLastSavepointMutex.RUnlock()
return len(fake.getLastSavepointArgsForCall)
}
func (fake *TxMgr) GetLastSavepointCalls(stub func() (*version.Height, error)) {
fake.getLastSavepointMutex.Lock()
defer fake.getLastSavepointMutex.Unlock()
fake.GetLastSavepointStub = stub
}
func (fake *TxMgr) GetLastSavepointReturns(result1 *version.Height, result2 error) {
fake.getLastSavepointMutex.Lock()
defer fake.getLastSavepointMutex.Unlock()
fake.GetLastSavepointStub = nil
fake.getLastSavepointReturns = struct {
result1 *version.Height
result2 error
}{result1, result2}
}
func (fake *TxMgr) GetLastSavepointReturnsOnCall(i int, result1 *version.Height, result2 error) {
fake.getLastSavepointMutex.Lock()
defer fake.getLastSavepointMutex.Unlock()
fake.GetLastSavepointStub = nil
if fake.getLastSavepointReturnsOnCall == nil {
fake.getLastSavepointReturnsOnCall = make(map[int]struct {
result1 *version.Height
result2 error
})
}
fake.getLastSavepointReturnsOnCall[i] = struct {
result1 *version.Height
result2 error
}{result1, result2}
}
func (fake *TxMgr) NewQueryExecutor(arg1 string) (ledger.QueryExecutor, error) {
fake.newQueryExecutorMutex.Lock()
ret, specificReturn := fake.newQueryExecutorReturnsOnCall[len(fake.newQueryExecutorArgsForCall)]
fake.newQueryExecutorArgsForCall = append(fake.newQueryExecutorArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("NewQueryExecutor", []interface{}{arg1})
fake.newQueryExecutorMutex.Unlock()
if fake.NewQueryExecutorStub != nil {
return fake.NewQueryExecutorStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.newQueryExecutorReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *TxMgr) NewQueryExecutorCallCount() int {
fake.newQueryExecutorMutex.RLock()
defer fake.newQueryExecutorMutex.RUnlock()
return len(fake.newQueryExecutorArgsForCall)
}
func (fake *TxMgr) NewQueryExecutorCalls(stub func(string) (ledger.QueryExecutor, error)) {
fake.newQueryExecutorMutex.Lock()
defer fake.newQueryExecutorMutex.Unlock()
fake.NewQueryExecutorStub = stub
}
func (fake *TxMgr) NewQueryExecutorArgsForCall(i int) string {
fake.newQueryExecutorMutex.RLock()
defer fake.newQueryExecutorMutex.RUnlock()
argsForCall := fake.newQueryExecutorArgsForCall[i]
return argsForCall.arg1
}
func (fake *TxMgr) NewQueryExecutorReturns(result1 ledger.QueryExecutor, result2 error) {
fake.newQueryExecutorMutex.Lock()
defer fake.newQueryExecutorMutex.Unlock()
fake.NewQueryExecutorStub = nil
fake.newQueryExecutorReturns = struct {
result1 ledger.QueryExecutor
result2 error
}{result1, result2}
}
func (fake *TxMgr) NewQueryExecutorReturnsOnCall(i int, result1 ledger.QueryExecutor, result2 error) {
fake.newQueryExecutorMutex.Lock()
defer fake.newQueryExecutorMutex.Unlock()
fake.NewQueryExecutorStub = nil
if fake.newQueryExecutorReturnsOnCall == nil {
fake.newQueryExecutorReturnsOnCall = make(map[int]struct {
result1 ledger.QueryExecutor
result2 error
})
}
fake.newQueryExecutorReturnsOnCall[i] = struct {
result1 ledger.QueryExecutor
result2 error
}{result1, result2}
}
func (fake *TxMgr) NewTxSimulator(arg1 string) (ledger.TxSimulator, error) {
fake.newTxSimulatorMutex.Lock()
ret, specificReturn := fake.newTxSimulatorReturnsOnCall[len(fake.newTxSimulatorArgsForCall)]
fake.newTxSimulatorArgsForCall = append(fake.newTxSimulatorArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("NewTxSimulator", []interface{}{arg1})
fake.newTxSimulatorMutex.Unlock()
if fake.NewTxSimulatorStub != nil {
return fake.NewTxSimulatorStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.newTxSimulatorReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *TxMgr) NewTxSimulatorCallCount() int {
fake.newTxSimulatorMutex.RLock()
defer fake.newTxSimulatorMutex.RUnlock()
return len(fake.newTxSimulatorArgsForCall)
}
func (fake *TxMgr) NewTxSimulatorCalls(stub func(string) (ledger.TxSimulator, error)) {
fake.newTxSimulatorMutex.Lock()
defer fake.newTxSimulatorMutex.Unlock()
fake.NewTxSimulatorStub = stub
}
func (fake *TxMgr) NewTxSimulatorArgsForCall(i int) string {
fake.newTxSimulatorMutex.RLock()
defer fake.newTxSimulatorMutex.RUnlock()
argsForCall := fake.newTxSimulatorArgsForCall[i]
return argsForCall.arg1
}
func (fake *TxMgr) NewTxSimulatorReturns(result1 ledger.TxSimulator, result2 error) {
fake.newTxSimulatorMutex.Lock()
defer fake.newTxSimulatorMutex.Unlock()
fake.NewTxSimulatorStub = nil
fake.newTxSimulatorReturns = struct {
result1 ledger.TxSimulator
result2 error
}{result1, result2}
}
func (fake *TxMgr) NewTxSimulatorReturnsOnCall(i int, result1 ledger.TxSimulator, result2 error) {
fake.newTxSimulatorMutex.Lock()
defer fake.newTxSimulatorMutex.Unlock()
fake.NewTxSimulatorStub = nil
if fake.newTxSimulatorReturnsOnCall == nil {
fake.newTxSimulatorReturnsOnCall = make(map[int]struct {
result1 ledger.TxSimulator
result2 error
})
}
fake.newTxSimulatorReturnsOnCall[i] = struct {
result1 ledger.TxSimulator
result2 error
}{result1, result2}
}
func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocks(arg1 map[uint64][]*ledger.TxPvtData) error {
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock()
ret, specificReturn := fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall[len(fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall)]
fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall = append(fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall, struct {
arg1 map[uint64][]*ledger.TxPvtData
}{arg1})
fake.recordInvocation("RemoveStaleAndCommitPvtDataOfOldBlocks", []interface{}{arg1})
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock()
if fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub != nil {
return fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.removeStaleAndCommitPvtDataOfOldBlocksReturns
return fakeReturns.result1
}
func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksCallCount() int {
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RLock()
defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RUnlock()
return len(fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall)
}
func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksCalls(stub func(map[uint64][]*ledger.TxPvtData) error) {
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock()
defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock()
fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub = stub
}
func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksArgsForCall(i int) map[uint64][]*ledger.TxPvtData {
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RLock()
defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RUnlock()
argsForCall := fake.removeStaleAndCommitPvtDataOfOldBlocksArgsForCall[i]
return argsForCall.arg1
}
func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksReturns(result1 error) {
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock()
defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock()
fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub = nil
fake.removeStaleAndCommitPvtDataOfOldBlocksReturns = struct {
result1 error
}{result1}
}
func (fake *TxMgr) RemoveStaleAndCommitPvtDataOfOldBlocksReturnsOnCall(i int, result1 error) {
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Lock()
defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.Unlock()
fake.RemoveStaleAndCommitPvtDataOfOldBlocksStub = nil
if fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall == nil {
fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.removeStaleAndCommitPvtDataOfOldBlocksReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *TxMgr) Rollback() {
fake.rollbackMutex.Lock()
fake.rollbackArgsForCall = append(fake.rollbackArgsForCall, struct {
}{})
fake.recordInvocation("Rollback", []interface{}{})
fake.rollbackMutex.Unlock()
if fake.RollbackStub != nil {
fake.RollbackStub()
}
}
func (fake *TxMgr) RollbackCallCount() int {
fake.rollbackMutex.RLock()
defer fake.rollbackMutex.RUnlock()
return len(fake.rollbackArgsForCall)
}
func (fake *TxMgr) RollbackCalls(stub func()) {
fake.rollbackMutex.Lock()
defer fake.rollbackMutex.Unlock()
fake.RollbackStub = stub
}
func (fake *TxMgr) ShouldRecover(arg1 uint64) (bool, uint64, error) {
fake.shouldRecoverMutex.Lock()
ret, specificReturn := fake.shouldRecoverReturnsOnCall[len(fake.shouldRecoverArgsForCall)]
fake.shouldRecoverArgsForCall = append(fake.shouldRecoverArgsForCall, struct {
arg1 uint64
}{arg1})
fake.recordInvocation("ShouldRecover", []interface{}{arg1})
fake.shouldRecoverMutex.Unlock()
if fake.ShouldRecoverStub != nil {
return fake.ShouldRecoverStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
fakeReturns := fake.shouldRecoverReturns
return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
}
func (fake *TxMgr) ShouldRecoverCallCount() int {
fake.shouldRecoverMutex.RLock()
defer fake.shouldRecoverMutex.RUnlock()
return len(fake.shouldRecoverArgsForCall)
}
func (fake *TxMgr) ShouldRecoverCalls(stub func(uint64) (bool, uint64, error)) {
fake.shouldRecoverMutex.Lock()
defer fake.shouldRecoverMutex.Unlock()
fake.ShouldRecoverStub = stub
}
func (fake *TxMgr) ShouldRecoverArgsForCall(i int) uint64 {
fake.shouldRecoverMutex.RLock()
defer fake.shouldRecoverMutex.RUnlock()
argsForCall := fake.shouldRecoverArgsForCall[i]
return argsForCall.arg1
}
func (fake *TxMgr) ShouldRecoverReturns(result1 bool, result2 uint64, result3 error) {
fake.shouldRecoverMutex.Lock()
defer fake.shouldRecoverMutex.Unlock()
fake.ShouldRecoverStub = nil
fake.shouldRecoverReturns = struct {
result1 bool
result2 uint64
result3 error
}{result1, result2, result3}
}
func (fake *TxMgr) ShouldRecoverReturnsOnCall(i int, result1 bool, result2 uint64, result3 error) {
fake.shouldRecoverMutex.Lock()
defer fake.shouldRecoverMutex.Unlock()
fake.ShouldRecoverStub = nil
if fake.shouldRecoverReturnsOnCall == nil {
fake.shouldRecoverReturnsOnCall = make(map[int]struct {
result1 bool
result2 uint64
result3 error
})
}
fake.shouldRecoverReturnsOnCall[i] = struct {
result1 bool
result2 uint64
result3 error
}{result1, result2, result3}
}
func (fake *TxMgr) Shutdown() {
fake.shutdownMutex.Lock()
fake.shutdownArgsForCall = append(fake.shutdownArgsForCall, struct {
}{})
fake.recordInvocation("Shutdown", []interface{}{})
fake.shutdownMutex.Unlock()
if fake.ShutdownStub != nil {
fake.ShutdownStub()
}
}
func (fake *TxMgr) ShutdownCallCount() int {
fake.shutdownMutex.RLock()
defer fake.shutdownMutex.RUnlock()
return len(fake.shutdownArgsForCall)
}
func (fake *TxMgr) ShutdownCalls(stub func()) {
fake.shutdownMutex.Lock()
defer fake.shutdownMutex.Unlock()
fake.ShutdownStub = stub
}
func (fake *TxMgr) ValidateAndPrepare(arg1 *ledger.BlockAndPvtData, arg2 bool) ([]*txmgr.TxStatInfo, error) {
fake.validateAndPrepareMutex.Lock()
ret, specificReturn := fake.validateAndPrepareReturnsOnCall[len(fake.validateAndPrepareArgsForCall)]
fake.validateAndPrepareArgsForCall = append(fake.validateAndPrepareArgsForCall, struct {
arg1 *ledger.BlockAndPvtData
arg2 bool
}{arg1, arg2})
fake.recordInvocation("ValidateAndPrepare", []interface{}{arg1, arg2})
fake.validateAndPrepareMutex.Unlock()
if fake.ValidateAndPrepareStub != nil {
return fake.ValidateAndPrepareStub(arg1, arg2)
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.validateAndPrepareReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *TxMgr) ValidateAndPrepareCallCount() int {
fake.validateAndPrepareMutex.RLock()
defer fake.validateAndPrepareMutex.RUnlock()
return len(fake.validateAndPrepareArgsForCall)
}
func (fake *TxMgr) ValidateAndPrepareCalls(stub func(*ledger.BlockAndPvtData, bool) ([]*txmgr.TxStatInfo, error)) {
fake.validateAndPrepareMutex.Lock()
defer fake.validateAndPrepareMutex.Unlock()
fake.ValidateAndPrepareStub = stub
}
func (fake *TxMgr) ValidateAndPrepareArgsForCall(i int) (*ledger.BlockAndPvtData, bool) {
fake.validateAndPrepareMutex.RLock()
defer fake.validateAndPrepareMutex.RUnlock()
argsForCall := fake.validateAndPrepareArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *TxMgr) ValidateAndPrepareReturns(result1 []*txmgr.TxStatInfo, result2 error) {
fake.validateAndPrepareMutex.Lock()
defer fake.validateAndPrepareMutex.Unlock()
fake.ValidateAndPrepareStub = nil
fake.validateAndPrepareReturns = struct {
result1 []*txmgr.TxStatInfo
result2 error
}{result1, result2}
}
func (fake *TxMgr) ValidateAndPrepareReturnsOnCall(i int, result1 []*txmgr.TxStatInfo, result2 error) {
fake.validateAndPrepareMutex.Lock()
defer fake.validateAndPrepareMutex.Unlock()
fake.ValidateAndPrepareStub = nil
if fake.validateAndPrepareReturnsOnCall == nil {
fake.validateAndPrepareReturnsOnCall = make(map[int]struct {
result1 []*txmgr.TxStatInfo
result2 error
})
}
fake.validateAndPrepareReturnsOnCall[i] = struct {
result1 []*txmgr.TxStatInfo
result2 error
}{result1, result2}
}
func (fake *TxMgr) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.commitMutex.RLock()
defer fake.commitMutex.RUnlock()
fake.commitLostBlockMutex.RLock()
defer fake.commitLostBlockMutex.RUnlock()
fake.getLastSavepointMutex.RLock()
defer fake.getLastSavepointMutex.RUnlock()
fake.newQueryExecutorMutex.RLock()
defer fake.newQueryExecutorMutex.RUnlock()
fake.newTxSimulatorMutex.RLock()
defer fake.newTxSimulatorMutex.RUnlock()
fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RLock()
defer fake.removeStaleAndCommitPvtDataOfOldBlocksMutex.RUnlock()
fake.rollbackMutex.RLock()
defer fake.rollbackMutex.RUnlock()
fake.shouldRecoverMutex.RLock()
defer fake.shouldRecoverMutex.RUnlock()
fake.shutdownMutex.RLock()
defer fake.shutdownMutex.RUnlock()
fake.validateAndPrepareMutex.RLock()
defer fake.validateAndPrepareMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *TxMgr) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ txmgr.TxMgr = new(TxMgr)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liurenhao/fabric.git
git@gitee.com:liurenhao/fabric.git
liurenhao
fabric
fabric
v2.0.0-alpha

搜索帮助

344bd9b3 5694891 D2dac590 5694891