Skip to content

Commit

Permalink
revert: "fix: get wallet endpoint available if swap not enabled (#4859)"
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Dec 24, 2024
1 parent b8e5c2d commit 19d9ff1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ func (s *Service) mountBusinessDebug() {

handle("/wallet", web.ChainHandlers(
s.checkChequebookAvailability,
s.checkSwapAvailability,
web.FinalHandler(jsonhttp.MethodHandler{
"GET": http.HandlerFunc(s.walletHandler),
}),
Expand Down
20 changes: 10 additions & 10 deletions pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,19 +492,19 @@ func NewBee(
}
}

chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress)
if err != nil {
return nil, err
}
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)
}
erc20Address, err := chequebookFactory.ERC20Address(ctx)
if err != nil {
return nil, fmt.Errorf("factory fail: %w", err)
}

erc20Service = erc20.New(transactionService, erc20Address)
erc20Service = erc20.New(transactionService, erc20Address)

if o.SwapEnable {
if o.ChequebookEnable && chainEnabled {
chequebookService, err = InitChequebookService(
ctx,
Expand Down

0 comments on commit 19d9ff1

Please sign in to comment.