github.com/turingchain2020/turingchain@v1.1.21/common/db/mocks/kvdb.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import mock "github.com/stretchr/testify/mock"
     6  
     7  // KVDB is an autogenerated mock type for the KVDB type
     8  type KVDB struct {
     9  	mock.Mock
    10  }
    11  
    12  // Begin provides a mock function with given fields:
    13  func (_m *KVDB) Begin() {
    14  	_m.Called()
    15  }
    16  
    17  // Commit provides a mock function with given fields:
    18  func (_m *KVDB) Commit() error {
    19  	ret := _m.Called()
    20  
    21  	var r0 error
    22  	if rf, ok := ret.Get(0).(func() error); ok {
    23  		r0 = rf()
    24  	} else {
    25  		r0 = ret.Error(0)
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // Get provides a mock function with given fields: key
    32  func (_m *KVDB) Get(key []byte) ([]byte, error) {
    33  	ret := _m.Called(key)
    34  
    35  	var r0 []byte
    36  	if rf, ok := ret.Get(0).(func([]byte) []byte); ok {
    37  		r0 = rf(key)
    38  	} else {
    39  		if ret.Get(0) != nil {
    40  			r0 = ret.Get(0).([]byte)
    41  		}
    42  	}
    43  
    44  	var r1 error
    45  	if rf, ok := ret.Get(1).(func([]byte) error); ok {
    46  		r1 = rf(key)
    47  	} else {
    48  		r1 = ret.Error(1)
    49  	}
    50  
    51  	return r0, r1
    52  }
    53  
    54  // List provides a mock function with given fields: prefix, key, count, direction
    55  func (_m *KVDB) List(prefix []byte, key []byte, count int32, direction int32) ([][]byte, error) {
    56  	ret := _m.Called(prefix, key, count, direction)
    57  
    58  	var r0 [][]byte
    59  	if rf, ok := ret.Get(0).(func([]byte, []byte, int32, int32) [][]byte); ok {
    60  		r0 = rf(prefix, key, count, direction)
    61  	} else {
    62  		if ret.Get(0) != nil {
    63  			r0 = ret.Get(0).([][]byte)
    64  		}
    65  	}
    66  
    67  	var r1 error
    68  	if rf, ok := ret.Get(1).(func([]byte, []byte, int32, int32) error); ok {
    69  		r1 = rf(prefix, key, count, direction)
    70  	} else {
    71  		r1 = ret.Error(1)
    72  	}
    73  
    74  	return r0, r1
    75  }
    76  
    77  // PrefixCount provides a mock function with given fields: prefix
    78  func (_m *KVDB) PrefixCount(prefix []byte) int64 {
    79  	ret := _m.Called(prefix)
    80  
    81  	var r0 int64
    82  	if rf, ok := ret.Get(0).(func([]byte) int64); ok {
    83  		r0 = rf(prefix)
    84  	} else {
    85  		r0 = ret.Get(0).(int64)
    86  	}
    87  
    88  	return r0
    89  }
    90  
    91  // Rollback provides a mock function with given fields:
    92  func (_m *KVDB) Rollback() {
    93  	_m.Called()
    94  }
    95  
    96  // Set provides a mock function with given fields: key, value
    97  func (_m *KVDB) Set(key []byte, value []byte) error {
    98  	ret := _m.Called(key, value)
    99  
   100  	var r0 error
   101  	if rf, ok := ret.Get(0).(func([]byte, []byte) error); ok {
   102  		r0 = rf(key, value)
   103  	} else {
   104  		r0 = ret.Error(0)
   105  	}
   106  
   107  	return r0
   108  }