Skip to content

Commit 9c8c3a6

Browse files
committed
revet: "fix: get wallet endpoint available if swap not enabled (#4859)"
1 parent b8e5c2d commit 9c8c3a6

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

pkg/api/router.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ func (s *Service) mountBusinessDebug() {
532532

533533
handle("/wallet", web.ChainHandlers(
534534
s.checkChequebookAvailability,
535+
s.checkSwapAvailability,
535536
web.FinalHandler(jsonhttp.MethodHandler{
536537
"GET": http.HandlerFunc(s.walletHandler),
537538
}),

pkg/node/node.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -492,19 +492,19 @@ func NewBee(
492492
}
493493
}
494494

495-
chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress)
496-
if err != nil {
497-
return nil, err
498-
}
495+
if o.SwapEnable {
496+
chequebookFactory, err = InitChequebookFactory(logger, chainBackend, chainID, transactionService, o.SwapFactoryAddress)
497+
if err != nil {
498+
return nil, err
499+
}
499500

500-
erc20Address, err := chequebookFactory.ERC20Address(ctx)
501-
if err != nil {
502-
return nil, fmt.Errorf("factory fail: %w", err)
503-
}
501+
erc20Address, err := chequebookFactory.ERC20Address(ctx)
502+
if err != nil {
503+
return nil, fmt.Errorf("factory fail: %w", err)
504+
}
504505

505-
erc20Service = erc20.New(transactionService, erc20Address)
506+
erc20Service = erc20.New(transactionService, erc20Address)
506507

507-
if o.SwapEnable {
508508
if o.ChequebookEnable && chainEnabled {
509509
chequebookService, err = InitChequebookService(
510510
ctx,

0 commit comments

Comments
 (0)