github.com/turingchain2020/turingchain@v1.1.21/blockchain/mocks/sequence_store.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	types "github.com/turingchain2020/turingchain/types"
     7  	mock "github.com/stretchr/testify/mock"
     8  )
     9  
    10  // SequenceStore is an autogenerated mock type for the SequenceStore type
    11  type SequenceStore struct {
    12  	mock.Mock
    13  }
    14  
    15  // GetBlockHeaderByHash provides a mock function with given fields: hash
    16  func (_m *SequenceStore) GetBlockHeaderByHash(hash []byte) (*types.Header, error) {
    17  	ret := _m.Called(hash)
    18  
    19  	var r0 *types.Header
    20  	if rf, ok := ret.Get(0).(func([]byte) *types.Header); ok {
    21  		r0 = rf(hash)
    22  	} else {
    23  		if ret.Get(0) != nil {
    24  			r0 = ret.Get(0).(*types.Header)
    25  		}
    26  	}
    27  
    28  	var r1 error
    29  	if rf, ok := ret.Get(1).(func([]byte) error); ok {
    30  		r1 = rf(hash)
    31  	} else {
    32  		r1 = ret.Error(1)
    33  	}
    34  
    35  	return r0, r1
    36  }
    37  
    38  // GetBlockSequence provides a mock function with given fields: seq
    39  func (_m *SequenceStore) GetBlockSequence(seq int64) (*types.BlockSequence, error) {
    40  	ret := _m.Called(seq)
    41  
    42  	var r0 *types.BlockSequence
    43  	if rf, ok := ret.Get(0).(func(int64) *types.BlockSequence); ok {
    44  		r0 = rf(seq)
    45  	} else {
    46  		if ret.Get(0) != nil {
    47  			r0 = ret.Get(0).(*types.BlockSequence)
    48  		}
    49  	}
    50  
    51  	var r1 error
    52  	if rf, ok := ret.Get(1).(func(int64) error); ok {
    53  		r1 = rf(seq)
    54  	} else {
    55  		r1 = ret.Error(1)
    56  	}
    57  
    58  	return r0, r1
    59  }
    60  
    61  // GetSequenceByHash provides a mock function with given fields: hash
    62  func (_m *SequenceStore) GetSequenceByHash(hash []byte) (int64, error) {
    63  	ret := _m.Called(hash)
    64  
    65  	var r0 int64
    66  	if rf, ok := ret.Get(0).(func([]byte) int64); ok {
    67  		r0 = rf(hash)
    68  	} else {
    69  		r0 = ret.Get(0).(int64)
    70  	}
    71  
    72  	var r1 error
    73  	if rf, ok := ret.Get(1).(func([]byte) error); ok {
    74  		r1 = rf(hash)
    75  	} else {
    76  		r1 = ret.Error(1)
    77  	}
    78  
    79  	return r0, r1
    80  }
    81  
    82  // LastHeader provides a mock function with given fields:
    83  func (_m *SequenceStore) LastHeader() *types.Header {
    84  	ret := _m.Called()
    85  
    86  	var r0 *types.Header
    87  	if rf, ok := ret.Get(0).(func() *types.Header); ok {
    88  		r0 = rf()
    89  	} else {
    90  		if ret.Get(0) != nil {
    91  			r0 = ret.Get(0).(*types.Header)
    92  		}
    93  	}
    94  
    95  	return r0
    96  }
    97  
    98  // LoadBlockBySequence provides a mock function with given fields: seq
    99  func (_m *SequenceStore) LoadBlockBySequence(seq int64) (*types.BlockDetail, int, error) {
   100  	ret := _m.Called(seq)
   101  
   102  	var r0 *types.BlockDetail
   103  	if rf, ok := ret.Get(0).(func(int64) *types.BlockDetail); ok {
   104  		r0 = rf(seq)
   105  	} else {
   106  		if ret.Get(0) != nil {
   107  			r0 = ret.Get(0).(*types.BlockDetail)
   108  		}
   109  	}
   110  
   111  	var r1 int
   112  	if rf, ok := ret.Get(1).(func(int64) int); ok {
   113  		r1 = rf(seq)
   114  	} else {
   115  		r1 = ret.Get(1).(int)
   116  	}
   117  
   118  	var r2 error
   119  	if rf, ok := ret.Get(2).(func(int64) error); ok {
   120  		r2 = rf(seq)
   121  	} else {
   122  		r2 = ret.Error(2)
   123  	}
   124  
   125  	return r0, r1, r2
   126  }
   127  
   128  // LoadBlockLastSequence provides a mock function with given fields:
   129  func (_m *SequenceStore) LoadBlockLastSequence() (int64, error) {
   130  	ret := _m.Called()
   131  
   132  	var r0 int64
   133  	if rf, ok := ret.Get(0).(func() int64); ok {
   134  		r0 = rf()
   135  	} else {
   136  		r0 = ret.Get(0).(int64)
   137  	}
   138  
   139  	var r1 error
   140  	if rf, ok := ret.Get(1).(func() error); ok {
   141  		r1 = rf()
   142  	} else {
   143  		r1 = ret.Error(1)
   144  	}
   145  
   146  	return r0, r1
   147  }