From 6bb3855c17734caf29ada5f3a759b6da5971c749 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Tue, 27 Oct 2020 10:26:31 -0700 Subject: [PATCH] Update mocks --- indexer/balance_storage_handler.go | 14 +++++++++++++ indexer/balance_storage_helper.go | 14 +++++++++++++ indexer/coin_storage_helper.go | 14 +++++++++++++ mocks/services/indexer.go | 32 ++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+) diff --git a/indexer/balance_storage_handler.go b/indexer/balance_storage_handler.go index 952753e..a7d768c 100644 --- a/indexer/balance_storage_handler.go +++ b/indexer/balance_storage_handler.go @@ -1,3 +1,17 @@ +// Copyright 2020 Coinbase, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package indexer import ( diff --git a/indexer/balance_storage_helper.go b/indexer/balance_storage_helper.go index fc1e0ca..c0445d9 100644 --- a/indexer/balance_storage_helper.go +++ b/indexer/balance_storage_helper.go @@ -1,3 +1,17 @@ +// Copyright 2020 Coinbase, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package indexer import ( diff --git a/indexer/coin_storage_helper.go b/indexer/coin_storage_helper.go index 90f407e..254e58b 100644 --- a/indexer/coin_storage_helper.go +++ b/indexer/coin_storage_helper.go @@ -1,3 +1,17 @@ +// Copyright 2020 Coinbase, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package indexer import ( diff --git a/mocks/services/indexer.go b/mocks/services/indexer.go index a3c4711..749dbec 100644 --- a/mocks/services/indexer.go +++ b/mocks/services/indexer.go @@ -17,6 +17,38 @@ type Indexer struct { mock.Mock } +// GetBalance provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *Indexer) GetBalance(_a0 context.Context, _a1 *types.AccountIdentifier, _a2 *types.Currency, _a3 *types.PartialBlockIdentifier) (*types.Amount, *types.BlockIdentifier, error) { + ret := _m.Called(_a0, _a1, _a2, _a3) + + var r0 *types.Amount + if rf, ok := ret.Get(0).(func(context.Context, *types.AccountIdentifier, *types.Currency, *types.PartialBlockIdentifier) *types.Amount); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Amount) + } + } + + var r1 *types.BlockIdentifier + if rf, ok := ret.Get(1).(func(context.Context, *types.AccountIdentifier, *types.Currency, *types.PartialBlockIdentifier) *types.BlockIdentifier); ok { + r1 = rf(_a0, _a1, _a2, _a3) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(*types.BlockIdentifier) + } + } + + var r2 error + if rf, ok := ret.Get(2).(func(context.Context, *types.AccountIdentifier, *types.Currency, *types.PartialBlockIdentifier) error); ok { + r2 = rf(_a0, _a1, _a2, _a3) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + // GetBlockLazy provides a mock function with given fields: _a0, _a1 func (_m *Indexer) GetBlockLazy(_a0 context.Context, _a1 *types.PartialBlockIdentifier) (*types.BlockResponse, error) { ret := _m.Called(_a0, _a1)