github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/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  // RevokeAccountKey provides a mock function with given fields: runtimeAddress, keyIndex
    47  func (_m *AccountKeyUpdater) RevokeAccountKey(runtimeAddress common.Address, keyIndex int) (*stdlib.AccountKey, error) {
    48  	ret := _m.Called(runtimeAddress, keyIndex)
    49  
    50  	var r0 *stdlib.AccountKey
    51  	var r1 error
    52  	if rf, ok := ret.Get(0).(func(common.Address, int) (*stdlib.AccountKey, error)); ok {
    53  		return rf(runtimeAddress, keyIndex)
    54  	}
    55  	if rf, ok := ret.Get(0).(func(common.Address, int) *stdlib.AccountKey); ok {
    56  		r0 = rf(runtimeAddress, keyIndex)
    57  	} else {
    58  		if ret.Get(0) != nil {
    59  			r0 = ret.Get(0).(*stdlib.AccountKey)
    60  		}
    61  	}
    62  
    63  	if rf, ok := ret.Get(1).(func(common.Address, int) error); ok {
    64  		r1 = rf(runtimeAddress, keyIndex)
    65  	} else {
    66  		r1 = ret.Error(1)
    67  	}
    68  
    69  	return r0, r1
    70  }
    71  
    72  type mockConstructorTestingTNewAccountKeyUpdater interface {
    73  	mock.TestingT
    74  	Cleanup(func())
    75  }
    76  
    77  // 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.
    78  func NewAccountKeyUpdater(t mockConstructorTestingTNewAccountKeyUpdater) *AccountKeyUpdater {
    79  	mock := &AccountKeyUpdater{}
    80  	mock.Mock.Test(t)
    81  
    82  	t.Cleanup(func() { mock.AssertExpectations(t) })
    83  
    84  	return mock
    85  }