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

     1  // Code generated by mockery v2.13.1. 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: address, publicKey, hashAlgo, weight
    21  func (_m *AccountKeyUpdater) AddAccountKey(address common.Address, publicKey *stdlib.PublicKey, hashAlgo sema.HashAlgorithm, weight int) (*stdlib.AccountKey, error) {
    22  	ret := _m.Called(address, publicKey, hashAlgo, weight)
    23  
    24  	var r0 *stdlib.AccountKey
    25  	if rf, ok := ret.Get(0).(func(common.Address, *stdlib.PublicKey, sema.HashAlgorithm, int) *stdlib.AccountKey); ok {
    26  		r0 = rf(address, publicKey, hashAlgo, weight)
    27  	} else {
    28  		if ret.Get(0) != nil {
    29  			r0 = ret.Get(0).(*stdlib.AccountKey)
    30  		}
    31  	}
    32  
    33  	var r1 error
    34  	if rf, ok := ret.Get(1).(func(common.Address, *stdlib.PublicKey, sema.HashAlgorithm, int) error); ok {
    35  		r1 = rf(address, publicKey, hashAlgo, weight)
    36  	} else {
    37  		r1 = ret.Error(1)
    38  	}
    39  
    40  	return r0, r1
    41  }
    42  
    43  // AddEncodedAccountKey provides a mock function with given fields: address, publicKey
    44  func (_m *AccountKeyUpdater) AddEncodedAccountKey(address common.Address, publicKey []byte) error {
    45  	ret := _m.Called(address, publicKey)
    46  
    47  	var r0 error
    48  	if rf, ok := ret.Get(0).(func(common.Address, []byte) error); ok {
    49  		r0 = rf(address, publicKey)
    50  	} else {
    51  		r0 = ret.Error(0)
    52  	}
    53  
    54  	return r0
    55  }
    56  
    57  // RevokeAccountKey provides a mock function with given fields: address, keyIndex
    58  func (_m *AccountKeyUpdater) RevokeAccountKey(address common.Address, keyIndex int) (*stdlib.AccountKey, error) {
    59  	ret := _m.Called(address, keyIndex)
    60  
    61  	var r0 *stdlib.AccountKey
    62  	if rf, ok := ret.Get(0).(func(common.Address, int) *stdlib.AccountKey); ok {
    63  		r0 = rf(address, keyIndex)
    64  	} else {
    65  		if ret.Get(0) != nil {
    66  			r0 = ret.Get(0).(*stdlib.AccountKey)
    67  		}
    68  	}
    69  
    70  	var r1 error
    71  	if rf, ok := ret.Get(1).(func(common.Address, int) error); ok {
    72  		r1 = rf(address, keyIndex)
    73  	} else {
    74  		r1 = ret.Error(1)
    75  	}
    76  
    77  	return r0, r1
    78  }
    79  
    80  // RevokeEncodedAccountKey provides a mock function with given fields: address, index
    81  func (_m *AccountKeyUpdater) RevokeEncodedAccountKey(address common.Address, index int) ([]byte, error) {
    82  	ret := _m.Called(address, index)
    83  
    84  	var r0 []byte
    85  	if rf, ok := ret.Get(0).(func(common.Address, int) []byte); ok {
    86  		r0 = rf(address, index)
    87  	} else {
    88  		if ret.Get(0) != nil {
    89  			r0 = ret.Get(0).([]byte)
    90  		}
    91  	}
    92  
    93  	var r1 error
    94  	if rf, ok := ret.Get(1).(func(common.Address, int) error); ok {
    95  		r1 = rf(address, index)
    96  	} else {
    97  		r1 = ret.Error(1)
    98  	}
    99  
   100  	return r0, r1
   101  }
   102  
   103  type mockConstructorTestingTNewAccountKeyUpdater interface {
   104  	mock.TestingT
   105  	Cleanup(func())
   106  }
   107  
   108  // 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.
   109  func NewAccountKeyUpdater(t mockConstructorTestingTNewAccountKeyUpdater) *AccountKeyUpdater {
   110  	mock := &AccountKeyUpdater{}
   111  	mock.Mock.Test(t)
   112  
   113  	t.Cleanup(func() { mock.AssertExpectations(t) })
   114  
   115  	return mock
   116  }