From 0fcde632f7437a3591af3f39728d0ba260922f06 Mon Sep 17 00:00:00 2001 From: Edward Mack Date: Wed, 29 Jun 2022 14:54:34 -0400 Subject: [PATCH] fix(lib/grandpa): Storing Justification Allows Extra Bytes (GSR-13) (#2618) --- dot/sync/chain_processor.go | 4 +- dot/sync/chain_processor_test.go | 16 +- dot/sync/interface.go | 2 +- dot/sync/mock_interface_test.go | 7 +- dot/sync/syncer_integration_test.go | 5 +- lib/grandpa/message_handler.go | 47 +-- lib/grandpa/message_handler_test.go | 142 +++++++- lib/grandpa/mocks_generate_test.go | 6 + lib/grandpa/mocks_test.go | 538 ++++++++++++++++++++++++++++ 9 files changed, 722 insertions(+), 45 deletions(-) create mode 100644 lib/grandpa/mocks_generate_test.go create mode 100644 lib/grandpa/mocks_test.go diff --git a/dot/sync/chain_processor.go b/dot/sync/chain_processor.go index de02d5bd33..267785021e 100644 --- a/dot/sync/chain_processor.go +++ b/dot/sync/chain_processor.go @@ -253,13 +253,13 @@ func (s *chainProcessor) handleJustification(header *types.Header, justification return } - err := s.finalityGadget.VerifyBlockJustification(header.Hash(), justification) + returnedJustification, err := s.finalityGadget.VerifyBlockJustification(header.Hash(), justification) if err != nil { logger.Warnf("failed to verify block number %d and hash %s justification: %s", header.Number, header.Hash(), err) return } - err = s.blockState.SetJustification(header.Hash(), justification) + err = s.blockState.SetJustification(header.Hash(), returnedJustification) if err != nil { logger.Errorf("failed tostore justification: %s", err) return diff --git a/dot/sync/chain_processor_test.go b/dot/sync/chain_processor_test.go index 0f9cb6624d..fb9a3a8b21 100644 --- a/dot/sync/chain_processor_test.go +++ b/dot/sync/chain_processor_test.go @@ -258,7 +258,8 @@ func Test_chainProcessor_handleJustification(t *testing.T) { "invalid justification": { chainProcessorBuilder: func(ctrl *gomock.Controller) chainProcessor { mockFinalityGadget := NewMockFinalityGadget(ctrl) - mockFinalityGadget.EXPECT().VerifyBlockJustification(expectedHash, []byte(`x`)).Return(errors.New("error")) + mockFinalityGadget.EXPECT().VerifyBlockJustification(expectedHash, + []byte(`x`)).Return(nil, errors.New("error")) return chainProcessor{ finalityGadget: mockFinalityGadget, } @@ -275,7 +276,7 @@ func Test_chainProcessor_handleJustification(t *testing.T) { mockBlockState := NewMockBlockState(ctrl) mockBlockState.EXPECT().SetJustification(expectedHash, []byte(`xx`)).Return(errors.New("fake error")) mockFinalityGadget := NewMockFinalityGadget(ctrl) - mockFinalityGadget.EXPECT().VerifyBlockJustification(expectedHash, []byte(`xx`)).Return(nil) + mockFinalityGadget.EXPECT().VerifyBlockJustification(expectedHash, []byte(`xx`)).Return([]byte(`xx`), nil) return chainProcessor{ blockState: mockBlockState, finalityGadget: mockFinalityGadget, @@ -293,7 +294,7 @@ func Test_chainProcessor_handleJustification(t *testing.T) { mockBlockState := NewMockBlockState(ctrl) mockBlockState.EXPECT().SetJustification(expectedHash, []byte(`1234`)).Return(nil) mockFinalityGadget := NewMockFinalityGadget(ctrl) - mockFinalityGadget.EXPECT().VerifyBlockJustification(expectedHash, []byte(`1234`)).Return(nil) + mockFinalityGadget.EXPECT().VerifyBlockJustification(expectedHash, []byte(`1234`)).Return([]byte(`1234`), nil) return chainProcessor{ blockState: mockBlockState, finalityGadget: mockFinalityGadget, @@ -417,7 +418,7 @@ func Test_chainProcessor_processBlockData(t *testing.T) { mockFinalityGadget := NewMockFinalityGadget(ctrl) mockFinalityGadget.EXPECT().VerifyBlockJustification(common.MustHexToHash( "0x6443a0b46e0412e626363028115a9f2cf963eeed526b8b33e5316f08b50d0dc3"), []byte{1, 2, - 3}) + 3}).Return([]byte{1, 2, 3}, nil) mockStorageState := NewMockStorageState(ctrl) mockStorageState.EXPECT().TrieState(&common.Hash{}).Return(nil, nil) mockBlockImportHandler := NewMockBlockImportHandler(ctrl) @@ -452,7 +453,7 @@ func Test_chainProcessor_processBlockData(t *testing.T) { mockFinalityGadget := NewMockFinalityGadget(ctrl) mockFinalityGadget.EXPECT().VerifyBlockJustification(common.MustHexToHash( "0x6443a0b46e0412e626363028115a9f2cf963eeed526b8b33e5316f08b50d0dc3"), []byte{1, 2, - 3}) + 3}).Return([]byte{1, 2, 3}, nil) mockStorageState := NewMockStorageState(ctrl) mockStorageState.EXPECT().TrieState(&common.Hash{}).Return(nil, mockError) return chainProcessor{ @@ -484,7 +485,7 @@ func Test_chainProcessor_processBlockData(t *testing.T) { mockFinalityGadget := NewMockFinalityGadget(ctrl) mockFinalityGadget.EXPECT().VerifyBlockJustification(common.MustHexToHash( "0x6443a0b46e0412e626363028115a9f2cf963eeed526b8b33e5316f08b50d0dc3"), []byte{1, 2, - 3}) + 3}).Return([]byte{1, 2, 3}, nil) mockStorageState := NewMockStorageState(ctrl) mockStorageState.EXPECT().TrieState(&common.Hash{}).Return(nil, nil) mockBlockImportHandler := NewMockBlockImportHandler(ctrl) @@ -687,7 +688,8 @@ func Test_chainProcessor_processBlockData(t *testing.T) { mockTelemetry.EXPECT().SendMessage(gomock.Any()).AnyTimes() mockFinalityGadget := NewMockFinalityGadget(ctrl) mockFinalityGadget.EXPECT().VerifyBlockJustification( - common.MustHexToHash("0xdcdd89927d8a348e00257e1ecc8617f45edb5118efff3ea2f9961b2ad9b7690a"), justification) + common.MustHexToHash("0xdcdd89927d8a348e00257e1ecc8617f45edb5118efff3ea2f9961b2ad9b7690a"), + justification).Return(justification, nil) return chainProcessor{ blockState: mockBlockState, babeVerifier: mockBabeVerifier, diff --git a/dot/sync/interface.go b/dot/sync/interface.go index 4922a02b12..231f154f9c 100644 --- a/dot/sync/interface.go +++ b/dot/sync/interface.go @@ -76,7 +76,7 @@ type BabeVerifier interface { // FinalityGadget implements justification verification functionality type FinalityGadget interface { - VerifyBlockJustification(common.Hash, []byte) error + VerifyBlockJustification(common.Hash, []byte) ([]byte, error) } // BlockImportHandler is the interface for the handler of newly imported blocks diff --git a/dot/sync/mock_interface_test.go b/dot/sync/mock_interface_test.go index c34f41db3e..5623130556 100644 --- a/dot/sync/mock_interface_test.go +++ b/dot/sync/mock_interface_test.go @@ -658,11 +658,12 @@ func (m *MockFinalityGadget) EXPECT() *MockFinalityGadgetMockRecorder { } // VerifyBlockJustification mocks base method. -func (m *MockFinalityGadget) VerifyBlockJustification(arg0 common.Hash, arg1 []byte) error { +func (m *MockFinalityGadget) VerifyBlockJustification(arg0 common.Hash, arg1 []byte) ([]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "VerifyBlockJustification", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 + ret0, _ := ret[0].([]byte) + ret1, _ := ret[1].(error) + return ret0, ret1 } // VerifyBlockJustification indicates an expected call of VerifyBlockJustification. diff --git a/dot/sync/syncer_integration_test.go b/dot/sync/syncer_integration_test.go index fd1f21a012..716ae951a5 100644 --- a/dot/sync/syncer_integration_test.go +++ b/dot/sync/syncer_integration_test.go @@ -120,7 +120,10 @@ func newTestSyncer(t *testing.T) *Service { cfg.LogLvl = log.Trace mockFinalityGadget := NewMockFinalityGadget(ctrl) mockFinalityGadget.EXPECT().VerifyBlockJustification(gomock.AssignableToTypeOf(common.Hash{}), - gomock.AssignableToTypeOf([]byte{})).AnyTimes() + gomock.AssignableToTypeOf([]byte{})).DoAndReturn(func(hash common.Hash, justification []byte) ([]byte, error) { + return justification, nil + }).AnyTimes() + cfg.FinalityGadget = mockFinalityGadget cfg.Network = newMockNetwork() cfg.Telemetry = mockTelemetryClient diff --git a/lib/grandpa/message_handler.go b/lib/grandpa/message_handler.go index 6a5241694c..766ca26b29 100644 --- a/lib/grandpa/message_handler.go +++ b/lib/grandpa/message_handler.go @@ -553,40 +553,41 @@ func (h *MessageHandler) verifyJustification(just *SignedVote, round, setID uint return nil } -// VerifyBlockJustification verifies the finality justification for a block -func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byte) error { +// VerifyBlockJustification verifies the finality justification for a block, returns scale encoded justification with +// any extra bytes removed. +func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byte) ([]byte, error) { fj := Justification{} err := scale.Unmarshal(justification, &fj) if err != nil { - return err + return nil, err } setID, err := s.grandpaState.GetSetIDByBlockNumber(uint(fj.Commit.Number)) if err != nil { - return fmt.Errorf("cannot get set ID from block number: %w", err) + return nil, fmt.Errorf("cannot get set ID from block number: %w", err) } has, err := s.blockState.HasFinalisedBlock(fj.Round, setID) if err != nil { - return err + return nil, err } if has { - return fmt.Errorf("already have finalised block with setID=%d and round=%d", setID, fj.Round) + return nil, fmt.Errorf("already have finalised block with setID=%d and round=%d", setID, fj.Round) } isDescendant, err := isDescendantOfHighestFinalisedBlock(s.blockState, fj.Commit.Hash) if err != nil { - return err + return nil, err } if !isDescendant { - return errVoteBlockMismatch + return nil, errVoteBlockMismatch } auths, err := s.grandpaState.GetAuthorities(setID) if err != nil { - return fmt.Errorf("cannot get authorities for set ID: %w", err) + return nil, fmt.Errorf("cannot get authorities for set ID: %w", err) } // threshold is two-thirds the number of authorities, @@ -594,7 +595,7 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt threshold := (2 * len(auths) / 3) if len(fj.Commit.Precommits) < threshold { - return ErrMinVotesNotMet + return nil, ErrMinVotesNotMet } authPubKeys := make([]AuthData, len(fj.Commit.Precommits)) @@ -604,7 +605,7 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt equivocatoryVoters, err := getEquivocatoryVoters(authPubKeys) if err != nil { - return fmt.Errorf("could not get valid equivocatory voters: %w", err) + return nil, fmt.Errorf("could not get valid equivocatory voters: %w", err) } var count int @@ -617,20 +618,20 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt // check if vote was for descendant of committed block isDescendant, err := s.blockState.IsDescendantOf(hash, just.Vote.Hash) if err != nil { - return err + return nil, err } if !isDescendant { - return ErrPrecommitBlockMismatch + return nil, ErrPrecommitBlockMismatch } pk, err := ed25519.NewPublicKey(just.AuthorityID[:]) if err != nil { - return err + return nil, err } if !isInAuthSet(pk, auths) { - return ErrAuthorityNotInSet + return nil, ErrAuthorityNotInSet } // verify signature for each precommit @@ -641,16 +642,16 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt SetID: setID, }) if err != nil { - return err + return nil, err } ok, err := pk.Verify(msg, just.Signature[:]) if err != nil { - return err + return nil, err } if !ok { - return ErrInvalidSignature + return nil, ErrInvalidSignature } if _, ok := equivocatoryVoters[just.AuthorityID]; ok { @@ -661,30 +662,30 @@ func (s *Service) VerifyBlockJustification(hash common.Hash, justification []byt } if count+len(equivocatoryVoters) < threshold { - return ErrMinVotesNotMet + return nil, ErrMinVotesNotMet } err = verifyBlockHashAgainstBlockNumber(s.blockState, fj.Commit.Hash, uint(fj.Commit.Number)) if err != nil { - return err + return nil, err } for _, preCommit := range fj.Commit.Precommits { err := verifyBlockHashAgainstBlockNumber(s.blockState, preCommit.Vote.Hash, uint(preCommit.Vote.Number)) if err != nil { - return err + return nil, err } } err = s.blockState.SetFinalisedHash(hash, fj.Round, setID) if err != nil { - return err + return nil, err } logger.Debugf( "set finalised block with hash %s, round %d and set id %d", hash, fj.Round, setID) - return nil + return scale.Marshal(fj) } func verifyBlockHashAgainstBlockNumber(bs BlockState, hash common.Hash, number uint) error { diff --git a/lib/grandpa/message_handler_test.go b/lib/grandpa/message_handler_test.go index a03ee6b183..2f43675ed0 100644 --- a/lib/grandpa/message_handler_test.go +++ b/lib/grandpa/message_handler_test.go @@ -4,6 +4,7 @@ package grandpa import ( + "errors" "testing" "time" @@ -15,7 +16,7 @@ import ( "github.com/ChainSafe/gossamer/lib/keystore" "github.com/ChainSafe/gossamer/pkg/scale" "github.com/golang/mock/gomock" - + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -653,8 +654,9 @@ func TestMessageHandler_VerifyBlockJustification_WithEquivocatoryVotes(t *testin just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + returnedJust, err := gs.VerifyBlockJustification(testHash, data) require.NoError(t, err) + require.Equal(t, data, returnedJust) } func TestMessageHandler_VerifyBlockJustification(t *testing.T) { @@ -697,8 +699,9 @@ func TestMessageHandler_VerifyBlockJustification(t *testing.T) { just := newJustification(round, testHash, number, precommits) data, err := scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + returnedJust, err := gs.VerifyBlockJustification(testHash, data) require.NoError(t, err) + require.Equal(t, data, returnedJust) // use wrong hash, shouldn't verify precommits = buildTestJustification(t, 2, round+1, setID, kr, precommit) @@ -706,9 +709,10 @@ func TestMessageHandler_VerifyBlockJustification(t *testing.T) { just.Commit.Precommits[0].Vote.Hash = genhash data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + returnedJust, err = gs.VerifyBlockJustification(testHash, data) require.NotNil(t, err) require.Equal(t, blocktree.ErrEndNodeNotFound, err) + require.Nil(t, returnedJust) } func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { @@ -753,34 +757,38 @@ func TestMessageHandler_VerifyBlockJustification_invalid(t *testing.T) { just.Commit.Precommits[0].Vote.Hash = genhash data, err := scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + returnedJust, err := gs.VerifyBlockJustification(testHash, data) require.NotNil(t, err) require.Equal(t, ErrPrecommitBlockMismatch, err) + require.Nil(t, returnedJust) // use wrong round, shouldn't verify precommits = buildTestJustification(t, 2, round+1, setID, kr, precommit) just = newJustification(round+2, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + returnedJust, err = gs.VerifyBlockJustification(testHash, data) require.NotNil(t, err) require.Equal(t, ErrInvalidSignature, err) + require.Nil(t, returnedJust) // add authority not in set, shouldn't verify precommits = buildTestJustification(t, len(auths)+1, round+1, setID, kr, precommit) just = newJustification(round+1, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + returnedJust, err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrAuthorityNotInSet, err) + require.Nil(t, returnedJust) // not enough signatures, shouldn't verify precommits = buildTestJustification(t, 1, round+1, setID, kr, precommit) just = newJustification(round+1, testHash, number, precommits) data, err = scale.Marshal(*just) require.NoError(t, err) - err = gs.VerifyBlockJustification(testHash, data) + returnedJust, err = gs.VerifyBlockJustification(testHash, data) require.Equal(t, ErrMinVotesNotMet, err) + require.Nil(t, returnedJust) } func Test_getEquivocatoryVoters(t *testing.T) { @@ -1055,3 +1063,121 @@ func signFakeFullVote( return sig } + +func TestService_VerifyBlockJustification(t *testing.T) { + precommits := buildTestJustification(t, 2, 1, 0, kr, precommit) + justification := newJustification(1, testHash, 1, precommits) + justificationBytes, err := scale.Marshal(*justification) + require.NoError(t, err) + + type fields struct { + blockStateBuilder func(ctrl *gomock.Controller) BlockState + grandpaStateBuilder func(ctrl *gomock.Controller) GrandpaState + } + type args struct { + hash common.Hash + justification []byte + } + tests := map[string]struct { + fields fields + args args + want []byte + wantErr error + }{ + "invalid justification": { + fields: fields{ + blockStateBuilder: func(ctrl *gomock.Controller) BlockState { + return nil + }, + grandpaStateBuilder: func(ctrl *gomock.Controller) GrandpaState { + return nil + }, + }, + args: args{ + hash: common.Hash{}, + justification: []byte{1, 2, 3}, + }, + want: nil, + wantErr: errors.New("EOF, field: 0x0000000000000000000000000000000000000000000000000000000000000000, " + + "field: {Hash:0x0000000000000000000000000000000000000000000000000000000000000000 Number:0 Precommits:[]}"), + }, + "valid justification": { + fields: fields{ + blockStateBuilder: func(ctrl *gomock.Controller) BlockState { + mockBlockState := NewMockBlockState(ctrl) + mockBlockState.EXPECT().HasFinalisedBlock(uint64(1), uint64(0)).Return(false, nil) + mockBlockState.EXPECT().GetHighestFinalisedHeader().Return(testHeader, nil) + mockBlockState.EXPECT().IsDescendantOf(testHash, testHash). + Return(true, nil).Times(3) + mockBlockState.EXPECT().GetHeader(testHash).Return(testHeader, nil).Times(3) + mockBlockState.EXPECT().SetFinalisedHash(testHash, uint64(1), + uint64(0)).Return(nil) + return mockBlockState + }, + grandpaStateBuilder: func(ctrl *gomock.Controller) GrandpaState { + mockGrandpaState := NewMockGrandpaState(ctrl) + mockGrandpaState.EXPECT().GetSetIDByBlockNumber(uint(1)).Return(uint64(0), nil) + mockGrandpaState.EXPECT().GetAuthorities(uint64(0)).Return([]types.GrandpaVoter{ + {Key: *kr.Alice().Public().(*ed25519.PublicKey), ID: 1}, + {Key: *kr.Bob().Public().(*ed25519.PublicKey), ID: 2}, + {Key: *kr.Charlie().Public().(*ed25519.PublicKey), ID: 3}, + }, nil) + return mockGrandpaState + }, + }, + args: args{ + hash: testHash, + justification: justificationBytes, + }, + want: justificationBytes, + }, + "valid justification extra bytes": { + fields: fields{ + blockStateBuilder: func(ctrl *gomock.Controller) BlockState { + mockBlockState := NewMockBlockState(ctrl) + mockBlockState.EXPECT().HasFinalisedBlock(uint64(1), uint64(0)).Return(false, nil) + mockBlockState.EXPECT().GetHighestFinalisedHeader().Return(testHeader, nil) + mockBlockState.EXPECT().IsDescendantOf(testHash, testHash). + Return(true, nil).Times(3) + mockBlockState.EXPECT().GetHeader(testHash).Return(testHeader, nil).Times(3) + mockBlockState.EXPECT().SetFinalisedHash(testHash, uint64(1), + uint64(0)).Return(nil) + return mockBlockState + }, + grandpaStateBuilder: func(ctrl *gomock.Controller) GrandpaState { + mockGrandpaState := NewMockGrandpaState(ctrl) + mockGrandpaState.EXPECT().GetSetIDByBlockNumber(uint(1)).Return(uint64(0), nil) + mockGrandpaState.EXPECT().GetAuthorities(uint64(0)).Return([]types.GrandpaVoter{ + {Key: *kr.Alice().Public().(*ed25519.PublicKey), ID: 1}, + {Key: *kr.Bob().Public().(*ed25519.PublicKey), ID: 2}, + {Key: *kr.Charlie().Public().(*ed25519.PublicKey), ID: 3}, + }, nil) + return mockGrandpaState + }, + }, + args: args{ + hash: testHash, + justification: append(justificationBytes, []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}...), + }, + want: justificationBytes, + }, + } + for name, tt := range tests { + tt := tt + t.Run(name, func(t *testing.T) { + t.Parallel() + ctrl := gomock.NewController(t) + s := &Service{ + blockState: tt.fields.blockStateBuilder(ctrl), + grandpaState: tt.fields.grandpaStateBuilder(ctrl), + } + got, err := s.VerifyBlockJustification(tt.args.hash, tt.args.justification) + if tt.wantErr != nil { + assert.ErrorContains(t, err, tt.wantErr.Error()) + } else { + require.NoError(t, err) + } + assert.Equalf(t, tt.want, got, "VerifyBlockJustification(%v, %v)", tt.args.hash, tt.args.justification) + }) + } +} diff --git a/lib/grandpa/mocks_generate_test.go b/lib/grandpa/mocks_generate_test.go new file mode 100644 index 0000000000..84d6188cef --- /dev/null +++ b/lib/grandpa/mocks_generate_test.go @@ -0,0 +1,6 @@ +// Copyright 2021 ChainSafe Systems (ON) +// SPDX-License-Identifier: LGPL-3.0-only + +package grandpa + +//go:generate mockgen -destination=mocks_test.go -package $GOPACKAGE . BlockState,GrandpaState diff --git a/lib/grandpa/mocks_test.go b/lib/grandpa/mocks_test.go new file mode 100644 index 0000000000..a91d5301de --- /dev/null +++ b/lib/grandpa/mocks_test.go @@ -0,0 +1,538 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/ChainSafe/gossamer/lib/grandpa (interfaces: BlockState,GrandpaState) + +// Package grandpa is a generated GoMock package. +package grandpa + +import ( + reflect "reflect" + + types "github.com/ChainSafe/gossamer/dot/types" + common "github.com/ChainSafe/gossamer/lib/common" + gomock "github.com/golang/mock/gomock" +) + +// MockBlockState is a mock of BlockState interface. +type MockBlockState struct { + ctrl *gomock.Controller + recorder *MockBlockStateMockRecorder +} + +// MockBlockStateMockRecorder is the mock recorder for MockBlockState. +type MockBlockStateMockRecorder struct { + mock *MockBlockState +} + +// NewMockBlockState creates a new mock instance. +func NewMockBlockState(ctrl *gomock.Controller) *MockBlockState { + mock := &MockBlockState{ctrl: ctrl} + mock.recorder = &MockBlockStateMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBlockState) EXPECT() *MockBlockStateMockRecorder { + return m.recorder +} + +// BestBlockHash mocks base method. +func (m *MockBlockState) BestBlockHash() common.Hash { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BestBlockHash") + ret0, _ := ret[0].(common.Hash) + return ret0 +} + +// BestBlockHash indicates an expected call of BestBlockHash. +func (mr *MockBlockStateMockRecorder) BestBlockHash() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BestBlockHash", reflect.TypeOf((*MockBlockState)(nil).BestBlockHash)) +} + +// BestBlockHeader mocks base method. +func (m *MockBlockState) BestBlockHeader() (*types.Header, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BestBlockHeader") + ret0, _ := ret[0].(*types.Header) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BestBlockHeader indicates an expected call of BestBlockHeader. +func (mr *MockBlockStateMockRecorder) BestBlockHeader() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BestBlockHeader", reflect.TypeOf((*MockBlockState)(nil).BestBlockHeader)) +} + +// BestBlockNumber mocks base method. +func (m *MockBlockState) BestBlockNumber() (uint, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BestBlockNumber") + ret0, _ := ret[0].(uint) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BestBlockNumber indicates an expected call of BestBlockNumber. +func (mr *MockBlockStateMockRecorder) BestBlockNumber() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BestBlockNumber", reflect.TypeOf((*MockBlockState)(nil).BestBlockNumber)) +} + +// BlocktreeAsString mocks base method. +func (m *MockBlockState) BlocktreeAsString() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlocktreeAsString") + ret0, _ := ret[0].(string) + return ret0 +} + +// BlocktreeAsString indicates an expected call of BlocktreeAsString. +func (mr *MockBlockStateMockRecorder) BlocktreeAsString() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlocktreeAsString", reflect.TypeOf((*MockBlockState)(nil).BlocktreeAsString)) +} + +// FreeFinalisedNotifierChannel mocks base method. +func (m *MockBlockState) FreeFinalisedNotifierChannel(arg0 chan *types.FinalisationInfo) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "FreeFinalisedNotifierChannel", arg0) +} + +// FreeFinalisedNotifierChannel indicates an expected call of FreeFinalisedNotifierChannel. +func (mr *MockBlockStateMockRecorder) FreeFinalisedNotifierChannel(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeFinalisedNotifierChannel", reflect.TypeOf((*MockBlockState)(nil).FreeFinalisedNotifierChannel), arg0) +} + +// FreeImportedBlockNotifierChannel mocks base method. +func (m *MockBlockState) FreeImportedBlockNotifierChannel(arg0 chan *types.Block) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "FreeImportedBlockNotifierChannel", arg0) +} + +// FreeImportedBlockNotifierChannel indicates an expected call of FreeImportedBlockNotifierChannel. +func (mr *MockBlockStateMockRecorder) FreeImportedBlockNotifierChannel(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FreeImportedBlockNotifierChannel", reflect.TypeOf((*MockBlockState)(nil).FreeImportedBlockNotifierChannel), arg0) +} + +// GenesisHash mocks base method. +func (m *MockBlockState) GenesisHash() common.Hash { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenesisHash") + ret0, _ := ret[0].(common.Hash) + return ret0 +} + +// GenesisHash indicates an expected call of GenesisHash. +func (mr *MockBlockStateMockRecorder) GenesisHash() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenesisHash", reflect.TypeOf((*MockBlockState)(nil).GenesisHash)) +} + +// GetFinalisedHeader mocks base method. +func (m *MockBlockState) GetFinalisedHeader(arg0, arg1 uint64) (*types.Header, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFinalisedHeader", arg0, arg1) + ret0, _ := ret[0].(*types.Header) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetFinalisedHeader indicates an expected call of GetFinalisedHeader. +func (mr *MockBlockStateMockRecorder) GetFinalisedHeader(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFinalisedHeader", reflect.TypeOf((*MockBlockState)(nil).GetFinalisedHeader), arg0, arg1) +} + +// GetFinalisedNotifierChannel mocks base method. +func (m *MockBlockState) GetFinalisedNotifierChannel() chan *types.FinalisationInfo { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFinalisedNotifierChannel") + ret0, _ := ret[0].(chan *types.FinalisationInfo) + return ret0 +} + +// GetFinalisedNotifierChannel indicates an expected call of GetFinalisedNotifierChannel. +func (mr *MockBlockStateMockRecorder) GetFinalisedNotifierChannel() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFinalisedNotifierChannel", reflect.TypeOf((*MockBlockState)(nil).GetFinalisedNotifierChannel)) +} + +// GetHashByNumber mocks base method. +func (m *MockBlockState) GetHashByNumber(arg0 uint) (common.Hash, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetHashByNumber", arg0) + ret0, _ := ret[0].(common.Hash) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetHashByNumber indicates an expected call of GetHashByNumber. +func (mr *MockBlockStateMockRecorder) GetHashByNumber(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHashByNumber", reflect.TypeOf((*MockBlockState)(nil).GetHashByNumber), arg0) +} + +// GetHeader mocks base method. +func (m *MockBlockState) GetHeader(arg0 common.Hash) (*types.Header, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetHeader", arg0) + ret0, _ := ret[0].(*types.Header) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetHeader indicates an expected call of GetHeader. +func (mr *MockBlockStateMockRecorder) GetHeader(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockBlockState)(nil).GetHeader), arg0) +} + +// GetHeaderByNumber mocks base method. +func (m *MockBlockState) GetHeaderByNumber(arg0 uint) (*types.Header, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetHeaderByNumber", arg0) + ret0, _ := ret[0].(*types.Header) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetHeaderByNumber indicates an expected call of GetHeaderByNumber. +func (mr *MockBlockStateMockRecorder) GetHeaderByNumber(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByNumber", reflect.TypeOf((*MockBlockState)(nil).GetHeaderByNumber), arg0) +} + +// GetHighestFinalisedHeader mocks base method. +func (m *MockBlockState) GetHighestFinalisedHeader() (*types.Header, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetHighestFinalisedHeader") + ret0, _ := ret[0].(*types.Header) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetHighestFinalisedHeader indicates an expected call of GetHighestFinalisedHeader. +func (mr *MockBlockStateMockRecorder) GetHighestFinalisedHeader() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHighestFinalisedHeader", reflect.TypeOf((*MockBlockState)(nil).GetHighestFinalisedHeader)) +} + +// GetHighestRoundAndSetID mocks base method. +func (m *MockBlockState) GetHighestRoundAndSetID() (uint64, uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetHighestRoundAndSetID") + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(uint64) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetHighestRoundAndSetID indicates an expected call of GetHighestRoundAndSetID. +func (mr *MockBlockStateMockRecorder) GetHighestRoundAndSetID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHighestRoundAndSetID", reflect.TypeOf((*MockBlockState)(nil).GetHighestRoundAndSetID)) +} + +// GetImportedBlockNotifierChannel mocks base method. +func (m *MockBlockState) GetImportedBlockNotifierChannel() chan *types.Block { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetImportedBlockNotifierChannel") + ret0, _ := ret[0].(chan *types.Block) + return ret0 +} + +// GetImportedBlockNotifierChannel indicates an expected call of GetImportedBlockNotifierChannel. +func (mr *MockBlockStateMockRecorder) GetImportedBlockNotifierChannel() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetImportedBlockNotifierChannel", reflect.TypeOf((*MockBlockState)(nil).GetImportedBlockNotifierChannel)) +} + +// GetJustification mocks base method. +func (m *MockBlockState) GetJustification(arg0 common.Hash) ([]byte, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetJustification", arg0) + ret0, _ := ret[0].([]byte) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetJustification indicates an expected call of GetJustification. +func (mr *MockBlockStateMockRecorder) GetJustification(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetJustification", reflect.TypeOf((*MockBlockState)(nil).GetJustification), arg0) +} + +// HasFinalisedBlock mocks base method. +func (m *MockBlockState) HasFinalisedBlock(arg0, arg1 uint64) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasFinalisedBlock", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// HasFinalisedBlock indicates an expected call of HasFinalisedBlock. +func (mr *MockBlockStateMockRecorder) HasFinalisedBlock(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasFinalisedBlock", reflect.TypeOf((*MockBlockState)(nil).HasFinalisedBlock), arg0, arg1) +} + +// HasHeader mocks base method. +func (m *MockBlockState) HasHeader(arg0 common.Hash) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasHeader", arg0) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// HasHeader indicates an expected call of HasHeader. +func (mr *MockBlockStateMockRecorder) HasHeader(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasHeader", reflect.TypeOf((*MockBlockState)(nil).HasHeader), arg0) +} + +// HasJustification mocks base method. +func (m *MockBlockState) HasJustification(arg0 common.Hash) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HasJustification", arg0) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// HasJustification indicates an expected call of HasJustification. +func (mr *MockBlockStateMockRecorder) HasJustification(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasJustification", reflect.TypeOf((*MockBlockState)(nil).HasJustification), arg0) +} + +// HighestCommonAncestor mocks base method. +func (m *MockBlockState) HighestCommonAncestor(arg0, arg1 common.Hash) (common.Hash, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HighestCommonAncestor", arg0, arg1) + ret0, _ := ret[0].(common.Hash) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// HighestCommonAncestor indicates an expected call of HighestCommonAncestor. +func (mr *MockBlockStateMockRecorder) HighestCommonAncestor(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HighestCommonAncestor", reflect.TypeOf((*MockBlockState)(nil).HighestCommonAncestor), arg0, arg1) +} + +// IsDescendantOf mocks base method. +func (m *MockBlockState) IsDescendantOf(arg0, arg1 common.Hash) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsDescendantOf", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// IsDescendantOf indicates an expected call of IsDescendantOf. +func (mr *MockBlockStateMockRecorder) IsDescendantOf(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsDescendantOf", reflect.TypeOf((*MockBlockState)(nil).IsDescendantOf), arg0, arg1) +} + +// Leaves mocks base method. +func (m *MockBlockState) Leaves() []common.Hash { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Leaves") + ret0, _ := ret[0].([]common.Hash) + return ret0 +} + +// Leaves indicates an expected call of Leaves. +func (mr *MockBlockStateMockRecorder) Leaves() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Leaves", reflect.TypeOf((*MockBlockState)(nil).Leaves)) +} + +// SetFinalisedHash mocks base method. +func (m *MockBlockState) SetFinalisedHash(arg0 common.Hash, arg1, arg2 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetFinalisedHash", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetFinalisedHash indicates an expected call of SetFinalisedHash. +func (mr *MockBlockStateMockRecorder) SetFinalisedHash(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFinalisedHash", reflect.TypeOf((*MockBlockState)(nil).SetFinalisedHash), arg0, arg1, arg2) +} + +// SetJustification mocks base method. +func (m *MockBlockState) SetJustification(arg0 common.Hash, arg1 []byte) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetJustification", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetJustification indicates an expected call of SetJustification. +func (mr *MockBlockStateMockRecorder) SetJustification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetJustification", reflect.TypeOf((*MockBlockState)(nil).SetJustification), arg0, arg1) +} + +// MockGrandpaState is a mock of GrandpaState interface. +type MockGrandpaState struct { + ctrl *gomock.Controller + recorder *MockGrandpaStateMockRecorder +} + +// MockGrandpaStateMockRecorder is the mock recorder for MockGrandpaState. +type MockGrandpaStateMockRecorder struct { + mock *MockGrandpaState +} + +// NewMockGrandpaState creates a new mock instance. +func NewMockGrandpaState(ctrl *gomock.Controller) *MockGrandpaState { + mock := &MockGrandpaState{ctrl: ctrl} + mock.recorder = &MockGrandpaStateMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGrandpaState) EXPECT() *MockGrandpaStateMockRecorder { + return m.recorder +} + +// GetAuthorities mocks base method. +func (m *MockGrandpaState) GetAuthorities(arg0 uint64) ([]types.GrandpaVoter, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorities", arg0) + ret0, _ := ret[0].([]types.GrandpaVoter) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAuthorities indicates an expected call of GetAuthorities. +func (mr *MockGrandpaStateMockRecorder) GetAuthorities(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorities", reflect.TypeOf((*MockGrandpaState)(nil).GetAuthorities), arg0) +} + +// GetCurrentSetID mocks base method. +func (m *MockGrandpaState) GetCurrentSetID() (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCurrentSetID") + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCurrentSetID indicates an expected call of GetCurrentSetID. +func (mr *MockGrandpaStateMockRecorder) GetCurrentSetID() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSetID", reflect.TypeOf((*MockGrandpaState)(nil).GetCurrentSetID)) +} + +// GetLatestRound mocks base method. +func (m *MockGrandpaState) GetLatestRound() (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLatestRound") + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetLatestRound indicates an expected call of GetLatestRound. +func (mr *MockGrandpaStateMockRecorder) GetLatestRound() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatestRound", reflect.TypeOf((*MockGrandpaState)(nil).GetLatestRound)) +} + +// GetPrecommits mocks base method. +func (m *MockGrandpaState) GetPrecommits(arg0, arg1 uint64) ([]types.GrandpaSignedVote, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPrecommits", arg0, arg1) + ret0, _ := ret[0].([]types.GrandpaSignedVote) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPrecommits indicates an expected call of GetPrecommits. +func (mr *MockGrandpaStateMockRecorder) GetPrecommits(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrecommits", reflect.TypeOf((*MockGrandpaState)(nil).GetPrecommits), arg0, arg1) +} + +// GetPrevotes mocks base method. +func (m *MockGrandpaState) GetPrevotes(arg0, arg1 uint64) ([]types.GrandpaSignedVote, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPrevotes", arg0, arg1) + ret0, _ := ret[0].([]types.GrandpaSignedVote) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPrevotes indicates an expected call of GetPrevotes. +func (mr *MockGrandpaStateMockRecorder) GetPrevotes(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrevotes", reflect.TypeOf((*MockGrandpaState)(nil).GetPrevotes), arg0, arg1) +} + +// GetSetIDByBlockNumber mocks base method. +func (m *MockGrandpaState) GetSetIDByBlockNumber(arg0 uint) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSetIDByBlockNumber", arg0) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSetIDByBlockNumber indicates an expected call of GetSetIDByBlockNumber. +func (mr *MockGrandpaStateMockRecorder) GetSetIDByBlockNumber(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSetIDByBlockNumber", reflect.TypeOf((*MockGrandpaState)(nil).GetSetIDByBlockNumber), arg0) +} + +// SetLatestRound mocks base method. +func (m *MockGrandpaState) SetLatestRound(arg0 uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetLatestRound", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetLatestRound indicates an expected call of SetLatestRound. +func (mr *MockGrandpaStateMockRecorder) SetLatestRound(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetLatestRound", reflect.TypeOf((*MockGrandpaState)(nil).SetLatestRound), arg0) +} + +// SetPrecommits mocks base method. +func (m *MockGrandpaState) SetPrecommits(arg0, arg1 uint64, arg2 []types.GrandpaSignedVote) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetPrecommits", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetPrecommits indicates an expected call of SetPrecommits. +func (mr *MockGrandpaStateMockRecorder) SetPrecommits(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPrecommits", reflect.TypeOf((*MockGrandpaState)(nil).SetPrecommits), arg0, arg1, arg2) +} + +// SetPrevotes mocks base method. +func (m *MockGrandpaState) SetPrevotes(arg0, arg1 uint64, arg2 []types.GrandpaSignedVote) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetPrevotes", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetPrevotes indicates an expected call of SetPrevotes. +func (mr *MockGrandpaStateMockRecorder) SetPrevotes(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetPrevotes", reflect.TypeOf((*MockGrandpaState)(nil).SetPrevotes), arg0, arg1, arg2) +}