github.com/Oyster-zx/tendermint@v0.34.24-fork/statesync/mocks/state_provider.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 mock "github.com/stretchr/testify/mock" 9 10 state "github.com/tendermint/tendermint/state" 11 12 types "github.com/tendermint/tendermint/types" 13 ) 14 15 // StateProvider is an autogenerated mock type for the StateProvider type 16 type StateProvider struct { 17 mock.Mock 18 } 19 20 // AppHash provides a mock function with given fields: ctx, height 21 func (_m *StateProvider) AppHash(ctx context.Context, height uint64) ([]byte, error) { 22 ret := _m.Called(ctx, height) 23 24 var r0 []byte 25 if rf, ok := ret.Get(0).(func(context.Context, uint64) []byte); ok { 26 r0 = rf(ctx, height) 27 } else { 28 if ret.Get(0) != nil { 29 r0 = ret.Get(0).([]byte) 30 } 31 } 32 33 var r1 error 34 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 35 r1 = rf(ctx, height) 36 } else { 37 r1 = ret.Error(1) 38 } 39 40 return r0, r1 41 } 42 43 // Commit provides a mock function with given fields: ctx, height 44 func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Commit, error) { 45 ret := _m.Called(ctx, height) 46 47 var r0 *types.Commit 48 if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Commit); ok { 49 r0 = rf(ctx, height) 50 } else { 51 if ret.Get(0) != nil { 52 r0 = ret.Get(0).(*types.Commit) 53 } 54 } 55 56 var r1 error 57 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 58 r1 = rf(ctx, height) 59 } else { 60 r1 = ret.Error(1) 61 } 62 63 return r0, r1 64 } 65 66 // State provides a mock function with given fields: ctx, height 67 func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, error) { 68 ret := _m.Called(ctx, height) 69 70 var r0 state.State 71 if rf, ok := ret.Get(0).(func(context.Context, uint64) state.State); ok { 72 r0 = rf(ctx, height) 73 } else { 74 r0 = ret.Get(0).(state.State) 75 } 76 77 var r1 error 78 if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { 79 r1 = rf(ctx, height) 80 } else { 81 r1 = ret.Error(1) 82 } 83 84 return r0, r1 85 } 86 87 type NewStateProviderT interface { 88 mock.TestingT 89 Cleanup(func()) 90 } 91 92 // NewStateProvider creates a new instance of StateProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 93 func NewStateProvider(t NewStateProviderT) *StateProvider { 94 mock := &StateProvider{} 95 mock.Mock.Test(t) 96 97 t.Cleanup(func() { mock.AssertExpectations(t) }) 98 99 return mock 100 }