github.com/onflow/flow-go@v0.33.17/fvm/environment/mock/account_key_updater.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 common "github.com/onflow/cadence/runtime/common" 7 8 mock "github.com/stretchr/testify/mock" 9 10 sema "github.com/onflow/cadence/runtime/sema" 11 12 stdlib "github.com/onflow/cadence/runtime/stdlib" 13 ) 14 15 // AccountKeyUpdater is an autogenerated mock type for the AccountKeyUpdater type 16 type AccountKeyUpdater struct { 17 mock.Mock 18 } 19 20 // AddAccountKey provides a mock function with given fields: runtimeAddress, publicKey, hashAlgo, weight 21 func (_m *AccountKeyUpdater) AddAccountKey(runtimeAddress common.Address, publicKey *stdlib.PublicKey, hashAlgo sema.HashAlgorithm, weight int) (*stdlib.AccountKey, error) { 22 ret := _m.Called(runtimeAddress, publicKey, hashAlgo, weight) 23 24 var r0 *stdlib.AccountKey 25 var r1 error 26 if rf, ok := ret.Get(0).(func(common.Address, *stdlib.PublicKey, sema.HashAlgorithm, int) (*stdlib.AccountKey, error)); ok { 27 return rf(runtimeAddress, publicKey, hashAlgo, weight) 28 } 29 if rf, ok := ret.Get(0).(func(common.Address, *stdlib.PublicKey, sema.HashAlgorithm, int) *stdlib.AccountKey); ok { 30 r0 = rf(runtimeAddress, publicKey, hashAlgo, weight) 31 } else { 32 if ret.Get(0) != nil { 33 r0 = ret.Get(0).(*stdlib.AccountKey) 34 } 35 } 36 37 if rf, ok := ret.Get(1).(func(common.Address, *stdlib.PublicKey, sema.HashAlgorithm, int) error); ok { 38 r1 = rf(runtimeAddress, publicKey, hashAlgo, weight) 39 } else { 40 r1 = ret.Error(1) 41 } 42 43 return r0, r1 44 } 45 46 // AddEncodedAccountKey provides a mock function with given fields: runtimeAddress, publicKey 47 func (_m *AccountKeyUpdater) AddEncodedAccountKey(runtimeAddress common.Address, publicKey []byte) error { 48 ret := _m.Called(runtimeAddress, publicKey) 49 50 var r0 error 51 if rf, ok := ret.Get(0).(func(common.Address, []byte) error); ok { 52 r0 = rf(runtimeAddress, publicKey) 53 } else { 54 r0 = ret.Error(0) 55 } 56 57 return r0 58 } 59 60 // RevokeAccountKey provides a mock function with given fields: runtimeAddress, keyIndex 61 func (_m *AccountKeyUpdater) RevokeAccountKey(runtimeAddress common.Address, keyIndex int) (*stdlib.AccountKey, error) { 62 ret := _m.Called(runtimeAddress, keyIndex) 63 64 var r0 *stdlib.AccountKey 65 var r1 error 66 if rf, ok := ret.Get(0).(func(common.Address, int) (*stdlib.AccountKey, error)); ok { 67 return rf(runtimeAddress, keyIndex) 68 } 69 if rf, ok := ret.Get(0).(func(common.Address, int) *stdlib.AccountKey); ok { 70 r0 = rf(runtimeAddress, keyIndex) 71 } else { 72 if ret.Get(0) != nil { 73 r0 = ret.Get(0).(*stdlib.AccountKey) 74 } 75 } 76 77 if rf, ok := ret.Get(1).(func(common.Address, int) error); ok { 78 r1 = rf(runtimeAddress, keyIndex) 79 } else { 80 r1 = ret.Error(1) 81 } 82 83 return r0, r1 84 } 85 86 // RevokeEncodedAccountKey provides a mock function with given fields: runtimeAddress, index 87 func (_m *AccountKeyUpdater) RevokeEncodedAccountKey(runtimeAddress common.Address, index int) ([]byte, error) { 88 ret := _m.Called(runtimeAddress, index) 89 90 var r0 []byte 91 var r1 error 92 if rf, ok := ret.Get(0).(func(common.Address, int) ([]byte, error)); ok { 93 return rf(runtimeAddress, index) 94 } 95 if rf, ok := ret.Get(0).(func(common.Address, int) []byte); ok { 96 r0 = rf(runtimeAddress, index) 97 } else { 98 if ret.Get(0) != nil { 99 r0 = ret.Get(0).([]byte) 100 } 101 } 102 103 if rf, ok := ret.Get(1).(func(common.Address, int) error); ok { 104 r1 = rf(runtimeAddress, index) 105 } else { 106 r1 = ret.Error(1) 107 } 108 109 return r0, r1 110 } 111 112 type mockConstructorTestingTNewAccountKeyUpdater interface { 113 mock.TestingT 114 Cleanup(func()) 115 } 116 117 // NewAccountKeyUpdater creates a new instance of AccountKeyUpdater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 118 func NewAccountKeyUpdater(t mockConstructorTestingTNewAccountKeyUpdater) *AccountKeyUpdater { 119 mock := &AccountKeyUpdater{} 120 mock.Mock.Test(t) 121 122 t.Cleanup(func() { mock.AssertExpectations(t) }) 123 124 return mock 125 }