github.com/koko1123/flow-go-1@v0.29.6/consensus/hotstuff/mocks/packer.go (about)

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