use importable api structs

This commit is contained in:
Carlosokumu 2024-10-21 11:10:23 +03:00
parent d81bc0eefb
commit 4beeb9986a
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -1,8 +1,8 @@
package mocks package mocks
import ( import (
"git.grassecon.net/urdt/ussd/internal/handlers/server"
"git.grassecon.net/urdt/ussd/internal/models" "git.grassecon.net/urdt/ussd/internal/models"
"github.com/grassrootseconomics/eth-custodial/pkg/api"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
) )
@ -11,10 +11,10 @@ type MockAccountService struct {
mock.Mock mock.Mock
} }
func (m *MockAccountService) CreateAccount() (*server.OKResponse, *server.ErrResponse) { func (m *MockAccountService) CreateAccount() (*api.OKResponse, *api.ErrResponse) {
args := m.Called() args := m.Called()
okResponse, ok := args.Get(0).(*server.OKResponse) okResponse, ok := args.Get(0).(*api.OKResponse)
errResponse, err := args.Get(1).(*server.ErrResponse) errResponse, err := args.Get(1).(*api.ErrResponse)
if ok { if ok {
return okResponse, nil return okResponse, nil
@ -36,10 +36,10 @@ func (m *MockAccountService) CheckAccountStatus(trackingId string) (*models.Trac
return args.Get(0).(*models.TrackStatusResponse), args.Error(1) return args.Get(0).(*models.TrackStatusResponse), args.Error(1)
} }
func (m *MockAccountService) TrackAccountStatus(publicKey string) (*server.OKResponse, *server.ErrResponse) { func (m *MockAccountService) TrackAccountStatus(publicKey string) (*api.OKResponse, *api.ErrResponse) {
args := m.Called(publicKey) args := m.Called(publicKey)
okResponse, ok := args.Get(0).(*server.OKResponse) okResponse, ok := args.Get(0).(*api.OKResponse)
errResponse, err := args.Get(1).(*server.ErrResponse) errResponse, err := args.Get(1).(*api.ErrResponse)
if ok { if ok {
return okResponse, nil return okResponse, nil
} }