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