/
gasometer.go
118 lines (97 loc) · 3.54 KB
/
gasometer.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
// Code generated by mockery v2.36.1. DO NOT EDIT.
package mocks
import (
grpc "github.com/cosmos/gogoproto/grpc"
mock "github.com/stretchr/testify/mock"
proto "github.com/cosmos/gogoproto/proto"
tx "github.com/cosmos/cosmos-sdk/client/tx"
typestx "github.com/cosmos/cosmos-sdk/types/tx"
)
// Gasometer is an autogenerated mock type for the Gasometer type
type Gasometer struct {
mock.Mock
}
type Gasometer_Expecter struct {
mock *mock.Mock
}
func (_m *Gasometer) EXPECT() *Gasometer_Expecter {
return &Gasometer_Expecter{mock: &_m.Mock}
}
// CalculateGas provides a mock function with given fields: clientCtx, txf, msgs
func (_m *Gasometer) CalculateGas(clientCtx grpc.ClientConn, txf tx.Factory, msgs ...proto.Message) (*typestx.SimulateResponse, uint64, error) {
_va := make([]interface{}, len(msgs))
for _i := range msgs {
_va[_i] = msgs[_i]
}
var _ca []interface{}
_ca = append(_ca, clientCtx, txf)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *typestx.SimulateResponse
var r1 uint64
var r2 error
if rf, ok := ret.Get(0).(func(grpc.ClientConn, tx.Factory, ...proto.Message) (*typestx.SimulateResponse, uint64, error)); ok {
return rf(clientCtx, txf, msgs...)
}
if rf, ok := ret.Get(0).(func(grpc.ClientConn, tx.Factory, ...proto.Message) *typestx.SimulateResponse); ok {
r0 = rf(clientCtx, txf, msgs...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*typestx.SimulateResponse)
}
}
if rf, ok := ret.Get(1).(func(grpc.ClientConn, tx.Factory, ...proto.Message) uint64); ok {
r1 = rf(clientCtx, txf, msgs...)
} else {
r1 = ret.Get(1).(uint64)
}
if rf, ok := ret.Get(2).(func(grpc.ClientConn, tx.Factory, ...proto.Message) error); ok {
r2 = rf(clientCtx, txf, msgs...)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// Gasometer_CalculateGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CalculateGas'
type Gasometer_CalculateGas_Call struct {
*mock.Call
}
// CalculateGas is a helper method to define mock.On call
// - clientCtx grpc.ClientConn
// - txf tx.Factory
// - msgs ...proto.Message
func (_e *Gasometer_Expecter) CalculateGas(clientCtx interface{}, txf interface{}, msgs ...interface{}) *Gasometer_CalculateGas_Call {
return &Gasometer_CalculateGas_Call{Call: _e.mock.On("CalculateGas",
append([]interface{}{clientCtx, txf}, msgs...)...)}
}
func (_c *Gasometer_CalculateGas_Call) Run(run func(clientCtx grpc.ClientConn, txf tx.Factory, msgs ...proto.Message)) *Gasometer_CalculateGas_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]proto.Message, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(proto.Message)
}
}
run(args[0].(grpc.ClientConn), args[1].(tx.Factory), variadicArgs...)
})
return _c
}
func (_c *Gasometer_CalculateGas_Call) Return(_a0 *typestx.SimulateResponse, _a1 uint64, _a2 error) *Gasometer_CalculateGas_Call {
_c.Call.Return(_a0, _a1, _a2)
return _c
}
func (_c *Gasometer_CalculateGas_Call) RunAndReturn(run func(grpc.ClientConn, tx.Factory, ...proto.Message) (*typestx.SimulateResponse, uint64, error)) *Gasometer_CalculateGas_Call {
_c.Call.Return(run)
return _c
}
// NewGasometer creates a new instance of Gasometer. 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 NewGasometer(t interface {
mock.TestingT
Cleanup(func())
}) *Gasometer {
mock := &Gasometer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}