-
Notifications
You must be signed in to change notification settings - Fork 204
/
authz_keeper.go
200 lines (161 loc) · 7.25 KB
/
authz_keeper.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// Code generated by mockery v2.42.0. DO NOT EDIT.
package mocks
import (
authz "github.com/cosmos/cosmos-sdk/x/authz"
mock "github.com/stretchr/testify/mock"
time "time"
types "github.com/cosmos/cosmos-sdk/types"
)
// AuthzKeeper is an autogenerated mock type for the AuthzKeeper type
type AuthzKeeper struct {
mock.Mock
}
type AuthzKeeper_Expecter struct {
mock *mock.Mock
}
func (_m *AuthzKeeper) EXPECT() *AuthzKeeper_Expecter {
return &AuthzKeeper_Expecter{mock: &_m.Mock}
}
// DeleteGrant provides a mock function with given fields: ctx, grantee, granter, msgType
func (_m *AuthzKeeper) DeleteGrant(ctx types.Context, grantee types.AccAddress, granter types.AccAddress, msgType string) error {
ret := _m.Called(ctx, grantee, granter, msgType)
if len(ret) == 0 {
panic("no return value specified for DeleteGrant")
}
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, string) error); ok {
r0 = rf(ctx, grantee, granter, msgType)
} else {
r0 = ret.Error(0)
}
return r0
}
// AuthzKeeper_DeleteGrant_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteGrant'
type AuthzKeeper_DeleteGrant_Call struct {
*mock.Call
}
// DeleteGrant is a helper method to define mock.On call
// - ctx types.Context
// - grantee types.AccAddress
// - granter types.AccAddress
// - msgType string
func (_e *AuthzKeeper_Expecter) DeleteGrant(ctx interface{}, grantee interface{}, granter interface{}, msgType interface{}) *AuthzKeeper_DeleteGrant_Call {
return &AuthzKeeper_DeleteGrant_Call{Call: _e.mock.On("DeleteGrant", ctx, grantee, granter, msgType)}
}
func (_c *AuthzKeeper_DeleteGrant_Call) Run(run func(ctx types.Context, grantee types.AccAddress, granter types.AccAddress, msgType string)) *AuthzKeeper_DeleteGrant_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(types.AccAddress), args[3].(string))
})
return _c
}
func (_c *AuthzKeeper_DeleteGrant_Call) Return(_a0 error) *AuthzKeeper_DeleteGrant_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *AuthzKeeper_DeleteGrant_Call) RunAndReturn(run func(types.Context, types.AccAddress, types.AccAddress, string) error) *AuthzKeeper_DeleteGrant_Call {
_c.Call.Return(run)
return _c
}
// GetCleanAuthorization provides a mock function with given fields: ctx, grantee, granter, msgType
func (_m *AuthzKeeper) GetCleanAuthorization(ctx types.Context, grantee types.AccAddress, granter types.AccAddress, msgType string) (authz.Authorization, time.Time) {
ret := _m.Called(ctx, grantee, granter, msgType)
if len(ret) == 0 {
panic("no return value specified for GetCleanAuthorization")
}
var r0 authz.Authorization
var r1 time.Time
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, string) (authz.Authorization, time.Time)); ok {
return rf(ctx, grantee, granter, msgType)
}
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, string) authz.Authorization); ok {
r0 = rf(ctx, grantee, granter, msgType)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(authz.Authorization)
}
}
if rf, ok := ret.Get(1).(func(types.Context, types.AccAddress, types.AccAddress, string) time.Time); ok {
r1 = rf(ctx, grantee, granter, msgType)
} else {
r1 = ret.Get(1).(time.Time)
}
return r0, r1
}
// AuthzKeeper_GetCleanAuthorization_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCleanAuthorization'
type AuthzKeeper_GetCleanAuthorization_Call struct {
*mock.Call
}
// GetCleanAuthorization is a helper method to define mock.On call
// - ctx types.Context
// - grantee types.AccAddress
// - granter types.AccAddress
// - msgType string
func (_e *AuthzKeeper_Expecter) GetCleanAuthorization(ctx interface{}, grantee interface{}, granter interface{}, msgType interface{}) *AuthzKeeper_GetCleanAuthorization_Call {
return &AuthzKeeper_GetCleanAuthorization_Call{Call: _e.mock.On("GetCleanAuthorization", ctx, grantee, granter, msgType)}
}
func (_c *AuthzKeeper_GetCleanAuthorization_Call) Run(run func(ctx types.Context, grantee types.AccAddress, granter types.AccAddress, msgType string)) *AuthzKeeper_GetCleanAuthorization_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(types.AccAddress), args[3].(string))
})
return _c
}
func (_c *AuthzKeeper_GetCleanAuthorization_Call) Return(cap authz.Authorization, expiration time.Time) *AuthzKeeper_GetCleanAuthorization_Call {
_c.Call.Return(cap, expiration)
return _c
}
func (_c *AuthzKeeper_GetCleanAuthorization_Call) RunAndReturn(run func(types.Context, types.AccAddress, types.AccAddress, string) (authz.Authorization, time.Time)) *AuthzKeeper_GetCleanAuthorization_Call {
_c.Call.Return(run)
return _c
}
// SaveGrant provides a mock function with given fields: ctx, grantee, granter, authorization, expiration
func (_m *AuthzKeeper) SaveGrant(ctx types.Context, grantee types.AccAddress, granter types.AccAddress, authorization authz.Authorization, expiration time.Time) error {
ret := _m.Called(ctx, grantee, granter, authorization, expiration)
if len(ret) == 0 {
panic("no return value specified for SaveGrant")
}
var r0 error
if rf, ok := ret.Get(0).(func(types.Context, types.AccAddress, types.AccAddress, authz.Authorization, time.Time) error); ok {
r0 = rf(ctx, grantee, granter, authorization, expiration)
} else {
r0 = ret.Error(0)
}
return r0
}
// AuthzKeeper_SaveGrant_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveGrant'
type AuthzKeeper_SaveGrant_Call struct {
*mock.Call
}
// SaveGrant is a helper method to define mock.On call
// - ctx types.Context
// - grantee types.AccAddress
// - granter types.AccAddress
// - authorization authz.Authorization
// - expiration time.Time
func (_e *AuthzKeeper_Expecter) SaveGrant(ctx interface{}, grantee interface{}, granter interface{}, authorization interface{}, expiration interface{}) *AuthzKeeper_SaveGrant_Call {
return &AuthzKeeper_SaveGrant_Call{Call: _e.mock.On("SaveGrant", ctx, grantee, granter, authorization, expiration)}
}
func (_c *AuthzKeeper_SaveGrant_Call) Run(run func(ctx types.Context, grantee types.AccAddress, granter types.AccAddress, authorization authz.Authorization, expiration time.Time)) *AuthzKeeper_SaveGrant_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.Context), args[1].(types.AccAddress), args[2].(types.AccAddress), args[3].(authz.Authorization), args[4].(time.Time))
})
return _c
}
func (_c *AuthzKeeper_SaveGrant_Call) Return(_a0 error) *AuthzKeeper_SaveGrant_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *AuthzKeeper_SaveGrant_Call) RunAndReturn(run func(types.Context, types.AccAddress, types.AccAddress, authz.Authorization, time.Time) error) *AuthzKeeper_SaveGrant_Call {
_c.Call.Return(run)
return _c
}
// NewAuthzKeeper creates a new instance of AuthzKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewAuthzKeeper(t interface {
mock.TestingT
Cleanup(func())
}) *AuthzKeeper {
mock := &AuthzKeeper{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}