github.com/turingchain2020/turingchain@v1.1.21/common/db/mocks/kv.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 // KV is an autogenerated mock type for the KV type 8 type KV struct { 9 mock.Mock 10 } 11 12 // Begin provides a mock function with given fields: 13 func (_m *KV) Begin() { 14 _m.Called() 15 } 16 17 // Commit provides a mock function with given fields: 18 func (_m *KV) 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 *KV) 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 // Rollback provides a mock function with given fields: 55 func (_m *KV) Rollback() { 56 _m.Called() 57 } 58 59 // Set provides a mock function with given fields: key, value 60 func (_m *KV) Set(key []byte, value []byte) error { 61 ret := _m.Called(key, value) 62 63 var r0 error 64 if rf, ok := ret.Get(0).(func([]byte, []byte) error); ok { 65 r0 = rf(key, value) 66 } else { 67 r0 = ret.Error(0) 68 } 69 70 return r0 71 }