From ee574908d4e272ed9658a6449711d3a02461c073 Mon Sep 17 00:00:00 2001 From: lash Date: Tue, 21 Jan 2025 15:30:22 +0000 Subject: [PATCH] Gofmt --- config/config.go | 1 - event/msg.go | 20 ++++++++++---------- testutil/mocks/api_mock.go | 30 ++++++++++++++---------------- testutil/mocks/service_mock.go | 2 +- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/config/config.go b/config/config.go index fbb6bd8..6ebb5bc 100644 --- a/config/config.go +++ b/config/config.go @@ -71,4 +71,3 @@ func LoadConfig() error { CheckAliasURL, _ = url.JoinPath(dataURLBase, AliasPrefix) return nil } - diff --git a/event/msg.go b/event/msg.go index dac2f73..07abad0 100644 --- a/event/msg.go +++ b/event/msg.go @@ -8,12 +8,12 @@ import ( const ( // TODO: integrate with sarafu-vise-events EventTokenTransferTag = "TOKEN_TRANSFER" - EventTokenMintTag = "TOKEN_MINT" - EventRegistrationTag = "CUSTODIAL_REGISTRATION" + EventTokenMintTag = "TOKEN_MINT" + EventRegistrationTag = "CUSTODIAL_REGISTRATION" ) type Msg struct { - Typ string + Typ string Item any } @@ -26,17 +26,17 @@ type EventCustodialRegistration struct { // fields used for handling token transfer event. type EventTokenTransfer struct { - To string - Value int + To string + Value int VoucherAddress string - TxHash string - From string + TxHash string + From string } type EventTokenMint struct { - To string - Value int - TxHash string + To string + Value int + TxHash string VoucherAddress string } diff --git a/testutil/mocks/api_mock.go b/testutil/mocks/api_mock.go index 20b9a68..b020677 100644 --- a/testutil/mocks/api_mock.go +++ b/testutil/mocks/api_mock.go @@ -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 ( @@ -14,52 +14,50 @@ var ( const ( AliceChecksum = "0xeae046BF396e91f5A8D74f863dC57c107c8a4a70" - BobChecksum = "0xB3117202371853e24B725d4169D87616A7dDb127" - AliceSession = "5553425" + BobChecksum = "0xB3117202371853e24B725d4169D87616A7dDb127" + AliceSession = "5553425" ) type MockApi struct { TransactionsContent []dataserviceapi.Last10TxResponse - VouchersContent []dataserviceapi.TokenHoldings - VoucherDataContent *models.VoucherDataResult + VouchersContent []dataserviceapi.TokenHoldings + 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 } - - diff --git a/testutil/mocks/service_mock.go b/testutil/mocks/service_mock.go index d500508..bfa9222 100644 --- a/testutil/mocks/service_mock.go +++ b/testutil/mocks/service_mock.go @@ -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) }