mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-04 11:02:06 +00:00
* ----start---- * [PARTIAL cherry-pick] ABCI Vote Extension 2 (#6885) * Cherry-picked #6567: state/types: refactor makeBlock, makeBlocks and makeTxs (#6567) * [Cherrypicked] types: remove panic from block methods (#7501) * [cherrypicked] abci++: synchronize PrepareProposal with the newest version of the spec (#8094) This change implements the logic for the PrepareProposal ABCI++ method call. The main logic for creating and issuing the PrepareProposal request lives in execution.go and is tested in a set of new tests in execution_test.go. This change also updates the mempool mock to use a mockery generated version and removes much of the plumbing for the no longer used ABCIResponses. * make proto-gen * Backported EvidenceList's method ToABCI from #7961 * make build * Fix mockery for Mempool * mockery * Backported abci Application mocks from #7961 * mockery2 * Fixed new PrepareProposal test cases in state/execution_test.go * Fixed returned errors in consensus/state.go * lint * Addressed @cmwaters' comment Co-authored-by: mconcat <monoidconcat@gmail.com> Co-authored-by: JayT106 <JayT106@users.noreply.github.com> Co-authored-by: Sam Kleinman <garen@tychoish.com> Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
235 lines
5.0 KiB
Go
235 lines
5.0 KiB
Go
// Code generated by mockery v2.14.0. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
mock "github.com/stretchr/testify/mock"
|
|
state "github.com/tendermint/tendermint/state"
|
|
|
|
tendermintstate "github.com/tendermint/tendermint/proto/tendermint/state"
|
|
|
|
tenderminttypes "github.com/tendermint/tendermint/types"
|
|
|
|
types "github.com/tendermint/tendermint/proto/tendermint/types"
|
|
)
|
|
|
|
// Store is an autogenerated mock type for the Store type
|
|
type Store struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// Bootstrap provides a mock function with given fields: _a0
|
|
func (_m *Store) Bootstrap(_a0 state.State) error {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(state.State) error); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Close provides a mock function with given fields:
|
|
func (_m *Store) Close() error {
|
|
ret := _m.Called()
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Load provides a mock function with given fields:
|
|
func (_m *Store) Load() (state.State, error) {
|
|
ret := _m.Called()
|
|
|
|
var r0 state.State
|
|
if rf, ok := ret.Get(0).(func() state.State); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(state.State)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
r1 = rf()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// LoadABCIResponses provides a mock function with given fields: _a0
|
|
func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, error) {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 *tendermintstate.ABCIResponses
|
|
if rf, ok := ret.Get(0).(func(int64) *tendermintstate.ABCIResponses); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*tendermintstate.ABCIResponses)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(int64) error); ok {
|
|
r1 = rf(_a0)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// LoadConsensusParams provides a mock function with given fields: _a0
|
|
func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 types.ConsensusParams
|
|
if rf, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
r0 = ret.Get(0).(types.ConsensusParams)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(int64) error); ok {
|
|
r1 = rf(_a0)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// LoadFromDBOrGenesisDoc provides a mock function with given fields: _a0
|
|
func (_m *Store) LoadFromDBOrGenesisDoc(_a0 *tenderminttypes.GenesisDoc) (state.State, error) {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 state.State
|
|
if rf, ok := ret.Get(0).(func(*tenderminttypes.GenesisDoc) state.State); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
r0 = ret.Get(0).(state.State)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(*tenderminttypes.GenesisDoc) error); ok {
|
|
r1 = rf(_a0)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// LoadFromDBOrGenesisFile provides a mock function with given fields: _a0
|
|
func (_m *Store) LoadFromDBOrGenesisFile(_a0 string) (state.State, error) {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 state.State
|
|
if rf, ok := ret.Get(0).(func(string) state.State); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
r0 = ret.Get(0).(state.State)
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(_a0)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// LoadValidators provides a mock function with given fields: _a0
|
|
func (_m *Store) LoadValidators(_a0 int64) (*tenderminttypes.ValidatorSet, error) {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 *tenderminttypes.ValidatorSet
|
|
if rf, ok := ret.Get(0).(func(int64) *tenderminttypes.ValidatorSet); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*tenderminttypes.ValidatorSet)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(int64) error); ok {
|
|
r1 = rf(_a0)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PruneStates provides a mock function with given fields: _a0, _a1
|
|
func (_m *Store) PruneStates(_a0 int64, _a1 int64) error {
|
|
ret := _m.Called(_a0, _a1)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(int64, int64) error); ok {
|
|
r0 = rf(_a0, _a1)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Save provides a mock function with given fields: _a0
|
|
func (_m *Store) Save(_a0 state.State) error {
|
|
ret := _m.Called(_a0)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(state.State) error); ok {
|
|
r0 = rf(_a0)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SaveABCIResponses provides a mock function with given fields: _a0, _a1
|
|
func (_m *Store) SaveABCIResponses(_a0 int64, _a1 *tendermintstate.ABCIResponses) error {
|
|
ret := _m.Called(_a0, _a1)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(int64, *tendermintstate.ABCIResponses) error); ok {
|
|
r0 = rf(_a0, _a1)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
type mockConstructorTestingTNewStore interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewStore(t mockConstructorTestingTNewStore) *Store {
|
|
mock := &Store{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|