This commit is contained in:
lash 2025-01-21 15:30:22 +00:00
parent e0b5398098
commit ee574908d4
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
4 changed files with 25 additions and 28 deletions

View File

@ -71,4 +71,3 @@ func LoadConfig() error {
CheckAliasURL, _ = url.JoinPath(dataURLBase, AliasPrefix)
return nil
}

View File

@ -4,8 +4,8 @@ import (
"context"
"git.defalsify.org/vise.git/logging"
dataserviceapi "github.com/grassrootseconomics/ussd-data-service/pkg/api"
"git.grassecon.net/grassrootseconomics/sarafu-api/models"
dataserviceapi "github.com/grassrootseconomics/ussd-data-service/pkg/api"
)
var (
@ -24,42 +24,40 @@ type MockApi struct {
VoucherDataContent *models.VoucherDataResult
}
func(m MockApi) CheckBalance(ctx context.Context, publicKey string) (*models.BalanceResult, error) {
func (m MockApi) CheckBalance(ctx context.Context, publicKey string) (*models.BalanceResult, error) {
return nil, nil
}
func(m MockApi) CreateAccount(ctx context.Context) (*models.AccountResult, error) {
func (m MockApi) CreateAccount(ctx context.Context) (*models.AccountResult, error) {
return nil, nil
}
func(m MockApi) TrackAccountStatus(ctx context.Context, publicKey string) (*models.TrackStatusResult, error) {
func (m MockApi) TrackAccountStatus(ctx context.Context, publicKey string) (*models.TrackStatusResult, error) {
return nil, nil
}
func(m MockApi) FetchVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) {
func (m MockApi) FetchVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) {
logg.DebugCtxf(ctx, "mockapi fetchvouchers", "key", publicKey)
return m.VouchersContent, nil
}
func(m MockApi) FetchTransactions(ctx context.Context, publicKey string) ([]dataserviceapi.Last10TxResponse, error) {
func (m MockApi) FetchTransactions(ctx context.Context, publicKey string) ([]dataserviceapi.Last10TxResponse, error) {
logg.DebugCtxf(ctx, "mockapi fetchtransactions", "key", publicKey)
return m.TransactionsContent, nil
}
func(m MockApi) VoucherData(ctx context.Context, address string) (*models.VoucherDataResult, error) {
func (m MockApi) VoucherData(ctx context.Context, address string) (*models.VoucherDataResult, error) {
return m.VoucherDataContent, nil
}
func(m MockApi) CheckAliasAddress(ctx context.Context, alias string) (*models.AliasAddress, error) {
func (m MockApi) CheckAliasAddress(ctx context.Context, alias string) (*models.AliasAddress, error) {
return nil, nil
}
func(m MockApi) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) {
func (m MockApi) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) {
return nil, nil
}
func(m MockApi) TokenTransfer(ctx context.Context, amount, from, to, tokenAddress string) (*models.TokenTransferResponse, error) {
func (m MockApi) TokenTransfer(ctx context.Context, amount, from, to, tokenAddress string) (*models.TokenTransferResponse, error) {
return nil, nil
}

View File

@ -53,7 +53,7 @@ func (m *MockAccountService) CheckAliasAddress(ctx context.Context, alias string
return args.Get(0).(*models.AliasAddress), args.Error(1)
}
func(m MockAccountService) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) {
func (m MockAccountService) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) {
args := m.Called(publicKey, hint)
return args.Get(0).(*models.RequestAliasResult), args.Error(1)
}