github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/fvm/environment/mock/crypto_library.go (about) 1 // Code generated by mockery v2.21.4. 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 var r1 error 23 if rf, ok := ret.Get(0).(func([]*stdlib.PublicKey) (*stdlib.PublicKey, error)); ok { 24 return rf(keys) 25 } 26 if rf, ok := ret.Get(0).(func([]*stdlib.PublicKey) *stdlib.PublicKey); ok { 27 r0 = rf(keys) 28 } else { 29 if ret.Get(0) != nil { 30 r0 = ret.Get(0).(*stdlib.PublicKey) 31 } 32 } 33 34 if rf, ok := ret.Get(1).(func([]*stdlib.PublicKey) error); ok { 35 r1 = rf(keys) 36 } else { 37 r1 = ret.Error(1) 38 } 39 40 return r0, r1 41 } 42 43 // BLSAggregateSignatures provides a mock function with given fields: sigs 44 func (_m *CryptoLibrary) BLSAggregateSignatures(sigs [][]byte) ([]byte, error) { 45 ret := _m.Called(sigs) 46 47 var r0 []byte 48 var r1 error 49 if rf, ok := ret.Get(0).(func([][]byte) ([]byte, error)); ok { 50 return rf(sigs) 51 } 52 if rf, ok := ret.Get(0).(func([][]byte) []byte); ok { 53 r0 = rf(sigs) 54 } else { 55 if ret.Get(0) != nil { 56 r0 = ret.Get(0).([]byte) 57 } 58 } 59 60 if rf, ok := ret.Get(1).(func([][]byte) error); ok { 61 r1 = rf(sigs) 62 } else { 63 r1 = ret.Error(1) 64 } 65 66 return r0, r1 67 } 68 69 // BLSVerifyPOP provides a mock function with given fields: pk, sig 70 func (_m *CryptoLibrary) BLSVerifyPOP(pk *stdlib.PublicKey, sig []byte) (bool, error) { 71 ret := _m.Called(pk, sig) 72 73 var r0 bool 74 var r1 error 75 if rf, ok := ret.Get(0).(func(*stdlib.PublicKey, []byte) (bool, error)); ok { 76 return rf(pk, sig) 77 } 78 if rf, ok := ret.Get(0).(func(*stdlib.PublicKey, []byte) bool); ok { 79 r0 = rf(pk, sig) 80 } else { 81 r0 = ret.Get(0).(bool) 82 } 83 84 if rf, ok := ret.Get(1).(func(*stdlib.PublicKey, []byte) error); ok { 85 r1 = rf(pk, sig) 86 } else { 87 r1 = ret.Error(1) 88 } 89 90 return r0, r1 91 } 92 93 // Hash provides a mock function with given fields: data, tag, hashAlgorithm 94 func (_m *CryptoLibrary) Hash(data []byte, tag string, hashAlgorithm sema.HashAlgorithm) ([]byte, error) { 95 ret := _m.Called(data, tag, hashAlgorithm) 96 97 var r0 []byte 98 var r1 error 99 if rf, ok := ret.Get(0).(func([]byte, string, sema.HashAlgorithm) ([]byte, error)); ok { 100 return rf(data, tag, hashAlgorithm) 101 } 102 if rf, ok := ret.Get(0).(func([]byte, string, sema.HashAlgorithm) []byte); ok { 103 r0 = rf(data, tag, hashAlgorithm) 104 } else { 105 if ret.Get(0) != nil { 106 r0 = ret.Get(0).([]byte) 107 } 108 } 109 110 if rf, ok := ret.Get(1).(func([]byte, string, sema.HashAlgorithm) error); ok { 111 r1 = rf(data, tag, hashAlgorithm) 112 } else { 113 r1 = ret.Error(1) 114 } 115 116 return r0, r1 117 } 118 119 // ValidatePublicKey provides a mock function with given fields: pk 120 func (_m *CryptoLibrary) ValidatePublicKey(pk *stdlib.PublicKey) error { 121 ret := _m.Called(pk) 122 123 var r0 error 124 if rf, ok := ret.Get(0).(func(*stdlib.PublicKey) error); ok { 125 r0 = rf(pk) 126 } else { 127 r0 = ret.Error(0) 128 } 129 130 return r0 131 } 132 133 // VerifySignature provides a mock function with given fields: signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm 134 func (_m *CryptoLibrary) VerifySignature(signature []byte, tag string, signedData []byte, publicKey []byte, signatureAlgorithm sema.SignatureAlgorithm, hashAlgorithm sema.HashAlgorithm) (bool, error) { 135 ret := _m.Called(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm) 136 137 var r0 bool 138 var r1 error 139 if rf, ok := ret.Get(0).(func([]byte, string, []byte, []byte, sema.SignatureAlgorithm, sema.HashAlgorithm) (bool, error)); ok { 140 return rf(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm) 141 } 142 if rf, ok := ret.Get(0).(func([]byte, string, []byte, []byte, sema.SignatureAlgorithm, sema.HashAlgorithm) bool); ok { 143 r0 = rf(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm) 144 } else { 145 r0 = ret.Get(0).(bool) 146 } 147 148 if rf, ok := ret.Get(1).(func([]byte, string, []byte, []byte, sema.SignatureAlgorithm, sema.HashAlgorithm) error); ok { 149 r1 = rf(signature, tag, signedData, publicKey, signatureAlgorithm, hashAlgorithm) 150 } else { 151 r1 = ret.Error(1) 152 } 153 154 return r0, r1 155 } 156 157 type mockConstructorTestingTNewCryptoLibrary interface { 158 mock.TestingT 159 Cleanup(func()) 160 } 161 162 // 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. 163 func NewCryptoLibrary(t mockConstructorTestingTNewCryptoLibrary) *CryptoLibrary { 164 mock := &CryptoLibrary{} 165 mock.Mock.Test(t) 166 167 t.Cleanup(func() { mock.AssertExpectations(t) }) 168 169 return mock 170 }