bugfix: properly handle no LES service (#272)
This commit is contained in:
parent
a4d2fdfa4a
commit
9f57cf422f
|
@ -202,6 +202,7 @@ func (m *StatusBackend) registerHandlers() error {
|
|||
var lightEthereum *les.LightEthereum
|
||||
if err := runningNode.Service(&lightEthereum); err != nil {
|
||||
log.Error("Cannot get light ethereum service", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
lightEthereum.StatusBackend.SetAccountsFilterHandler(m.accountManager.AccountsListRequestHandler())
|
||||
|
|
|
@ -14,9 +14,27 @@ import (
|
|||
"github.com/status-im/status-go/geth/node"
|
||||
"github.com/status-im/status-go/geth/params"
|
||||
. "github.com/status-im/status-go/geth/testing"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
func TestStartNodeWithUpstreamEnabled(t *testing.T) {
|
||||
backend := api.NewStatusBackend()
|
||||
require.NotNil(t, backend)
|
||||
|
||||
nodeConfig, err := MakeTestNodeConfig(params.RopstenNetworkID)
|
||||
require.NoError(t, err)
|
||||
|
||||
nodeConfig.UpstreamConfig.Enabled = true
|
||||
|
||||
nodeStarted, err := backend.StartNode(nodeConfig)
|
||||
require.NoError(t, err)
|
||||
defer backend.StopNode()
|
||||
|
||||
<-nodeStarted
|
||||
require.True(t, backend.IsNodeRunning())
|
||||
}
|
||||
|
||||
func TestBackendTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(BackendTestSuite))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue