From 857f564aae7bc94872790a6f35bbb2e663b0cd82 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 21 May 2025 15:22:31 +0300 Subject: [PATCH] Fix: remove the unused publicKey from the GetPoolSwappableVouchers --- dev/api.go | 2 +- remote/account_service.go | 2 +- testutil/mocks/service_mock.go | 4 ++-- testutil/testservice/account_service.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/api.go b/dev/api.go index 43e525b..00e14d8 100644 --- a/dev/api.go +++ b/dev/api.go @@ -852,7 +852,7 @@ func (das *DevAccountService) GetPoolSwappableFromVouchers(ctx context.Context, return swapFromList, nil } -func (das *DevAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) { +func (das *DevAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenHoldings, error) { var swapToList []dataserviceapi.TokenHoldings _, ok := das.pools[poolAddress] if !ok { diff --git a/remote/account_service.go b/remote/account_service.go index 5bf65a8..4050295 100644 --- a/remote/account_service.go +++ b/remote/account_service.go @@ -23,7 +23,7 @@ type AccountService interface { PoolDeposit(ctx context.Context, amount, from, poolAddress, tokenAddress string) (*models.PoolDepositResult, error) FetchTopPools(ctx context.Context) ([]dataserviceapi.PoolDetails, error) GetPoolSwappableFromVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) - GetPoolSwappableVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) + GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenHoldings, error) GetPoolSwapQuote(ctx context.Context, amount, from, fromTokenAddress, poolAddress, toTokenAddress string) (*models.PoolSwapQuoteResult, error) PoolSwap(ctx context.Context, amount, from, fromTokenAddress, poolAddress, toTokenAddress string) (*models.PoolSwapResult, error) GetSwapFromTokenMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.MaxLimitResult, error) diff --git a/testutil/mocks/service_mock.go b/testutil/mocks/service_mock.go index de19d54..1c0ee97 100644 --- a/testutil/mocks/service_mock.go +++ b/testutil/mocks/service_mock.go @@ -86,8 +86,8 @@ func (m MockAccountService) GetPoolSwappableFromVouchers(ctx context.Context, po return args.Get(0).([]dataserviceapi.TokenHoldings), args.Error(1) } -func (m MockAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) { - args := m.Called(poolAddress, publicKey) +func (m MockAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenHoldings, error) { + args := m.Called(poolAddress) return args.Get(0).([]dataserviceapi.TokenHoldings), args.Error(1) } diff --git a/testutil/testservice/account_service.go b/testutil/testservice/account_service.go index 46abb1a..f9c69ef 100644 --- a/testutil/testservice/account_service.go +++ b/testutil/testservice/account_service.go @@ -89,7 +89,7 @@ func (m TestAccountService) GetPoolSwappableFromVouchers(ctx context.Context, po return []dataserviceapi.TokenHoldings{}, nil } -func (m TestAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress, publicKey string) ([]dataserviceapi.TokenHoldings, error) { +func (m TestAccountService) GetPoolSwappableVouchers(ctx context.Context, poolAddress string) ([]dataserviceapi.TokenHoldings, error) { return []dataserviceapi.TokenHoldings{}, nil }