diff --git a/mocks/constructor/coordinator/handler.go b/mocks/constructor/coordinator/handler.go index 5b39491f..1db38cac 100644 --- a/mocks/constructor/coordinator/handler.go +++ b/mocks/constructor/coordinator/handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package coordinator @@ -19,6 +19,10 @@ type Handler struct { func (_m *Handler) TransactionCreated(_a0 context.Context, _a1 string, _a2 *types.TransactionIdentifier) error { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for TransactionCreated") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, *types.TransactionIdentifier) error); ok { r0 = rf(_a0, _a1, _a2) @@ -29,13 +33,12 @@ func (_m *Handler) TransactionCreated(_a0 context.Context, _a1 string, _a2 *type return r0 } -type mockConstructorTestingTNewHandler interface { +// NewHandler creates a new instance of Handler. 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 NewHandler(t interface { mock.TestingT Cleanup(func()) -} - -// NewHandler creates a new instance of Handler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewHandler(t mockConstructorTestingTNewHandler) *Handler { +}) *Handler { mock := &Handler{} mock.Mock.Test(t) diff --git a/mocks/constructor/coordinator/helper.go b/mocks/constructor/coordinator/helper.go index 66959855..1e53efe7 100644 --- a/mocks/constructor/coordinator/helper.go +++ b/mocks/constructor/coordinator/helper.go @@ -1,14 +1,16 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package coordinator import ( context "context" - mock "github.com/stretchr/testify/mock" + database "github.com/coinbase/rosetta-sdk-go/storage/database" keys "github.com/coinbase/rosetta-sdk-go/keys" - database "github.com/coinbase/rosetta-sdk-go/storage/database" + + mock "github.com/stretchr/testify/mock" + types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -21,7 +23,15 @@ type Helper struct { func (_m *Helper) AllAccounts(_a0 context.Context, _a1 database.Transaction) ([]*types.AccountIdentifier, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for AllAccounts") + } + var r0 []*types.AccountIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) ([]*types.AccountIdentifier, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*types.AccountIdentifier); ok { r0 = rf(_a0, _a1) } else { @@ -30,7 +40,6 @@ func (_m *Helper) AllAccounts(_a0 context.Context, _a1 database.Transaction) ([] } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(_a0, _a1) } else { @@ -44,7 +53,15 @@ func (_m *Helper) AllAccounts(_a0 context.Context, _a1 database.Transaction) ([] func (_m *Helper) Balance(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *types.Currency) (*types.Amount, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Balance") + } + var r0 *types.Amount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) (*types.Amount, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) *types.Amount); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -53,7 +70,6 @@ func (_m *Helper) Balance(_a0 context.Context, _a1 database.Transaction, _a2 *ty } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -67,6 +83,10 @@ func (_m *Helper) Balance(_a0 context.Context, _a1 database.Transaction, _a2 *ty func (_m *Helper) Broadcast(_a0 context.Context, _a1 database.Transaction, _a2 string, _a3 *types.NetworkIdentifier, _a4 []*types.Operation, _a5 *types.TransactionIdentifier, _a6 string, _a7 int64, _a8 map[string]interface{}) error { ret := _m.Called(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) + if len(ret) == 0 { + panic("no return value specified for Broadcast") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string, *types.NetworkIdentifier, []*types.Operation, *types.TransactionIdentifier, string, int64, map[string]interface{}) error); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) @@ -81,6 +101,10 @@ func (_m *Helper) Broadcast(_a0 context.Context, _a1 database.Transaction, _a2 s func (_m *Helper) BroadcastAll(_a0 context.Context) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for BroadcastAll") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(_a0) @@ -95,7 +119,15 @@ func (_m *Helper) BroadcastAll(_a0 context.Context) error { func (_m *Helper) Coins(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *types.Currency) ([]*types.Coin, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Coins") + } + var r0 []*types.Coin + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) ([]*types.Coin, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) []*types.Coin); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -104,7 +136,6 @@ func (_m *Helper) Coins(_a0 context.Context, _a1 database.Transaction, _a2 *type } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -118,14 +149,21 @@ func (_m *Helper) Coins(_a0 context.Context, _a1 database.Transaction, _a2 *type func (_m *Helper) Combine(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 string, _a3 []*types.Signature) (string, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Combine") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, string, []*types.Signature) (string, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, string, []*types.Signature) string); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, string, []*types.Signature) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -139,6 +177,10 @@ func (_m *Helper) Combine(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 func (_m *Helper) DatabaseTransaction(_a0 context.Context) database.Transaction { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for DatabaseTransaction") + } + var r0 database.Transaction if rf, ok := ret.Get(0).(func(context.Context) database.Transaction); ok { r0 = rf(_a0) @@ -155,7 +197,16 @@ func (_m *Helper) DatabaseTransaction(_a0 context.Context) database.Transaction func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 *types.PublicKey, _a3 map[string]interface{}) (*types.AccountIdentifier, map[string]interface{}, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Derive") + } + var r0 *types.AccountIdentifier + var r1 map[string]interface{} + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) (*types.AccountIdentifier, map[string]interface{}, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) *types.AccountIdentifier); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -164,7 +215,6 @@ func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 } } - var r1 map[string]interface{} if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) map[string]interface{}); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -173,7 +223,6 @@ func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) error); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -187,14 +236,22 @@ func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 func (_m *Helper) GetBlob(ctx context.Context, dbTx database.Transaction, key string) (bool, []byte, error) { ret := _m.Called(ctx, dbTx, key) + if len(ret) == 0 { + panic("no return value specified for GetBlob") + } + var r0 bool + var r1 []byte + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) (bool, []byte, error)); ok { + return rf(ctx, dbTx, key) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) bool); ok { r0 = rf(ctx, dbTx, key) } else { r0 = ret.Get(0).(bool) } - var r1 []byte if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, string) []byte); ok { r1 = rf(ctx, dbTx, key) } else { @@ -203,7 +260,6 @@ func (_m *Helper) GetBlob(ctx context.Context, dbTx database.Transaction, key st } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, database.Transaction, string) error); ok { r2 = rf(ctx, dbTx, key) } else { @@ -217,7 +273,15 @@ func (_m *Helper) GetBlob(ctx context.Context, dbTx database.Transaction, key st func (_m *Helper) GetKey(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier) (*keys.KeyPair, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for GetKey") + } + var r0 *keys.KeyPair + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier) (*keys.KeyPair, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier) *keys.KeyPair); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -226,7 +290,6 @@ func (_m *Helper) GetKey(_a0 context.Context, _a1 database.Transaction, _a2 *typ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -240,7 +303,15 @@ func (_m *Helper) GetKey(_a0 context.Context, _a1 database.Transaction, _a2 *typ func (_m *Helper) Hash(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 string) (*types.TransactionIdentifier, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for Hash") + } + var r0 *types.TransactionIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, string) (*types.TransactionIdentifier, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, string) *types.TransactionIdentifier); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -249,7 +320,6 @@ func (_m *Helper) Hash(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 st } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -263,6 +333,10 @@ func (_m *Helper) Hash(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 st func (_m *Helper) HeadBlockExists(_a0 context.Context) bool { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for HeadBlockExists") + } + var r0 bool if rf, ok := ret.Get(0).(func(context.Context) bool); ok { r0 = rf(_a0) @@ -277,7 +351,15 @@ func (_m *Helper) HeadBlockExists(_a0 context.Context) bool { func (_m *Helper) LockedAccounts(_a0 context.Context, _a1 database.Transaction) ([]*types.AccountIdentifier, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for LockedAccounts") + } + var r0 []*types.AccountIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) ([]*types.AccountIdentifier, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*types.AccountIdentifier); ok { r0 = rf(_a0, _a1) } else { @@ -286,7 +368,6 @@ func (_m *Helper) LockedAccounts(_a0 context.Context, _a1 database.Transaction) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(_a0, _a1) } else { @@ -300,7 +381,16 @@ func (_m *Helper) LockedAccounts(_a0 context.Context, _a1 database.Transaction) func (_m *Helper) Metadata(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 map[string]interface{}, _a3 []*types.PublicKey) (map[string]interface{}, []*types.Amount, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Metadata") + } + var r0 map[string]interface{} + var r1 []*types.Amount + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, map[string]interface{}, []*types.PublicKey) (map[string]interface{}, []*types.Amount, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, map[string]interface{}, []*types.PublicKey) map[string]interface{}); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -309,7 +399,6 @@ func (_m *Helper) Metadata(_a0 context.Context, _a1 *types.NetworkIdentifier, _a } } - var r1 []*types.Amount if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, map[string]interface{}, []*types.PublicKey) []*types.Amount); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -318,7 +407,6 @@ func (_m *Helper) Metadata(_a0 context.Context, _a1 *types.NetworkIdentifier, _a } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, map[string]interface{}, []*types.PublicKey) error); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -332,7 +420,17 @@ func (_m *Helper) Metadata(_a0 context.Context, _a1 *types.NetworkIdentifier, _a func (_m *Helper) Parse(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 bool, _a3 string) ([]*types.Operation, []*types.AccountIdentifier, map[string]interface{}, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Parse") + } + var r0 []*types.Operation + var r1 []*types.AccountIdentifier + var r2 map[string]interface{} + var r3 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, bool, string) ([]*types.Operation, []*types.AccountIdentifier, map[string]interface{}, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, bool, string) []*types.Operation); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -341,7 +439,6 @@ func (_m *Helper) Parse(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 b } } - var r1 []*types.AccountIdentifier if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, bool, string) []*types.AccountIdentifier); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -350,7 +447,6 @@ func (_m *Helper) Parse(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 b } } - var r2 map[string]interface{} if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, bool, string) map[string]interface{}); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -359,7 +455,6 @@ func (_m *Helper) Parse(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 b } } - var r3 error if rf, ok := ret.Get(3).(func(context.Context, *types.NetworkIdentifier, bool, string) error); ok { r3 = rf(_a0, _a1, _a2, _a3) } else { @@ -373,14 +468,22 @@ func (_m *Helper) Parse(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 b func (_m *Helper) Payloads(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 []*types.Operation, _a3 map[string]interface{}, _a4 []*types.PublicKey) (string, []*types.SigningPayload, error) { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + if len(ret) == 0 { + panic("no return value specified for Payloads") + } + var r0 string + var r1 []*types.SigningPayload + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}, []*types.PublicKey) (string, []*types.SigningPayload, error)); ok { + return rf(_a0, _a1, _a2, _a3, _a4) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}, []*types.PublicKey) string); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4) } else { r0 = ret.Get(0).(string) } - var r1 []*types.SigningPayload if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}, []*types.PublicKey) []*types.SigningPayload); ok { r1 = rf(_a0, _a1, _a2, _a3, _a4) } else { @@ -389,7 +492,6 @@ func (_m *Helper) Payloads(_a0 context.Context, _a1 *types.NetworkIdentifier, _a } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}, []*types.PublicKey) error); ok { r2 = rf(_a0, _a1, _a2, _a3, _a4) } else { @@ -403,7 +505,16 @@ func (_m *Helper) Payloads(_a0 context.Context, _a1 *types.NetworkIdentifier, _a func (_m *Helper) Preprocess(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 []*types.Operation, _a3 map[string]interface{}) (map[string]interface{}, []*types.AccountIdentifier, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Preprocess") + } + var r0 map[string]interface{} + var r1 []*types.AccountIdentifier + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}) (map[string]interface{}, []*types.AccountIdentifier, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}) map[string]interface{}); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -412,7 +523,6 @@ func (_m *Helper) Preprocess(_a0 context.Context, _a1 *types.NetworkIdentifier, } } - var r1 []*types.AccountIdentifier if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}) []*types.AccountIdentifier); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -421,7 +531,6 @@ func (_m *Helper) Preprocess(_a0 context.Context, _a1 *types.NetworkIdentifier, } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, []*types.Operation, map[string]interface{}) error); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -435,6 +544,10 @@ func (_m *Helper) Preprocess(_a0 context.Context, _a1 *types.NetworkIdentifier, func (_m *Helper) SetBlob(ctx context.Context, dbTx database.Transaction, key string, value []byte) error { ret := _m.Called(ctx, dbTx, key, value) + if len(ret) == 0 { + panic("no return value specified for SetBlob") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string, []byte) error); ok { r0 = rf(ctx, dbTx, key, value) @@ -449,7 +562,15 @@ func (_m *Helper) SetBlob(ctx context.Context, dbTx database.Transaction, key st func (_m *Helper) Sign(_a0 context.Context, _a1 []*types.SigningPayload) ([]*types.Signature, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Sign") + } + var r0 []*types.Signature + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []*types.SigningPayload) ([]*types.Signature, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, []*types.SigningPayload) []*types.Signature); ok { r0 = rf(_a0, _a1) } else { @@ -458,7 +579,6 @@ func (_m *Helper) Sign(_a0 context.Context, _a1 []*types.SigningPayload) ([]*typ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, []*types.SigningPayload) error); ok { r1 = rf(_a0, _a1) } else { @@ -472,6 +592,10 @@ func (_m *Helper) Sign(_a0 context.Context, _a1 []*types.SigningPayload) ([]*typ func (_m *Helper) StoreKey(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *keys.KeyPair) error { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for StoreKey") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *keys.KeyPair) error); ok { r0 = rf(_a0, _a1, _a2, _a3) @@ -482,13 +606,12 @@ func (_m *Helper) StoreKey(_a0 context.Context, _a1 database.Transaction, _a2 *t return r0 } -type mockConstructorTestingTNewHelper interface { +// NewHelper creates a new instance of Helper. 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 NewHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewHelper creates a new instance of Helper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewHelper(t mockConstructorTestingTNewHelper) *Helper { +}) *Helper { mock := &Helper{} mock.Mock.Test(t) diff --git a/mocks/constructor/coordinator/job_storage.go b/mocks/constructor/coordinator/job_storage.go index 8b879999..a944349a 100644 --- a/mocks/constructor/coordinator/job_storage.go +++ b/mocks/constructor/coordinator/job_storage.go @@ -1,14 +1,15 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package coordinator import ( context "context" - mock "github.com/stretchr/testify/mock" + database "github.com/coinbase/rosetta-sdk-go/storage/database" job "github.com/coinbase/rosetta-sdk-go/constructor/job" - database "github.com/coinbase/rosetta-sdk-go/storage/database" + + mock "github.com/stretchr/testify/mock" ) // JobStorage is an autogenerated mock type for the JobStorage type @@ -20,7 +21,15 @@ type JobStorage struct { func (_m *JobStorage) Broadcasting(_a0 context.Context, _a1 database.Transaction) ([]*job.Job, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Broadcasting") + } + var r0 []*job.Job + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) ([]*job.Job, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*job.Job); ok { r0 = rf(_a0, _a1) } else { @@ -29,7 +38,6 @@ func (_m *JobStorage) Broadcasting(_a0 context.Context, _a1 database.Transaction } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(_a0, _a1) } else { @@ -43,7 +51,15 @@ func (_m *JobStorage) Broadcasting(_a0 context.Context, _a1 database.Transaction func (_m *JobStorage) Get(_a0 context.Context, _a1 database.Transaction, _a2 string) (*job.Job, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 *job.Job + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) (*job.Job, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) *job.Job); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -52,7 +68,6 @@ func (_m *JobStorage) Get(_a0 context.Context, _a1 database.Transaction, _a2 str } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -66,7 +81,15 @@ func (_m *JobStorage) Get(_a0 context.Context, _a1 database.Transaction, _a2 str func (_m *JobStorage) Processing(_a0 context.Context, _a1 database.Transaction, _a2 string) ([]*job.Job, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for Processing") + } + var r0 []*job.Job + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) ([]*job.Job, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) []*job.Job); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -75,7 +98,6 @@ func (_m *JobStorage) Processing(_a0 context.Context, _a1 database.Transaction, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -89,7 +111,15 @@ func (_m *JobStorage) Processing(_a0 context.Context, _a1 database.Transaction, func (_m *JobStorage) Ready(_a0 context.Context, _a1 database.Transaction) ([]*job.Job, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Ready") + } + var r0 []*job.Job + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) ([]*job.Job, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*job.Job); ok { r0 = rf(_a0, _a1) } else { @@ -98,7 +128,6 @@ func (_m *JobStorage) Ready(_a0 context.Context, _a1 database.Transaction) ([]*j } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(_a0, _a1) } else { @@ -112,14 +141,21 @@ func (_m *JobStorage) Ready(_a0 context.Context, _a1 database.Transaction) ([]*j func (_m *JobStorage) Update(_a0 context.Context, _a1 database.Transaction, _a2 *job.Job) (string, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for Update") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *job.Job) (string, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *job.Job) string); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *job.Job) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -129,13 +165,12 @@ func (_m *JobStorage) Update(_a0 context.Context, _a1 database.Transaction, _a2 return r0, r1 } -type mockConstructorTestingTNewJobStorage interface { +// NewJobStorage creates a new instance of JobStorage. 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 NewJobStorage(t interface { mock.TestingT Cleanup(func()) -} - -// NewJobStorage creates a new instance of JobStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewJobStorage(t mockConstructorTestingTNewJobStorage) *JobStorage { +}) *JobStorage { mock := &JobStorage{} mock.Mock.Test(t) diff --git a/mocks/constructor/worker/helper.go b/mocks/constructor/worker/helper.go index 93d8e507..1efafeb8 100644 --- a/mocks/constructor/worker/helper.go +++ b/mocks/constructor/worker/helper.go @@ -1,14 +1,15 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package worker import ( context "context" - mock "github.com/stretchr/testify/mock" - keys "github.com/coinbase/rosetta-sdk-go/keys" database "github.com/coinbase/rosetta-sdk-go/storage/database" + + mock "github.com/stretchr/testify/mock" + types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -21,7 +22,15 @@ type Helper struct { func (_m *Helper) AllAccounts(_a0 context.Context, _a1 database.Transaction) ([]*types.AccountIdentifier, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for AllAccounts") + } + var r0 []*types.AccountIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) ([]*types.AccountIdentifier, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*types.AccountIdentifier); ok { r0 = rf(_a0, _a1) } else { @@ -30,7 +39,6 @@ func (_m *Helper) AllAccounts(_a0 context.Context, _a1 database.Transaction) ([] } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(_a0, _a1) } else { @@ -44,7 +52,15 @@ func (_m *Helper) AllAccounts(_a0 context.Context, _a1 database.Transaction) ([] func (_m *Helper) Balance(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *types.Currency) (*types.Amount, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Balance") + } + var r0 *types.Amount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) (*types.Amount, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) *types.Amount); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -53,7 +69,6 @@ func (_m *Helper) Balance(_a0 context.Context, _a1 database.Transaction, _a2 *ty } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -67,7 +82,15 @@ func (_m *Helper) Balance(_a0 context.Context, _a1 database.Transaction, _a2 *ty func (_m *Helper) Coins(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *types.Currency) ([]*types.Coin, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Coins") + } + var r0 []*types.Coin + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) ([]*types.Coin, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) []*types.Coin); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -76,7 +99,6 @@ func (_m *Helper) Coins(_a0 context.Context, _a1 database.Transaction, _a2 *type } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -90,7 +112,16 @@ func (_m *Helper) Coins(_a0 context.Context, _a1 database.Transaction, _a2 *type func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 *types.PublicKey, _a3 map[string]interface{}) (*types.AccountIdentifier, map[string]interface{}, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Derive") + } + var r0 *types.AccountIdentifier + var r1 map[string]interface{} + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) (*types.AccountIdentifier, map[string]interface{}, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) *types.AccountIdentifier); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -99,7 +130,6 @@ func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 } } - var r1 map[string]interface{} if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) map[string]interface{}); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -108,7 +138,6 @@ func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, *types.PublicKey, map[string]interface{}) error); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -122,14 +151,22 @@ func (_m *Helper) Derive(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 func (_m *Helper) GetBlob(ctx context.Context, dbTx database.Transaction, key string) (bool, []byte, error) { ret := _m.Called(ctx, dbTx, key) + if len(ret) == 0 { + panic("no return value specified for GetBlob") + } + var r0 bool + var r1 []byte + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) (bool, []byte, error)); ok { + return rf(ctx, dbTx, key) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string) bool); ok { r0 = rf(ctx, dbTx, key) } else { r0 = ret.Get(0).(bool) } - var r1 []byte if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, string) []byte); ok { r1 = rf(ctx, dbTx, key) } else { @@ -138,7 +175,6 @@ func (_m *Helper) GetBlob(ctx context.Context, dbTx database.Transaction, key st } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, database.Transaction, string) error); ok { r2 = rf(ctx, dbTx, key) } else { @@ -152,7 +188,15 @@ func (_m *Helper) GetBlob(ctx context.Context, dbTx database.Transaction, key st func (_m *Helper) LockedAccounts(_a0 context.Context, _a1 database.Transaction) ([]*types.AccountIdentifier, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for LockedAccounts") + } + var r0 []*types.AccountIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) ([]*types.AccountIdentifier, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) []*types.AccountIdentifier); ok { r0 = rf(_a0, _a1) } else { @@ -161,7 +205,6 @@ func (_m *Helper) LockedAccounts(_a0 context.Context, _a1 database.Transaction) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(_a0, _a1) } else { @@ -175,6 +218,10 @@ func (_m *Helper) LockedAccounts(_a0 context.Context, _a1 database.Transaction) func (_m *Helper) SetBlob(ctx context.Context, dbTx database.Transaction, key string, value []byte) error { ret := _m.Called(ctx, dbTx, key, value) + if len(ret) == 0 { + panic("no return value specified for SetBlob") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string, []byte) error); ok { r0 = rf(ctx, dbTx, key, value) @@ -189,6 +236,10 @@ func (_m *Helper) SetBlob(ctx context.Context, dbTx database.Transaction, key st func (_m *Helper) StoreKey(_a0 context.Context, _a1 database.Transaction, _a2 *types.AccountIdentifier, _a3 *keys.KeyPair) error { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for StoreKey") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *keys.KeyPair) error); ok { r0 = rf(_a0, _a1, _a2, _a3) @@ -199,13 +250,12 @@ func (_m *Helper) StoreKey(_a0 context.Context, _a1 database.Transaction, _a2 *t return r0 } -type mockConstructorTestingTNewHelper interface { +// NewHelper creates a new instance of Helper. 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 NewHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewHelper creates a new instance of Helper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewHelper(t mockConstructorTestingTNewHelper) *Helper { +}) *Helper { mock := &Helper{} mock.Mock.Test(t) diff --git a/mocks/reconciler/handler.go b/mocks/reconciler/handler.go index 89661583..1d5ee149 100644 --- a/mocks/reconciler/handler.go +++ b/mocks/reconciler/handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package reconciler @@ -19,6 +19,10 @@ type Handler struct { func (_m *Handler) ReconciliationExempt(ctx context.Context, reconciliationType string, account *types.AccountIdentifier, currency *types.Currency, computedBalance string, liveBalance string, block *types.BlockIdentifier, exemption *types.BalanceExemption) error { ret := _m.Called(ctx, reconciliationType, account, currency, computedBalance, liveBalance, block, exemption) + if len(ret) == 0 { + panic("no return value specified for ReconciliationExempt") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, *types.AccountIdentifier, *types.Currency, string, string, *types.BlockIdentifier, *types.BalanceExemption) error); ok { r0 = rf(ctx, reconciliationType, account, currency, computedBalance, liveBalance, block, exemption) @@ -33,6 +37,10 @@ func (_m *Handler) ReconciliationExempt(ctx context.Context, reconciliationType func (_m *Handler) ReconciliationFailed(ctx context.Context, reconciliationType string, account *types.AccountIdentifier, currency *types.Currency, computedBalance string, liveBalance string, block *types.BlockIdentifier) error { ret := _m.Called(ctx, reconciliationType, account, currency, computedBalance, liveBalance, block) + if len(ret) == 0 { + panic("no return value specified for ReconciliationFailed") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, *types.AccountIdentifier, *types.Currency, string, string, *types.BlockIdentifier) error); ok { r0 = rf(ctx, reconciliationType, account, currency, computedBalance, liveBalance, block) @@ -47,6 +55,10 @@ func (_m *Handler) ReconciliationFailed(ctx context.Context, reconciliationType func (_m *Handler) ReconciliationSkipped(ctx context.Context, reconciliationType string, account *types.AccountIdentifier, currency *types.Currency, cause string) error { ret := _m.Called(ctx, reconciliationType, account, currency, cause) + if len(ret) == 0 { + panic("no return value specified for ReconciliationSkipped") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, *types.AccountIdentifier, *types.Currency, string) error); ok { r0 = rf(ctx, reconciliationType, account, currency, cause) @@ -61,6 +73,10 @@ func (_m *Handler) ReconciliationSkipped(ctx context.Context, reconciliationType func (_m *Handler) ReconciliationSucceeded(ctx context.Context, reconciliationType string, account *types.AccountIdentifier, currency *types.Currency, balance string, block *types.BlockIdentifier) error { ret := _m.Called(ctx, reconciliationType, account, currency, balance, block) + if len(ret) == 0 { + panic("no return value specified for ReconciliationSucceeded") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, *types.AccountIdentifier, *types.Currency, string, *types.BlockIdentifier) error); ok { r0 = rf(ctx, reconciliationType, account, currency, balance, block) @@ -71,13 +87,12 @@ func (_m *Handler) ReconciliationSucceeded(ctx context.Context, reconciliationTy return r0 } -type mockConstructorTestingTNewHandler interface { +// NewHandler creates a new instance of Handler. 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 NewHandler(t interface { mock.TestingT Cleanup(func()) -} - -// NewHandler creates a new instance of Handler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewHandler(t mockConstructorTestingTNewHandler) *Handler { +}) *Handler { mock := &Handler{} mock.Mock.Test(t) diff --git a/mocks/reconciler/helper.go b/mocks/reconciler/helper.go index f24545dd..a0bece31 100644 --- a/mocks/reconciler/helper.go +++ b/mocks/reconciler/helper.go @@ -1,13 +1,13 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package reconciler import ( context "context" + database "github.com/coinbase/rosetta-sdk-go/storage/database" mock "github.com/stretchr/testify/mock" - database "github.com/coinbase/rosetta-sdk-go/storage/database" types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -20,14 +20,21 @@ type Helper struct { func (_m *Helper) CanonicalBlock(ctx context.Context, dbTx database.Transaction, block *types.BlockIdentifier) (bool, error) { ret := _m.Called(ctx, dbTx, block) + if len(ret) == 0 { + panic("no return value specified for CanonicalBlock") + } + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.BlockIdentifier) (bool, error)); ok { + return rf(ctx, dbTx, block) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.BlockIdentifier) bool); ok { r0 = rf(ctx, dbTx, block) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.BlockIdentifier) error); ok { r1 = rf(ctx, dbTx, block) } else { @@ -41,7 +48,15 @@ func (_m *Helper) CanonicalBlock(ctx context.Context, dbTx database.Transaction, func (_m *Helper) ComputedBalance(ctx context.Context, dbTx database.Transaction, account *types.AccountIdentifier, currency *types.Currency, index int64) (*types.Amount, error) { ret := _m.Called(ctx, dbTx, account, currency, index) + if len(ret) == 0 { + panic("no return value specified for ComputedBalance") + } + var r0 *types.Amount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency, int64) (*types.Amount, error)); ok { + return rf(ctx, dbTx, account, currency, index) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency, int64) *types.Amount); ok { r0 = rf(ctx, dbTx, account, currency, index) } else { @@ -50,7 +65,6 @@ func (_m *Helper) ComputedBalance(ctx context.Context, dbTx database.Transaction } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction, *types.AccountIdentifier, *types.Currency, int64) error); ok { r1 = rf(ctx, dbTx, account, currency, index) } else { @@ -64,7 +78,15 @@ func (_m *Helper) ComputedBalance(ctx context.Context, dbTx database.Transaction func (_m *Helper) CurrentBlock(ctx context.Context, dbTx database.Transaction) (*types.BlockIdentifier, error) { ret := _m.Called(ctx, dbTx) + if len(ret) == 0 { + panic("no return value specified for CurrentBlock") + } + var r0 *types.BlockIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) (*types.BlockIdentifier, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) *types.BlockIdentifier); ok { r0 = rf(ctx, dbTx) } else { @@ -73,7 +95,6 @@ func (_m *Helper) CurrentBlock(ctx context.Context, dbTx database.Transaction) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(ctx, dbTx) } else { @@ -87,6 +108,10 @@ func (_m *Helper) CurrentBlock(ctx context.Context, dbTx database.Transaction) ( func (_m *Helper) DatabaseTransaction(ctx context.Context) database.Transaction { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for DatabaseTransaction") + } + var r0 database.Transaction if rf, ok := ret.Get(0).(func(context.Context) database.Transaction); ok { r0 = rf(ctx) @@ -103,6 +128,10 @@ func (_m *Helper) DatabaseTransaction(ctx context.Context) database.Transaction func (_m *Helper) ForceInactiveReconciliation(ctx context.Context, account *types.AccountIdentifier, currency *types.Currency, lastCheck *types.BlockIdentifier) bool { ret := _m.Called(ctx, account, currency, lastCheck) + if len(ret) == 0 { + panic("no return value specified for ForceInactiveReconciliation") + } + var r0 bool if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, *types.BlockIdentifier) bool); ok { r0 = rf(ctx, account, currency, lastCheck) @@ -117,14 +146,21 @@ func (_m *Helper) ForceInactiveReconciliation(ctx context.Context, account *type func (_m *Helper) IndexAtTip(ctx context.Context, index int64) (bool, error) { ret := _m.Called(ctx, index) + if len(ret) == 0 { + panic("no return value specified for IndexAtTip") + } + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64) (bool, error)); ok { + return rf(ctx, index) + } if rf, ok := ret.Get(0).(func(context.Context, int64) bool); ok { r0 = rf(ctx, index) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { r1 = rf(ctx, index) } else { @@ -138,7 +174,16 @@ func (_m *Helper) IndexAtTip(ctx context.Context, index int64) (bool, error) { func (_m *Helper) LiveBalance(ctx context.Context, account *types.AccountIdentifier, currency *types.Currency, index int64) (*types.Amount, *types.BlockIdentifier, error) { ret := _m.Called(ctx, account, currency, index) + if len(ret) == 0 { + panic("no return value specified for LiveBalance") + } + var r0 *types.Amount + var r1 *types.BlockIdentifier + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) (*types.Amount, *types.BlockIdentifier, error)); ok { + return rf(ctx, account, currency, index) + } if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) *types.Amount); ok { r0 = rf(ctx, account, currency, index) } else { @@ -147,7 +192,6 @@ func (_m *Helper) LiveBalance(ctx context.Context, account *types.AccountIdentif } } - var r1 *types.BlockIdentifier if rf, ok := ret.Get(1).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) *types.BlockIdentifier); ok { r1 = rf(ctx, account, currency, index) } else { @@ -156,7 +200,6 @@ func (_m *Helper) LiveBalance(ctx context.Context, account *types.AccountIdentif } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) error); ok { r2 = rf(ctx, account, currency, index) } else { @@ -170,6 +213,10 @@ func (_m *Helper) LiveBalance(ctx context.Context, account *types.AccountIdentif func (_m *Helper) PruneBalances(ctx context.Context, account *types.AccountIdentifier, currency *types.Currency, index int64) error { ret := _m.Called(ctx, account, currency, index) + if len(ret) == 0 { + panic("no return value specified for PruneBalances") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, int64) error); ok { r0 = rf(ctx, account, currency, index) @@ -180,13 +227,12 @@ func (_m *Helper) PruneBalances(ctx context.Context, account *types.AccountIdent return r0 } -type mockConstructorTestingTNewHelper interface { +// NewHelper creates a new instance of Helper. 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 NewHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewHelper creates a new instance of Helper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewHelper(t mockConstructorTestingTNewHelper) *Helper { +}) *Helper { mock := &Helper{} mock.Mock.Test(t) diff --git a/mocks/reconciler/option.go b/mocks/reconciler/option.go new file mode 100644 index 00000000..7bd26b75 --- /dev/null +++ b/mocks/reconciler/option.go @@ -0,0 +1,32 @@ +// Code generated by mockery v2.40.3. DO NOT EDIT. + +package reconciler + +import ( + reconciler "github.com/coinbase/rosetta-sdk-go/reconciler" + mock "github.com/stretchr/testify/mock" +) + +// Option is an autogenerated mock type for the Option type +type Option struct { + mock.Mock +} + +// Execute provides a mock function with given fields: r +func (_m *Option) Execute(r *reconciler.Reconciler) { + _m.Called(r) +} + +// NewOption creates a new instance of Option. 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 NewOption(t interface { + mock.TestingT + Cleanup(func()) +}) *Option { + mock := &Option{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/storage/database/badger_option.go b/mocks/storage/database/badger_option.go index 4bfcc342..0af5603e 100644 --- a/mocks/storage/database/badger_option.go +++ b/mocks/storage/database/badger_option.go @@ -1,11 +1,10 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package database import ( - mock "github.com/stretchr/testify/mock" - database "github.com/coinbase/rosetta-sdk-go/storage/database" + mock "github.com/stretchr/testify/mock" ) // BadgerOption is an autogenerated mock type for the BadgerOption type @@ -18,13 +17,12 @@ func (_m *BadgerOption) Execute(b *database.BadgerDatabase) { _m.Called(b) } -type mockConstructorTestingTNewBadgerOption interface { +// NewBadgerOption creates a new instance of BadgerOption. 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 NewBadgerOption(t interface { mock.TestingT Cleanup(func()) -} - -// NewBadgerOption creates a new instance of BadgerOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewBadgerOption(t mockConstructorTestingTNewBadgerOption) *BadgerOption { +}) *BadgerOption { mock := &BadgerOption{} mock.Mock.Test(t) diff --git a/mocks/storage/database/commit_worker.go b/mocks/storage/database/commit_worker.go index 1da605f9..98ace4b8 100644 --- a/mocks/storage/database/commit_worker.go +++ b/mocks/storage/database/commit_worker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package database @@ -17,6 +17,10 @@ type CommitWorker struct { func (_m *CommitWorker) Execute(_a0 context.Context) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Execute") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(_a0) @@ -27,13 +31,12 @@ func (_m *CommitWorker) Execute(_a0 context.Context) error { return r0 } -type mockConstructorTestingTNewCommitWorker interface { +// NewCommitWorker creates a new instance of CommitWorker. 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 NewCommitWorker(t interface { mock.TestingT Cleanup(func()) -} - -// NewCommitWorker creates a new instance of CommitWorker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewCommitWorker(t mockConstructorTestingTNewCommitWorker) *CommitWorker { +}) *CommitWorker { mock := &CommitWorker{} mock.Mock.Test(t) diff --git a/mocks/storage/database/database.go b/mocks/storage/database/database.go index 5af08072..7d721e0d 100644 --- a/mocks/storage/database/database.go +++ b/mocks/storage/database/database.go @@ -1,14 +1,14 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package database import ( context "context" - mock "github.com/stretchr/testify/mock" - database "github.com/coinbase/rosetta-sdk-go/storage/database" encoder "github.com/coinbase/rosetta-sdk-go/storage/encoder" + + mock "github.com/stretchr/testify/mock" ) // Database is an autogenerated mock type for the Database type @@ -20,6 +20,10 @@ type Database struct { func (_m *Database) Close(_a0 context.Context) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Close") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(_a0) @@ -34,6 +38,10 @@ func (_m *Database) Close(_a0 context.Context) error { func (_m *Database) Encoder() *encoder.Encoder { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Encoder") + } + var r0 *encoder.Encoder if rf, ok := ret.Get(0).(func() *encoder.Encoder); ok { r0 = rf() @@ -46,10 +54,32 @@ func (_m *Database) Encoder() *encoder.Encoder { return r0 } +// GetMetaData provides a mock function with given fields: +func (_m *Database) GetMetaData() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetMetaData") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + // ReadTransaction provides a mock function with given fields: _a0 func (_m *Database) ReadTransaction(_a0 context.Context) database.Transaction { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ReadTransaction") + } + var r0 database.Transaction if rf, ok := ret.Get(0).(func(context.Context) database.Transaction); ok { r0 = rf(_a0) @@ -66,6 +96,10 @@ func (_m *Database) ReadTransaction(_a0 context.Context) database.Transaction { func (_m *Database) Transaction(_a0 context.Context) database.Transaction { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Transaction") + } + var r0 database.Transaction if rf, ok := ret.Get(0).(func(context.Context) database.Transaction); ok { r0 = rf(_a0) @@ -82,6 +116,10 @@ func (_m *Database) Transaction(_a0 context.Context) database.Transaction { func (_m *Database) WriteTransaction(ctx context.Context, identifier string, priority bool) database.Transaction { ret := _m.Called(ctx, identifier, priority) + if len(ret) == 0 { + panic("no return value specified for WriteTransaction") + } + var r0 database.Transaction if rf, ok := ret.Get(0).(func(context.Context, string, bool) database.Transaction); ok { r0 = rf(ctx, identifier, priority) @@ -94,13 +132,12 @@ func (_m *Database) WriteTransaction(ctx context.Context, identifier string, pri return r0 } -type mockConstructorTestingTNewDatabase interface { +// NewDatabase creates a new instance of Database. 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 NewDatabase(t interface { mock.TestingT Cleanup(func()) -} - -// NewDatabase creates a new instance of Database. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewDatabase(t mockConstructorTestingTNewDatabase) *Database { +}) *Database { mock := &Database{} mock.Mock.Test(t) diff --git a/mocks/storage/database/transaction.go b/mocks/storage/database/transaction.go index b3048aab..d8435245 100644 --- a/mocks/storage/database/transaction.go +++ b/mocks/storage/database/transaction.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package database @@ -17,6 +17,10 @@ type Transaction struct { func (_m *Transaction) Commit(_a0 context.Context) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Commit") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(_a0) @@ -31,6 +35,10 @@ func (_m *Transaction) Commit(_a0 context.Context) error { func (_m *Transaction) Delete(_a0 context.Context, _a1 []byte) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Delete") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, []byte) error); ok { r0 = rf(_a0, _a1) @@ -50,14 +58,22 @@ func (_m *Transaction) Discard(_a0 context.Context) { func (_m *Transaction) Get(_a0 context.Context, _a1 []byte) (bool, []byte, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Get") + } + var r0 bool + var r1 []byte + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, []byte) (bool, []byte, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, []byte) bool); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(bool) } - var r1 []byte if rf, ok := ret.Get(1).(func(context.Context, []byte) []byte); ok { r1 = rf(_a0, _a1) } else { @@ -66,7 +82,6 @@ func (_m *Transaction) Get(_a0 context.Context, _a1 []byte) (bool, []byte, error } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, []byte) error); ok { r2 = rf(_a0, _a1) } else { @@ -80,14 +95,21 @@ func (_m *Transaction) Get(_a0 context.Context, _a1 []byte) (bool, []byte, error func (_m *Transaction) Scan(_a0 context.Context, _a1 []byte, _a2 []byte, _a3 func([]byte, []byte) error, _a4 bool, _a5 bool) (int, error) { ret := _m.Called(_a0, _a1, _a2, _a3, _a4, _a5) + if len(ret) == 0 { + panic("no return value specified for Scan") + } + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte, func([]byte, []byte) error, bool, bool) (int, error)); ok { + return rf(_a0, _a1, _a2, _a3, _a4, _a5) + } if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte, func([]byte, []byte) error, bool, bool) int); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4, _a5) } else { r0 = ret.Get(0).(int) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, []byte, []byte, func([]byte, []byte) error, bool, bool) error); ok { r1 = rf(_a0, _a1, _a2, _a3, _a4, _a5) } else { @@ -101,6 +123,10 @@ func (_m *Transaction) Scan(_a0 context.Context, _a1 []byte, _a2 []byte, _a3 fun func (_m *Transaction) Set(_a0 context.Context, _a1 []byte, _a2 []byte, _a3 bool) error { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for Set") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, []byte, []byte, bool) error); ok { r0 = rf(_a0, _a1, _a2, _a3) @@ -111,13 +137,12 @@ func (_m *Transaction) Set(_a0 context.Context, _a1 []byte, _a2 []byte, _a3 bool return r0 } -type mockConstructorTestingTNewTransaction interface { +// NewTransaction creates a new instance of Transaction. 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 NewTransaction(t interface { mock.TestingT Cleanup(func()) -} - -// NewTransaction creates a new instance of Transaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewTransaction(t mockConstructorTestingTNewTransaction) *Transaction { +}) *Transaction { mock := &Transaction{} mock.Mock.Test(t) diff --git a/mocks/storage/modules/balance_storage_handler.go b/mocks/storage/modules/balance_storage_handler.go index 0acc9257..809945b9 100644 --- a/mocks/storage/modules/balance_storage_handler.go +++ b/mocks/storage/modules/balance_storage_handler.go @@ -1,14 +1,15 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package modules import ( context "context" + database "github.com/coinbase/rosetta-sdk-go/storage/database" mock "github.com/stretchr/testify/mock" parser "github.com/coinbase/rosetta-sdk-go/parser" - database "github.com/coinbase/rosetta-sdk-go/storage/database" + types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -21,6 +22,10 @@ type BalanceStorageHandler struct { func (_m *BalanceStorageHandler) AccountsReconciled(ctx context.Context, dbTx database.Transaction, count int) error { ret := _m.Called(ctx, dbTx, count) + if len(ret) == 0 { + panic("no return value specified for AccountsReconciled") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, int) error); ok { r0 = rf(ctx, dbTx, count) @@ -35,6 +40,10 @@ func (_m *BalanceStorageHandler) AccountsReconciled(ctx context.Context, dbTx da func (_m *BalanceStorageHandler) AccountsSeen(ctx context.Context, dbTx database.Transaction, count int) error { ret := _m.Called(ctx, dbTx, count) + if len(ret) == 0 { + panic("no return value specified for AccountsSeen") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, int) error); ok { r0 = rf(ctx, dbTx, count) @@ -49,6 +58,10 @@ func (_m *BalanceStorageHandler) AccountsSeen(ctx context.Context, dbTx database func (_m *BalanceStorageHandler) BlockAdded(ctx context.Context, block *types.Block, changes []*parser.BalanceChange) error { ret := _m.Called(ctx, block, changes) + if len(ret) == 0 { + panic("no return value specified for BlockAdded") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *types.Block, []*parser.BalanceChange) error); ok { r0 = rf(ctx, block, changes) @@ -63,6 +76,10 @@ func (_m *BalanceStorageHandler) BlockAdded(ctx context.Context, block *types.Bl func (_m *BalanceStorageHandler) BlockRemoved(ctx context.Context, block *types.Block, changes []*parser.BalanceChange) error { ret := _m.Called(ctx, block, changes) + if len(ret) == 0 { + panic("no return value specified for BlockRemoved") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *types.Block, []*parser.BalanceChange) error); ok { r0 = rf(ctx, block, changes) @@ -73,13 +90,12 @@ func (_m *BalanceStorageHandler) BlockRemoved(ctx context.Context, block *types. return r0 } -type mockConstructorTestingTNewBalanceStorageHandler interface { +// NewBalanceStorageHandler creates a new instance of BalanceStorageHandler. 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 NewBalanceStorageHandler(t interface { mock.TestingT Cleanup(func()) -} - -// NewBalanceStorageHandler creates a new instance of BalanceStorageHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewBalanceStorageHandler(t mockConstructorTestingTNewBalanceStorageHandler) *BalanceStorageHandler { +}) *BalanceStorageHandler { mock := &BalanceStorageHandler{} mock.Mock.Test(t) diff --git a/mocks/storage/modules/balance_storage_helper.go b/mocks/storage/modules/balance_storage_helper.go index 825d8b9e..2fdd02b9 100644 --- a/mocks/storage/modules/balance_storage_helper.go +++ b/mocks/storage/modules/balance_storage_helper.go @@ -1,16 +1,20 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package modules import ( - context "context" big "math/big" + asserter "github.com/coinbase/rosetta-sdk-go/asserter" + + context "context" + + database "github.com/coinbase/rosetta-sdk-go/storage/database" + mock "github.com/stretchr/testify/mock" - asserter "github.com/coinbase/rosetta-sdk-go/asserter" parser "github.com/coinbase/rosetta-sdk-go/parser" - database "github.com/coinbase/rosetta-sdk-go/storage/database" + types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -23,7 +27,15 @@ type BalanceStorageHelper struct { func (_m *BalanceStorageHelper) AccountBalance(ctx context.Context, account *types.AccountIdentifier, currency *types.Currency, block *types.BlockIdentifier) (*types.Amount, error) { ret := _m.Called(ctx, account, currency, block) + if len(ret) == 0 { + panic("no return value specified for AccountBalance") + } + var r0 *types.Amount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, *types.BlockIdentifier) (*types.Amount, error)); ok { + return rf(ctx, account, currency, block) + } if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, *types.BlockIdentifier) *types.Amount); ok { r0 = rf(ctx, account, currency, block) } else { @@ -32,7 +44,6 @@ func (_m *BalanceStorageHelper) AccountBalance(ctx context.Context, account *typ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.AccountIdentifier, *types.Currency, *types.BlockIdentifier) error); ok { r1 = rf(ctx, account, currency, block) } else { @@ -46,7 +57,15 @@ func (_m *BalanceStorageHelper) AccountBalance(ctx context.Context, account *typ func (_m *BalanceStorageHelper) AccountsReconciled(ctx context.Context, dbTx database.Transaction) (*big.Int, error) { ret := _m.Called(ctx, dbTx) + if len(ret) == 0 { + panic("no return value specified for AccountsReconciled") + } + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) (*big.Int, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) *big.Int); ok { r0 = rf(ctx, dbTx) } else { @@ -55,7 +74,6 @@ func (_m *BalanceStorageHelper) AccountsReconciled(ctx context.Context, dbTx dat } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(ctx, dbTx) } else { @@ -69,7 +87,15 @@ func (_m *BalanceStorageHelper) AccountsReconciled(ctx context.Context, dbTx dat func (_m *BalanceStorageHelper) AccountsSeen(ctx context.Context, dbTx database.Transaction) (*big.Int, error) { ret := _m.Called(ctx, dbTx) + if len(ret) == 0 { + panic("no return value specified for AccountsSeen") + } + var r0 *big.Int + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) (*big.Int, error)); ok { + return rf(ctx, dbTx) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) *big.Int); ok { r0 = rf(ctx, dbTx) } else { @@ -78,7 +104,6 @@ func (_m *BalanceStorageHelper) AccountsSeen(ctx context.Context, dbTx database. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(ctx, dbTx) } else { @@ -92,6 +117,10 @@ func (_m *BalanceStorageHelper) AccountsSeen(ctx context.Context, dbTx database. func (_m *BalanceStorageHelper) Asserter() *asserter.Asserter { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Asserter") + } + var r0 *asserter.Asserter if rf, ok := ret.Get(0).(func() *asserter.Asserter); ok { r0 = rf() @@ -108,6 +137,10 @@ func (_m *BalanceStorageHelper) Asserter() *asserter.Asserter { func (_m *BalanceStorageHelper) BalanceExemptions() []*types.BalanceExemption { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for BalanceExemptions") + } + var r0 []*types.BalanceExemption if rf, ok := ret.Get(0).(func() []*types.BalanceExemption); ok { r0 = rf() @@ -124,6 +157,10 @@ func (_m *BalanceStorageHelper) BalanceExemptions() []*types.BalanceExemption { func (_m *BalanceStorageHelper) ExemptFunc() parser.ExemptOperation { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ExemptFunc") + } + var r0 parser.ExemptOperation if rf, ok := ret.Get(0).(func() parser.ExemptOperation); ok { r0 = rf() @@ -136,13 +173,12 @@ func (_m *BalanceStorageHelper) ExemptFunc() parser.ExemptOperation { return r0 } -type mockConstructorTestingTNewBalanceStorageHelper interface { +// NewBalanceStorageHelper creates a new instance of BalanceStorageHelper. 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 NewBalanceStorageHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewBalanceStorageHelper creates a new instance of BalanceStorageHelper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewBalanceStorageHelper(t mockConstructorTestingTNewBalanceStorageHelper) *BalanceStorageHelper { +}) *BalanceStorageHelper { mock := &BalanceStorageHelper{} mock.Mock.Test(t) diff --git a/mocks/storage/modules/block_worker.go b/mocks/storage/modules/block_worker.go index e6e60de8..11bb6de0 100644 --- a/mocks/storage/modules/block_worker.go +++ b/mocks/storage/modules/block_worker.go @@ -1,14 +1,15 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package modules import ( context "context" + database "github.com/coinbase/rosetta-sdk-go/storage/database" errgroup "github.com/neilotoole/errgroup" + mock "github.com/stretchr/testify/mock" - database "github.com/coinbase/rosetta-sdk-go/storage/database" types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -21,7 +22,15 @@ type BlockWorker struct { func (_m *BlockWorker) AddingBlock(_a0 context.Context, _a1 *errgroup.Group, _a2 *types.Block, _a3 database.Transaction) (database.CommitWorker, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for AddingBlock") + } + var r0 database.CommitWorker + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *errgroup.Group, *types.Block, database.Transaction) (database.CommitWorker, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *errgroup.Group, *types.Block, database.Transaction) database.CommitWorker); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -30,7 +39,6 @@ func (_m *BlockWorker) AddingBlock(_a0 context.Context, _a1 *errgroup.Group, _a2 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *errgroup.Group, *types.Block, database.Transaction) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -44,7 +52,15 @@ func (_m *BlockWorker) AddingBlock(_a0 context.Context, _a1 *errgroup.Group, _a2 func (_m *BlockWorker) RemovingBlock(_a0 context.Context, _a1 *errgroup.Group, _a2 *types.Block, _a3 database.Transaction) (database.CommitWorker, error) { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for RemovingBlock") + } + var r0 database.CommitWorker + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *errgroup.Group, *types.Block, database.Transaction) (database.CommitWorker, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, *errgroup.Group, *types.Block, database.Transaction) database.CommitWorker); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { @@ -53,7 +69,6 @@ func (_m *BlockWorker) RemovingBlock(_a0 context.Context, _a1 *errgroup.Group, _ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *errgroup.Group, *types.Block, database.Transaction) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -63,13 +78,12 @@ func (_m *BlockWorker) RemovingBlock(_a0 context.Context, _a1 *errgroup.Group, _ return r0, r1 } -type mockConstructorTestingTNewBlockWorker interface { +// NewBlockWorker creates a new instance of BlockWorker. 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 NewBlockWorker(t interface { mock.TestingT Cleanup(func()) -} - -// NewBlockWorker creates a new instance of BlockWorker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewBlockWorker(t mockConstructorTestingTNewBlockWorker) *BlockWorker { +}) *BlockWorker { mock := &BlockWorker{} mock.Mock.Test(t) diff --git a/mocks/storage/modules/broadcast_storage_handler.go b/mocks/storage/modules/broadcast_storage_handler.go index d1c01c64..aa5a28ce 100644 --- a/mocks/storage/modules/broadcast_storage_handler.go +++ b/mocks/storage/modules/broadcast_storage_handler.go @@ -1,13 +1,13 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package modules import ( context "context" + database "github.com/coinbase/rosetta-sdk-go/storage/database" mock "github.com/stretchr/testify/mock" - database "github.com/coinbase/rosetta-sdk-go/storage/database" types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -20,6 +20,10 @@ type BroadcastStorageHandler struct { func (_m *BroadcastStorageHandler) BroadcastFailed(_a0 context.Context, _a1 database.Transaction, _a2 string, _a3 *types.TransactionIdentifier, _a4 []*types.Operation) error { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + if len(ret) == 0 { + panic("no return value specified for BroadcastFailed") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string, *types.TransactionIdentifier, []*types.Operation) error); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4) @@ -34,6 +38,10 @@ func (_m *BroadcastStorageHandler) BroadcastFailed(_a0 context.Context, _a1 data func (_m *BroadcastStorageHandler) TransactionConfirmed(_a0 context.Context, _a1 database.Transaction, _a2 string, _a3 *types.BlockIdentifier, _a4 *types.Transaction, _a5 []*types.Operation, _a6 map[string]interface{}) error { ret := _m.Called(_a0, _a1, _a2, _a3, _a4, _a5, _a6) + if len(ret) == 0 { + panic("no return value specified for TransactionConfirmed") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string, *types.BlockIdentifier, *types.Transaction, []*types.Operation, map[string]interface{}) error); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4, _a5, _a6) @@ -48,6 +56,10 @@ func (_m *BroadcastStorageHandler) TransactionConfirmed(_a0 context.Context, _a1 func (_m *BroadcastStorageHandler) TransactionStale(_a0 context.Context, _a1 database.Transaction, _a2 string, _a3 *types.TransactionIdentifier) error { ret := _m.Called(_a0, _a1, _a2, _a3) + if len(ret) == 0 { + panic("no return value specified for TransactionStale") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, database.Transaction, string, *types.TransactionIdentifier) error); ok { r0 = rf(_a0, _a1, _a2, _a3) @@ -58,13 +70,12 @@ func (_m *BroadcastStorageHandler) TransactionStale(_a0 context.Context, _a1 dat return r0 } -type mockConstructorTestingTNewBroadcastStorageHandler interface { +// NewBroadcastStorageHandler creates a new instance of BroadcastStorageHandler. 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 NewBroadcastStorageHandler(t interface { mock.TestingT Cleanup(func()) -} - -// NewBroadcastStorageHandler creates a new instance of BroadcastStorageHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewBroadcastStorageHandler(t mockConstructorTestingTNewBroadcastStorageHandler) *BroadcastStorageHandler { +}) *BroadcastStorageHandler { mock := &BroadcastStorageHandler{} mock.Mock.Test(t) diff --git a/mocks/storage/modules/broadcast_storage_helper.go b/mocks/storage/modules/broadcast_storage_helper.go index 02a9a5b2..59645fd1 100644 --- a/mocks/storage/modules/broadcast_storage_helper.go +++ b/mocks/storage/modules/broadcast_storage_helper.go @@ -1,13 +1,13 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package modules import ( context "context" + database "github.com/coinbase/rosetta-sdk-go/storage/database" mock "github.com/stretchr/testify/mock" - database "github.com/coinbase/rosetta-sdk-go/storage/database" types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -20,14 +20,21 @@ type BroadcastStorageHelper struct { func (_m *BroadcastStorageHelper) AtTip(_a0 context.Context, _a1 int64) (bool, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for AtTip") + } + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64) (bool, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, int64) bool); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { r1 = rf(_a0, _a1) } else { @@ -41,7 +48,15 @@ func (_m *BroadcastStorageHelper) AtTip(_a0 context.Context, _a1 int64) (bool, e func (_m *BroadcastStorageHelper) BroadcastTransaction(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 string) (*types.TransactionIdentifier, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for BroadcastTransaction") + } + var r0 *types.TransactionIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, string) (*types.TransactionIdentifier, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, string) *types.TransactionIdentifier); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -50,7 +65,6 @@ func (_m *BroadcastStorageHelper) BroadcastTransaction(_a0 context.Context, _a1 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -64,7 +78,15 @@ func (_m *BroadcastStorageHelper) BroadcastTransaction(_a0 context.Context, _a1 func (_m *BroadcastStorageHelper) CurrentBlockIdentifier(_a0 context.Context) (*types.BlockIdentifier, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for CurrentBlockIdentifier") + } + var r0 *types.BlockIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*types.BlockIdentifier, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *types.BlockIdentifier); ok { r0 = rf(_a0) } else { @@ -73,7 +95,6 @@ func (_m *BroadcastStorageHelper) CurrentBlockIdentifier(_a0 context.Context) (* } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -87,7 +108,16 @@ func (_m *BroadcastStorageHelper) CurrentBlockIdentifier(_a0 context.Context) (* func (_m *BroadcastStorageHelper) FindTransaction(_a0 context.Context, _a1 *types.TransactionIdentifier, _a2 database.Transaction) (*types.BlockIdentifier, *types.Transaction, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for FindTransaction") + } + var r0 *types.BlockIdentifier + var r1 *types.Transaction + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *types.TransactionIdentifier, database.Transaction) (*types.BlockIdentifier, *types.Transaction, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, *types.TransactionIdentifier, database.Transaction) *types.BlockIdentifier); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -96,7 +126,6 @@ func (_m *BroadcastStorageHelper) FindTransaction(_a0 context.Context, _a1 *type } } - var r1 *types.Transaction if rf, ok := ret.Get(1).(func(context.Context, *types.TransactionIdentifier, database.Transaction) *types.Transaction); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -105,7 +134,6 @@ func (_m *BroadcastStorageHelper) FindTransaction(_a0 context.Context, _a1 *type } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *types.TransactionIdentifier, database.Transaction) error); ok { r2 = rf(_a0, _a1, _a2) } else { @@ -115,13 +143,12 @@ func (_m *BroadcastStorageHelper) FindTransaction(_a0 context.Context, _a1 *type return r0, r1, r2 } -type mockConstructorTestingTNewBroadcastStorageHelper interface { +// NewBroadcastStorageHelper creates a new instance of BroadcastStorageHelper. 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 NewBroadcastStorageHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewBroadcastStorageHelper creates a new instance of BroadcastStorageHelper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewBroadcastStorageHelper(t mockConstructorTestingTNewBroadcastStorageHelper) *BroadcastStorageHelper { +}) *BroadcastStorageHelper { mock := &BroadcastStorageHelper{} mock.Mock.Test(t) diff --git a/mocks/storage/modules/coin_storage_helper.go b/mocks/storage/modules/coin_storage_helper.go index c4fb853c..15902920 100644 --- a/mocks/storage/modules/coin_storage_helper.go +++ b/mocks/storage/modules/coin_storage_helper.go @@ -1,13 +1,13 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package modules import ( context "context" + database "github.com/coinbase/rosetta-sdk-go/storage/database" mock "github.com/stretchr/testify/mock" - database "github.com/coinbase/rosetta-sdk-go/storage/database" types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -20,7 +20,15 @@ type CoinStorageHelper struct { func (_m *CoinStorageHelper) CurrentBlockIdentifier(_a0 context.Context, _a1 database.Transaction) (*types.BlockIdentifier, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for CurrentBlockIdentifier") + } + var r0 *types.BlockIdentifier + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) (*types.BlockIdentifier, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, database.Transaction) *types.BlockIdentifier); ok { r0 = rf(_a0, _a1) } else { @@ -29,7 +37,6 @@ func (_m *CoinStorageHelper) CurrentBlockIdentifier(_a0 context.Context, _a1 dat } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, database.Transaction) error); ok { r1 = rf(_a0, _a1) } else { @@ -39,13 +46,12 @@ func (_m *CoinStorageHelper) CurrentBlockIdentifier(_a0 context.Context, _a1 dat return r0, r1 } -type mockConstructorTestingTNewCoinStorageHelper interface { +// NewCoinStorageHelper creates a new instance of CoinStorageHelper. 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 NewCoinStorageHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewCoinStorageHelper creates a new instance of CoinStorageHelper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewCoinStorageHelper(t mockConstructorTestingTNewCoinStorageHelper) *CoinStorageHelper { +}) *CoinStorageHelper { mock := &CoinStorageHelper{} mock.Mock.Test(t) diff --git a/mocks/syncer/handler.go b/mocks/syncer/handler.go index 59f7dec4..277b6d87 100644 --- a/mocks/syncer/handler.go +++ b/mocks/syncer/handler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package syncer @@ -19,6 +19,10 @@ type Handler struct { func (_m *Handler) BlockAdded(ctx context.Context, block *types.Block) error { ret := _m.Called(ctx, block) + if len(ret) == 0 { + panic("no return value specified for BlockAdded") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *types.Block) error); ok { r0 = rf(ctx, block) @@ -33,6 +37,10 @@ func (_m *Handler) BlockAdded(ctx context.Context, block *types.Block) error { func (_m *Handler) BlockRemoved(ctx context.Context, block *types.BlockIdentifier) error { ret := _m.Called(ctx, block) + if len(ret) == 0 { + panic("no return value specified for BlockRemoved") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *types.BlockIdentifier) error); ok { r0 = rf(ctx, block) @@ -47,6 +55,10 @@ func (_m *Handler) BlockRemoved(ctx context.Context, block *types.BlockIdentifie func (_m *Handler) BlockSeen(ctx context.Context, block *types.Block) error { ret := _m.Called(ctx, block) + if len(ret) == 0 { + panic("no return value specified for BlockSeen") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *types.Block) error); ok { r0 = rf(ctx, block) @@ -57,13 +69,12 @@ func (_m *Handler) BlockSeen(ctx context.Context, block *types.Block) error { return r0 } -type mockConstructorTestingTNewHandler interface { +// NewHandler creates a new instance of Handler. 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 NewHandler(t interface { mock.TestingT Cleanup(func()) -} - -// NewHandler creates a new instance of Handler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewHandler(t mockConstructorTestingTNewHandler) *Handler { +}) *Handler { mock := &Handler{} mock.Mock.Test(t) diff --git a/mocks/syncer/helper.go b/mocks/syncer/helper.go index 493df06b..83e915ce 100644 --- a/mocks/syncer/helper.go +++ b/mocks/syncer/helper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package syncer @@ -19,7 +19,15 @@ type Helper struct { func (_m *Helper) Block(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 *types.PartialBlockIdentifier) (*types.Block, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for Block") + } + var r0 *types.Block + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.PartialBlockIdentifier) (*types.Block, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.PartialBlockIdentifier) *types.Block); ok { r0 = rf(_a0, _a1, _a2) } else { @@ -28,7 +36,6 @@ func (_m *Helper) Block(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 * } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, *types.PartialBlockIdentifier) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -42,7 +49,15 @@ func (_m *Helper) Block(_a0 context.Context, _a1 *types.NetworkIdentifier, _a2 * func (_m *Helper) NetworkStatus(_a0 context.Context, _a1 *types.NetworkIdentifier) (*types.NetworkStatusResponse, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for NetworkStatus") + } + var r0 *types.NetworkStatusResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier) (*types.NetworkStatusResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier) *types.NetworkStatusResponse); ok { r0 = rf(_a0, _a1) } else { @@ -51,7 +66,6 @@ func (_m *Helper) NetworkStatus(_a0 context.Context, _a1 *types.NetworkIdentifie } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier) error); ok { r1 = rf(_a0, _a1) } else { @@ -61,13 +75,12 @@ func (_m *Helper) NetworkStatus(_a0 context.Context, _a1 *types.NetworkIdentifie return r0, r1 } -type mockConstructorTestingTNewHelper interface { +// NewHelper creates a new instance of Helper. 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 NewHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewHelper creates a new instance of Helper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewHelper(t mockConstructorTestingTNewHelper) *Helper { +}) *Helper { mock := &Helper{} mock.Mock.Test(t) diff --git a/mocks/syncer/option.go b/mocks/syncer/option.go new file mode 100644 index 00000000..f53abff1 --- /dev/null +++ b/mocks/syncer/option.go @@ -0,0 +1,32 @@ +// Code generated by mockery v2.40.3. DO NOT EDIT. + +package syncer + +import ( + syncer "github.com/coinbase/rosetta-sdk-go/syncer" + mock "github.com/stretchr/testify/mock" +) + +// Option is an autogenerated mock type for the Option type +type Option struct { + mock.Mock +} + +// Execute provides a mock function with given fields: s +func (_m *Option) Execute(s *syncer.Syncer) { + _m.Called(s) +} + +// NewOption creates a new instance of Option. 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 NewOption(t interface { + mock.TestingT + Cleanup(func()) +}) *Option { + mock := &Option{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/utils/block_storage_helper.go b/mocks/utils/block_storage_helper.go index a75cc41b..b052f3b1 100644 --- a/mocks/utils/block_storage_helper.go +++ b/mocks/utils/block_storage_helper.go @@ -1,13 +1,12 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package utils import ( context "context" - mock "github.com/stretchr/testify/mock" - types "github.com/coinbase/rosetta-sdk-go/types" + mock "github.com/stretchr/testify/mock" ) // BlockStorageHelper is an autogenerated mock type for the BlockStorageHelper type @@ -19,7 +18,15 @@ type BlockStorageHelper struct { func (_m *BlockStorageHelper) GetBlockLazy(ctx context.Context, blockIdentifier *types.PartialBlockIdentifier) (*types.BlockResponse, error) { ret := _m.Called(ctx, blockIdentifier) + if len(ret) == 0 { + panic("no return value specified for GetBlockLazy") + } + var r0 *types.BlockResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.PartialBlockIdentifier) (*types.BlockResponse, error)); ok { + return rf(ctx, blockIdentifier) + } if rf, ok := ret.Get(0).(func(context.Context, *types.PartialBlockIdentifier) *types.BlockResponse); ok { r0 = rf(ctx, blockIdentifier) } else { @@ -28,7 +35,6 @@ func (_m *BlockStorageHelper) GetBlockLazy(ctx context.Context, blockIdentifier } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.PartialBlockIdentifier) error); ok { r1 = rf(ctx, blockIdentifier) } else { @@ -38,13 +44,12 @@ func (_m *BlockStorageHelper) GetBlockLazy(ctx context.Context, blockIdentifier return r0, r1 } -type mockConstructorTestingTNewBlockStorageHelper interface { +// NewBlockStorageHelper creates a new instance of BlockStorageHelper. 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 NewBlockStorageHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewBlockStorageHelper creates a new instance of BlockStorageHelper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewBlockStorageHelper(t mockConstructorTestingTNewBlockStorageHelper) *BlockStorageHelper { +}) *BlockStorageHelper { mock := &BlockStorageHelper{} mock.Mock.Test(t) diff --git a/mocks/utils/fetcher_helper.go b/mocks/utils/fetcher_helper.go index 46031981..0d0eff08 100644 --- a/mocks/utils/fetcher_helper.go +++ b/mocks/utils/fetcher_helper.go @@ -1,13 +1,13 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.40.3. DO NOT EDIT. package utils import ( context "context" + fetcher "github.com/coinbase/rosetta-sdk-go/fetcher" mock "github.com/stretchr/testify/mock" - fetcher "github.com/coinbase/rosetta-sdk-go/fetcher" types "github.com/coinbase/rosetta-sdk-go/types" ) @@ -20,7 +20,17 @@ type FetcherHelper struct { func (_m *FetcherHelper) AccountBalanceRetry(ctx context.Context, network *types.NetworkIdentifier, account *types.AccountIdentifier, block *types.PartialBlockIdentifier, currencies []*types.Currency) (*types.BlockIdentifier, []*types.Amount, map[string]interface{}, *fetcher.Error) { ret := _m.Called(ctx, network, account, block, currencies) + if len(ret) == 0 { + panic("no return value specified for AccountBalanceRetry") + } + var r0 *types.BlockIdentifier + var r1 []*types.Amount + var r2 map[string]interface{} + var r3 *fetcher.Error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, *types.PartialBlockIdentifier, []*types.Currency) (*types.BlockIdentifier, []*types.Amount, map[string]interface{}, *fetcher.Error)); ok { + return rf(ctx, network, account, block, currencies) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, *types.PartialBlockIdentifier, []*types.Currency) *types.BlockIdentifier); ok { r0 = rf(ctx, network, account, block, currencies) } else { @@ -29,7 +39,6 @@ func (_m *FetcherHelper) AccountBalanceRetry(ctx context.Context, network *types } } - var r1 []*types.Amount if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, *types.PartialBlockIdentifier, []*types.Currency) []*types.Amount); ok { r1 = rf(ctx, network, account, block, currencies) } else { @@ -38,7 +47,6 @@ func (_m *FetcherHelper) AccountBalanceRetry(ctx context.Context, network *types } } - var r2 map[string]interface{} if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, *types.PartialBlockIdentifier, []*types.Currency) map[string]interface{}); ok { r2 = rf(ctx, network, account, block, currencies) } else { @@ -47,7 +55,6 @@ func (_m *FetcherHelper) AccountBalanceRetry(ctx context.Context, network *types } } - var r3 *fetcher.Error if rf, ok := ret.Get(3).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, *types.PartialBlockIdentifier, []*types.Currency) *fetcher.Error); ok { r3 = rf(ctx, network, account, block, currencies) } else { @@ -63,7 +70,17 @@ func (_m *FetcherHelper) AccountBalanceRetry(ctx context.Context, network *types func (_m *FetcherHelper) AccountCoinsRetry(ctx context.Context, network *types.NetworkIdentifier, acct *types.AccountIdentifier, includeMempool bool, currencies []*types.Currency) (*types.BlockIdentifier, []*types.Coin, map[string]interface{}, *fetcher.Error) { ret := _m.Called(ctx, network, acct, includeMempool, currencies) + if len(ret) == 0 { + panic("no return value specified for AccountCoinsRetry") + } + var r0 *types.BlockIdentifier + var r1 []*types.Coin + var r2 map[string]interface{} + var r3 *fetcher.Error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, bool, []*types.Currency) (*types.BlockIdentifier, []*types.Coin, map[string]interface{}, *fetcher.Error)); ok { + return rf(ctx, network, acct, includeMempool, currencies) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, bool, []*types.Currency) *types.BlockIdentifier); ok { r0 = rf(ctx, network, acct, includeMempool, currencies) } else { @@ -72,7 +89,6 @@ func (_m *FetcherHelper) AccountCoinsRetry(ctx context.Context, network *types.N } } - var r1 []*types.Coin if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, bool, []*types.Currency) []*types.Coin); ok { r1 = rf(ctx, network, acct, includeMempool, currencies) } else { @@ -81,7 +97,6 @@ func (_m *FetcherHelper) AccountCoinsRetry(ctx context.Context, network *types.N } } - var r2 map[string]interface{} if rf, ok := ret.Get(2).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, bool, []*types.Currency) map[string]interface{}); ok { r2 = rf(ctx, network, acct, includeMempool, currencies) } else { @@ -90,7 +105,6 @@ func (_m *FetcherHelper) AccountCoinsRetry(ctx context.Context, network *types.N } } - var r3 *fetcher.Error if rf, ok := ret.Get(3).(func(context.Context, *types.NetworkIdentifier, *types.AccountIdentifier, bool, []*types.Currency) *fetcher.Error); ok { r3 = rf(ctx, network, acct, includeMempool, currencies) } else { @@ -106,7 +120,15 @@ func (_m *FetcherHelper) AccountCoinsRetry(ctx context.Context, network *types.N func (_m *FetcherHelper) NetworkList(ctx context.Context, metadata map[string]interface{}) (*types.NetworkListResponse, *fetcher.Error) { ret := _m.Called(ctx, metadata) + if len(ret) == 0 { + panic("no return value specified for NetworkList") + } + var r0 *types.NetworkListResponse + var r1 *fetcher.Error + if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) (*types.NetworkListResponse, *fetcher.Error)); ok { + return rf(ctx, metadata) + } if rf, ok := ret.Get(0).(func(context.Context, map[string]interface{}) *types.NetworkListResponse); ok { r0 = rf(ctx, metadata) } else { @@ -115,7 +137,6 @@ func (_m *FetcherHelper) NetworkList(ctx context.Context, metadata map[string]in } } - var r1 *fetcher.Error if rf, ok := ret.Get(1).(func(context.Context, map[string]interface{}) *fetcher.Error); ok { r1 = rf(ctx, metadata) } else { @@ -131,7 +152,15 @@ func (_m *FetcherHelper) NetworkList(ctx context.Context, metadata map[string]in func (_m *FetcherHelper) NetworkStatusRetry(ctx context.Context, network *types.NetworkIdentifier, metadata map[string]interface{}) (*types.NetworkStatusResponse, *fetcher.Error) { ret := _m.Called(ctx, network, metadata) + if len(ret) == 0 { + panic("no return value specified for NetworkStatusRetry") + } + var r0 *types.NetworkStatusResponse + var r1 *fetcher.Error + if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, map[string]interface{}) (*types.NetworkStatusResponse, *fetcher.Error)); ok { + return rf(ctx, network, metadata) + } if rf, ok := ret.Get(0).(func(context.Context, *types.NetworkIdentifier, map[string]interface{}) *types.NetworkStatusResponse); ok { r0 = rf(ctx, network, metadata) } else { @@ -140,7 +169,6 @@ func (_m *FetcherHelper) NetworkStatusRetry(ctx context.Context, network *types. } } - var r1 *fetcher.Error if rf, ok := ret.Get(1).(func(context.Context, *types.NetworkIdentifier, map[string]interface{}) *fetcher.Error); ok { r1 = rf(ctx, network, metadata) } else { @@ -152,13 +180,12 @@ func (_m *FetcherHelper) NetworkStatusRetry(ctx context.Context, network *types. return r0, r1 } -type mockConstructorTestingTNewFetcherHelper interface { +// NewFetcherHelper creates a new instance of FetcherHelper. 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 NewFetcherHelper(t interface { mock.TestingT Cleanup(func()) -} - -// NewFetcherHelper creates a new instance of FetcherHelper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewFetcherHelper(t mockConstructorTestingTNewFetcherHelper) *FetcherHelper { +}) *FetcherHelper { mock := &FetcherHelper{} mock.Mock.Test(t)