diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index e60f0aafcbc..39de0d73f8f 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -127,9 +127,6 @@ jobs: - name: Test pingpong id: pingpong run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-pingpong; do echo "waiting for pingpong..."; sleep .3; done' - - name: Test withdraw - id: withdraw - run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-withdraw; do echo "waiting for withdraw..."; sleep .3; done' - name: Test fullconnectivity id: fullconnectivity run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks=ci-full-connectivity; do echo "waiting for full connectivity..."; sleep .3; done' @@ -165,6 +162,9 @@ jobs: - name: Test staking id: stake run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-stake + - name: Test withdraw + id: withdraw + run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-withdraw; do echo "waiting for withdraw..."; sleep .3; done' - name: Test redundancy id: redundancy run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-redundancy diff --git a/pkg/api/wallet.go b/pkg/api/wallet.go index 804d11192d8..b3a9f3c95f3 100644 --- a/pkg/api/wallet.go +++ b/pkg/api/wallet.go @@ -27,10 +27,6 @@ type walletResponse struct { WalletAddress common.Address `json:"walletAddress"` // the address of the bee wallet } -type walletTxResponse struct { - TransactionHash common.Hash `json:"transactionHash"` -} - func (s *Service) walletHandler(w http.ResponseWriter, r *http.Request) { logger := s.logger.WithName("get_wallet").Build() @@ -59,6 +55,10 @@ func (s *Service) walletHandler(w http.ResponseWriter, r *http.Request) { }) } +type walletTxResponse struct { + TransactionHash common.Hash `json:"transactionHash"` +} + func (s *Service) walletWithdrawHandler(w http.ResponseWriter, r *http.Request) { logger := s.logger.WithName("post_wallet_withdraw").Build() diff --git a/pkg/settlement/swap/erc20/erc20.go b/pkg/settlement/swap/erc20/erc20.go index 5b3f23e7bde..510cc43769b 100644 --- a/pkg/settlement/swap/erc20/erc20.go +++ b/pkg/settlement/swap/erc20/erc20.go @@ -25,7 +25,6 @@ var ( type Service interface { BalanceOf(ctx context.Context, address common.Address) (*big.Int, error) Transfer(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error) - Withdraw(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error) } type erc20Service struct { @@ -92,26 +91,3 @@ func (c *erc20Service) Transfer(ctx context.Context, address common.Address, val return txHash, nil } - -func (c *erc20Service) Withdraw(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error) { - callData, err := erc20ABI.Pack("transfer", c.address, value) - if err != nil { - return common.Hash{}, err - } - - request := &transaction.TxRequest{ - To: &address, - Data: callData, - GasPrice: sctx.GetGasPrice(ctx), - GasLimit: sctx.GetGasLimitWithDefault(ctx, 300_000), - Value: big.NewInt(0), - Description: "token withdrawal", - } - - txHash, err := c.transactionService.Send(ctx, request, transaction.DefaultTipBoostPercent) - if err != nil { - return common.Hash{}, err - } - - return txHash, nil -} diff --git a/pkg/settlement/swap/erc20/mock/erc20.go b/pkg/settlement/swap/erc20/mock/erc20.go index 15da78c6d82..8d7652d2fb3 100644 --- a/pkg/settlement/swap/erc20/mock/erc20.go +++ b/pkg/settlement/swap/erc20/mock/erc20.go @@ -16,7 +16,6 @@ import ( type Service struct { balanceOfFunc func(ctx context.Context, address common.Address) (*big.Int, error) transferFunc func(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error) - withdrawFunc func(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error) } func WithBalanceOfFunc(f func(ctx context.Context, address common.Address) (*big.Int, error)) Option { @@ -53,13 +52,6 @@ func (s *Service) Transfer(ctx context.Context, address common.Address, value *b return common.Hash{}, errors.New("Error") } -func (s *Service) Withdraw(ctx context.Context, address common.Address, value *big.Int) (common.Hash, error) { - if s.transferFunc != nil { - return s.withdrawFunc(ctx, address, value) - } - return common.Hash{}, errors.New("Error") -} - // Option is the option passed to the mock Chequebook service type Option interface { apply(*Service)