github.com/koko1123/flow-go-1@v0.29.6/fvm/environment/mock/crypto_library.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mock
     4  
     5  import (
     6  	sema "github.com/onflow/cadence/runtime/sema"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	stdlib "github.com/onflow/cadence/runtime/stdlib"
    10  )
    11  
    12  // CryptoLibrary is an autogenerated mock type for the CryptoLibrary type
    13  type CryptoLibrary struct {
    14  	mock.Mock
    15  }
    16  
    17  // BLSAggregatePublicKeys provides a mock function with given fields: keys
    18  func (_m *CryptoLibrary) BLSAggregatePublicKeys(keys []*stdlib.PublicKey) (*stdlib.PublicKey, error) {
    19  	ret := _m.Called(keys)
    20  
    21  	var r0 *stdlib.PublicKey
    22  	if rf, ok := ret.Get(0).(func([]*stdlib.PublicKey) *stdlib.PublicKey); ok {
    23  		r0 = rf(keys)
    24  	} else {
    25  		if ret.Get(0) != nil {
    26  			r0 = ret.Get(0).(*stdlib.PublicKey)
    27  		}
    28  	}
    29  
    30  	var r1 error
    31  	if rf, ok := ret.Get(1).(func([]*stdlib.PublicKey) error); ok {
    32  		r1 = rf(keys)
    33  	} else {
    34  		r1 = ret.Error(1)
    35  	}
    36  
    37  	return r0, r1
    38  }
    39  
    40  // BLSAggregateSignatures provides a mock function with given fields: sigs
    41  func (_m *CryptoLibrary) BLSAggregateSignatures(sigs [][]byte) ([]byte, error) {
    42  	ret := _m.Called(sigs)
    43  
    44  	var r0 []byte
    45  	if rf, ok := ret.Get(0).(func([][]byte) []byte); ok {
    46  		r0 = rf(sigs)
    47  	} else {
    48  		if ret.Get(0) != nil {
    49  			r0 = ret.Get(0).([]byte)
    50  		}
    51  	}
    52  
    53  	var r1 error
    54  	if rf, ok := ret.Get(1).(func([][]byte) error); ok {
    55  		r1 = rf(sigs)
    56  	} else {
    57  		r1 = ret.Error(1)
    58  	}
    59  
    60  	return r0, r1
    61  }
    62  
    63  // BLSVerifyPOP provides a mock function with given fields: pk, sig
    64  func (_m *CryptoLibrary) BLSVerifyPOP(pk *stdlib.PublicKey, sig []byte) (bool, error) {
    65  	ret := _m.Called(pk, sig)
    66  
    67  	var r0 bool
    68  	if rf, ok := ret.Get(0).(func(*stdlib.PublicKey, []byte) bool); ok {
    69  		r0 = rf(pk, sig)
    70  	} else {
    71  		r0 = ret.Get(0).(bool)
    72  	}
    73  
    74  	var r1 error
    75  	if rf, ok := ret.Get(1).(func(*stdlib.PublicKey, []byte) error); ok {
    76  		r1 = rf(pk, sig)
    77  	} else {
    78  		r1 = ret.Error(1)
    79  	}
    80  
    81  	return r0, r1
    82  }
    83  
    84  // Hash provides a mock function with given fields: data, tag, hashAlgorithm
    85  func (_m *CryptoLibrary) Hash(data []byte, tag string, hashAlgorithm sema.HashAlgorithm) ([]byte, error) {
    86  	ret := _m.Called(data, tag, hashAlgorithm)
    87  
    88  	var r0 []byte
    89  	if rf, ok := ret.Get(0).(func([]byte, string, sema.HashAlgorithm) []byte); ok {
    90  		r0 = rf(data, tag, hashAlgorithm)
    91  	} else {
    92  		if ret.Get(0) != nil {
    93  			r0 = ret.Get(0).([]byte)
    94  		}
    95  	}
    96  
    97  	var r1 error
    98  	if rf, ok := ret.Get(1).(func([]byte, string, sema.HashAlgorithm) error); ok {
    99  		r1 = rf(data, tag, hashAlgorithm)
   100  	} else {
   101  		r1 = ret.Error(1)
   102  	}
   103  
   104  	return r0, r1
   105  }
   106  
   107  // ValidatePublicKey provides a mock function with given fields: pk
   108  func (_m *CryptoLibrary) ValidatePublicKey(pk *stdlib.PublicKey) error {
   109  	ret := _m.Called(pk)
   110  
   111  	var r0 error
   112  	if rf, ok := ret.Get(0).(func(*stdlib.PublicKey) error); ok {
   113  		r0 = rf(pk)
   114  	} else {
   115  		r0 = ret.Error(0)
   116  	}
   117  
   118  	return r0
   119  }
   120  
   121  // VerifySignature provides a mock function with given fields: signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm
   122  func (_m *CryptoLibrary) VerifySignature(signature []byte, tag string, signedData []byte, publicKey []byte, signatureAlgorithm sema.SignatureAlgorithm, hashAlgorithm sema.HashAlgorithm) (bool, error) {
   123  	ret := _m.Called(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm)
   124  
   125  	var r0 bool
   126  	if rf, ok := ret.Get(0).(func([]byte, string, []byte, []byte, sema.SignatureAlgorithm, sema.HashAlgorithm) bool); ok {
   127  		r0 = rf(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm)
   128  	} else {
   129  		r0 = ret.Get(0).(bool)
   130  	}
   131  
   132  	var r1 error
   133  	if rf, ok := ret.Get(1).(func([]byte, string, []byte, []byte, sema.SignatureAlgorithm, sema.HashAlgorithm) error); ok {
   134  		r1 = rf(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm)
   135  	} else {
   136  		r1 = ret.Error(1)
   137  	}
   138  
   139  	return r0, r1
   140  }
   141  
   142  type mockConstructorTestingTNewCryptoLibrary interface {
   143  	mock.TestingT
   144  	Cleanup(func())
   145  }
   146  
   147  // NewCryptoLibrary creates a new instance of CryptoLibrary. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   148  func NewCryptoLibrary(t mockConstructorTestingTNewCryptoLibrary) *CryptoLibrary {
   149  	mock := &CryptoLibrary{}
   150  	mock.Mock.Test(t)
   151  
   152  	t.Cleanup(func() { mock.AssertExpectations(t) })
   153  
   154  	return mock
   155  }