github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/id_translator.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mockp2p
     4  
     5  import (
     6  	flow "github.com/onflow/flow-go/model/flow"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	peer "github.com/libp2p/go-libp2p/core/peer"
    10  )
    11  
    12  // IDTranslator is an autogenerated mock type for the IDTranslator type
    13  type IDTranslator struct {
    14  	mock.Mock
    15  }
    16  
    17  // GetFlowID provides a mock function with given fields: _a0
    18  func (_m *IDTranslator) GetFlowID(_a0 peer.ID) (flow.Identifier, error) {
    19  	ret := _m.Called(_a0)
    20  
    21  	var r0 flow.Identifier
    22  	var r1 error
    23  	if rf, ok := ret.Get(0).(func(peer.ID) (flow.Identifier, error)); ok {
    24  		return rf(_a0)
    25  	}
    26  	if rf, ok := ret.Get(0).(func(peer.ID) flow.Identifier); ok {
    27  		r0 = rf(_a0)
    28  	} else {
    29  		if ret.Get(0) != nil {
    30  			r0 = ret.Get(0).(flow.Identifier)
    31  		}
    32  	}
    33  
    34  	if rf, ok := ret.Get(1).(func(peer.ID) error); ok {
    35  		r1 = rf(_a0)
    36  	} else {
    37  		r1 = ret.Error(1)
    38  	}
    39  
    40  	return r0, r1
    41  }
    42  
    43  // GetPeerID provides a mock function with given fields: _a0
    44  func (_m *IDTranslator) GetPeerID(_a0 flow.Identifier) (peer.ID, error) {
    45  	ret := _m.Called(_a0)
    46  
    47  	var r0 peer.ID
    48  	var r1 error
    49  	if rf, ok := ret.Get(0).(func(flow.Identifier) (peer.ID, error)); ok {
    50  		return rf(_a0)
    51  	}
    52  	if rf, ok := ret.Get(0).(func(flow.Identifier) peer.ID); ok {
    53  		r0 = rf(_a0)
    54  	} else {
    55  		r0 = ret.Get(0).(peer.ID)
    56  	}
    57  
    58  	if rf, ok := ret.Get(1).(func(flow.Identifier) error); ok {
    59  		r1 = rf(_a0)
    60  	} else {
    61  		r1 = ret.Error(1)
    62  	}
    63  
    64  	return r0, r1
    65  }
    66  
    67  type mockConstructorTestingTNewIDTranslator interface {
    68  	mock.TestingT
    69  	Cleanup(func())
    70  }
    71  
    72  // NewIDTranslator creates a new instance of IDTranslator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    73  func NewIDTranslator(t mockConstructorTestingTNewIDTranslator) *IDTranslator {
    74  	mock := &IDTranslator{}
    75  	mock.Mock.Test(t)
    76  
    77  	t.Cleanup(func() { mock.AssertExpectations(t) })
    78  
    79  	return mock
    80  }