github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/mocks/dynamic_committee.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	hotstuff "github.com/onflow/flow-go/consensus/hotstuff"
     7  	flow "github.com/onflow/flow-go/model/flow"
     8  
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // DynamicCommittee is an autogenerated mock type for the DynamicCommittee type
    13  type DynamicCommittee struct {
    14  	mock.Mock
    15  }
    16  
    17  // DKG provides a mock function with given fields: view
    18  func (_m *DynamicCommittee) DKG(view uint64) (hotstuff.DKG, error) {
    19  	ret := _m.Called(view)
    20  
    21  	var r0 hotstuff.DKG
    22  	var r1 error
    23  	if rf, ok := ret.Get(0).(func(uint64) (hotstuff.DKG, error)); ok {
    24  		return rf(view)
    25  	}
    26  	if rf, ok := ret.Get(0).(func(uint64) hotstuff.DKG); ok {
    27  		r0 = rf(view)
    28  	} else {
    29  		if ret.Get(0) != nil {
    30  			r0 = ret.Get(0).(hotstuff.DKG)
    31  		}
    32  	}
    33  
    34  	if rf, ok := ret.Get(1).(func(uint64) error); ok {
    35  		r1 = rf(view)
    36  	} else {
    37  		r1 = ret.Error(1)
    38  	}
    39  
    40  	return r0, r1
    41  }
    42  
    43  // IdentitiesByBlock provides a mock function with given fields: blockID
    44  func (_m *DynamicCommittee) IdentitiesByBlock(blockID flow.Identifier) (flow.GenericIdentityList[flow.Identity], error) {
    45  	ret := _m.Called(blockID)
    46  
    47  	var r0 flow.GenericIdentityList[flow.Identity]
    48  	var r1 error
    49  	if rf, ok := ret.Get(0).(func(flow.Identifier) (flow.GenericIdentityList[flow.Identity], error)); ok {
    50  		return rf(blockID)
    51  	}
    52  	if rf, ok := ret.Get(0).(func(flow.Identifier) flow.GenericIdentityList[flow.Identity]); ok {
    53  		r0 = rf(blockID)
    54  	} else {
    55  		if ret.Get(0) != nil {
    56  			r0 = ret.Get(0).(flow.GenericIdentityList[flow.Identity])
    57  		}
    58  	}
    59  
    60  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    61  		r1 = rf(blockID)
    62  	} else {
    63  		r1 = ret.Error(1)
    64  	}
    65  
    66  	return r0, r1
    67  }
    68  
    69  // IdentitiesByEpoch provides a mock function with given fields: view
    70  func (_m *DynamicCommittee) IdentitiesByEpoch(view uint64) (flow.GenericIdentityList[flow.IdentitySkeleton], error) {
    71  	ret := _m.Called(view)
    72  
    73  	var r0 flow.GenericIdentityList[flow.IdentitySkeleton]
    74  	var r1 error
    75  	if rf, ok := ret.Get(0).(func(uint64) (flow.GenericIdentityList[flow.IdentitySkeleton], error)); ok {
    76  		return rf(view)
    77  	}
    78  	if rf, ok := ret.Get(0).(func(uint64) flow.GenericIdentityList[flow.IdentitySkeleton]); ok {
    79  		r0 = rf(view)
    80  	} else {
    81  		if ret.Get(0) != nil {
    82  			r0 = ret.Get(0).(flow.GenericIdentityList[flow.IdentitySkeleton])
    83  		}
    84  	}
    85  
    86  	if rf, ok := ret.Get(1).(func(uint64) error); ok {
    87  		r1 = rf(view)
    88  	} else {
    89  		r1 = ret.Error(1)
    90  	}
    91  
    92  	return r0, r1
    93  }
    94  
    95  // IdentityByBlock provides a mock function with given fields: blockID, participantID
    96  func (_m *DynamicCommittee) IdentityByBlock(blockID flow.Identifier, participantID flow.Identifier) (*flow.Identity, error) {
    97  	ret := _m.Called(blockID, participantID)
    98  
    99  	var r0 *flow.Identity
   100  	var r1 error
   101  	if rf, ok := ret.Get(0).(func(flow.Identifier, flow.Identifier) (*flow.Identity, error)); ok {
   102  		return rf(blockID, participantID)
   103  	}
   104  	if rf, ok := ret.Get(0).(func(flow.Identifier, flow.Identifier) *flow.Identity); ok {
   105  		r0 = rf(blockID, participantID)
   106  	} else {
   107  		if ret.Get(0) != nil {
   108  			r0 = ret.Get(0).(*flow.Identity)
   109  		}
   110  	}
   111  
   112  	if rf, ok := ret.Get(1).(func(flow.Identifier, flow.Identifier) error); ok {
   113  		r1 = rf(blockID, participantID)
   114  	} else {
   115  		r1 = ret.Error(1)
   116  	}
   117  
   118  	return r0, r1
   119  }
   120  
   121  // IdentityByEpoch provides a mock function with given fields: view, participantID
   122  func (_m *DynamicCommittee) IdentityByEpoch(view uint64, participantID flow.Identifier) (*flow.IdentitySkeleton, error) {
   123  	ret := _m.Called(view, participantID)
   124  
   125  	var r0 *flow.IdentitySkeleton
   126  	var r1 error
   127  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) (*flow.IdentitySkeleton, error)); ok {
   128  		return rf(view, participantID)
   129  	}
   130  	if rf, ok := ret.Get(0).(func(uint64, flow.Identifier) *flow.IdentitySkeleton); ok {
   131  		r0 = rf(view, participantID)
   132  	} else {
   133  		if ret.Get(0) != nil {
   134  			r0 = ret.Get(0).(*flow.IdentitySkeleton)
   135  		}
   136  	}
   137  
   138  	if rf, ok := ret.Get(1).(func(uint64, flow.Identifier) error); ok {
   139  		r1 = rf(view, participantID)
   140  	} else {
   141  		r1 = ret.Error(1)
   142  	}
   143  
   144  	return r0, r1
   145  }
   146  
   147  // LeaderForView provides a mock function with given fields: view
   148  func (_m *DynamicCommittee) LeaderForView(view uint64) (flow.Identifier, error) {
   149  	ret := _m.Called(view)
   150  
   151  	var r0 flow.Identifier
   152  	var r1 error
   153  	if rf, ok := ret.Get(0).(func(uint64) (flow.Identifier, error)); ok {
   154  		return rf(view)
   155  	}
   156  	if rf, ok := ret.Get(0).(func(uint64) flow.Identifier); ok {
   157  		r0 = rf(view)
   158  	} else {
   159  		if ret.Get(0) != nil {
   160  			r0 = ret.Get(0).(flow.Identifier)
   161  		}
   162  	}
   163  
   164  	if rf, ok := ret.Get(1).(func(uint64) error); ok {
   165  		r1 = rf(view)
   166  	} else {
   167  		r1 = ret.Error(1)
   168  	}
   169  
   170  	return r0, r1
   171  }
   172  
   173  // QuorumThresholdForView provides a mock function with given fields: view
   174  func (_m *DynamicCommittee) QuorumThresholdForView(view uint64) (uint64, error) {
   175  	ret := _m.Called(view)
   176  
   177  	var r0 uint64
   178  	var r1 error
   179  	if rf, ok := ret.Get(0).(func(uint64) (uint64, error)); ok {
   180  		return rf(view)
   181  	}
   182  	if rf, ok := ret.Get(0).(func(uint64) uint64); ok {
   183  		r0 = rf(view)
   184  	} else {
   185  		r0 = ret.Get(0).(uint64)
   186  	}
   187  
   188  	if rf, ok := ret.Get(1).(func(uint64) error); ok {
   189  		r1 = rf(view)
   190  	} else {
   191  		r1 = ret.Error(1)
   192  	}
   193  
   194  	return r0, r1
   195  }
   196  
   197  // Self provides a mock function with given fields:
   198  func (_m *DynamicCommittee) Self() flow.Identifier {
   199  	ret := _m.Called()
   200  
   201  	var r0 flow.Identifier
   202  	if rf, ok := ret.Get(0).(func() flow.Identifier); ok {
   203  		r0 = rf()
   204  	} else {
   205  		if ret.Get(0) != nil {
   206  			r0 = ret.Get(0).(flow.Identifier)
   207  		}
   208  	}
   209  
   210  	return r0
   211  }
   212  
   213  // TimeoutThresholdForView provides a mock function with given fields: view
   214  func (_m *DynamicCommittee) TimeoutThresholdForView(view uint64) (uint64, error) {
   215  	ret := _m.Called(view)
   216  
   217  	var r0 uint64
   218  	var r1 error
   219  	if rf, ok := ret.Get(0).(func(uint64) (uint64, error)); ok {
   220  		return rf(view)
   221  	}
   222  	if rf, ok := ret.Get(0).(func(uint64) uint64); ok {
   223  		r0 = rf(view)
   224  	} else {
   225  		r0 = ret.Get(0).(uint64)
   226  	}
   227  
   228  	if rf, ok := ret.Get(1).(func(uint64) error); ok {
   229  		r1 = rf(view)
   230  	} else {
   231  		r1 = ret.Error(1)
   232  	}
   233  
   234  	return r0, r1
   235  }
   236  
   237  type mockConstructorTestingTNewDynamicCommittee interface {
   238  	mock.TestingT
   239  	Cleanup(func())
   240  }
   241  
   242  // NewDynamicCommittee creates a new instance of DynamicCommittee. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   243  func NewDynamicCommittee(t mockConstructorTestingTNewDynamicCommittee) *DynamicCommittee {
   244  	mock := &DynamicCommittee{}
   245  	mock.Mock.Test(t)
   246  
   247  	t.Cleanup(func() { mock.AssertExpectations(t) })
   248  
   249  	return mock
   250  }