Skip to content

Commit

Permalink
fix: get wallet endpoint available if swap not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
martinconic committed Oct 11, 2024
1 parent 8b50ae6 commit 9f51982
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,10 @@ func (s *Service) mountBusinessDebug() {
),
})

handle("/wallet", jsonhttp.MethodHandler{
"GET": http.HandlerFunc(s.walletHandler),
})
if s.swapEnabled {
handle("/wallet", jsonhttp.MethodHandler{
"GET": http.HandlerFunc(s.walletHandler),
})
handle("/wallet/withdraw/{coin}", jsonhttp.MethodHandler{
"POST": web.ChainHandlers(
s.gasConfigMiddleware("wallet withdraw"),
Expand Down
22 changes: 11 additions & 11 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,19 +489,19 @@ func NewBee(
}
}

if o.SwapEnable {
chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress)
if err != nil {
return nil, err
}

erc20Address, err := chequebookFactory.ERC20Address(ctx)
if err != nil {
return nil, fmt.Errorf("factory fail: %w", err)
}
chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress)
if err != nil {
return nil, err
}

erc20Service = erc20.New(transactionService, erc20Address)
erc20Address, err := chequebookFactory.ERC20Address(ctx)
if err != nil {
return nil, fmt.Errorf("factory fail: %w", err)
}

erc20Service = erc20.New(transactionService, erc20Address)

Check failure on line 503 in pkg/node/node.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `gofmt`-ed with `-s` (gofmt)
if o.SwapEnable {
if o.ChequebookEnable && chainEnabled {
chequebookService, err = InitChequebookService(
ctx,
Expand Down

0 comments on commit 9f51982

Please sign in to comment.