Temporarily revert "Remove shh and shhext from APIModules and update tests (#993)"

This reverts commit 7581766470.
This commit is contained in:
Pedro Pombeiro 2018-06-06 15:16:17 +02:00 committed by Pedro Pombeiro
parent 68966af049
commit feed9158bd
6 changed files with 12 additions and 17 deletions

View File

@ -31,9 +31,9 @@ const (
// ListenAddr is an IP address and port of this node (e.g. 127.0.0.1:30303).
ListenAddr = ":0"
// APIModules is a list of modules to expose via HTTP and `CallRPC()` binding.
// We also expose all handlers registered with `rpc.Client.RegisterHandler` to `CallRPC()` binding.
APIModules = "eth,net,web3"
// APIModules is a list of modules to expose via any type of RPC (HTTP, IPC, in-proc)
// we also expose 2 limited personal APIs by overriding them in `api/backend.go`
APIModules = "eth,net,web3,shh,shhext"
// SendTransactionMethodName defines the name for a giving transaction.
SendTransactionMethodName = "eth_sendTransaction"

View File

@ -40,8 +40,7 @@ func (s *RPCTestSuite) TestCallRPC() {
s.NoError(err)
nodeConfig.IPCEnabled = false
nodeConfig.HTTPHost = "" // to make sure that no HTTP interface is started
nodeConfig.APIModules += ",shh" // shh_version normally wouldn't be callable with RPCClient
nodeConfig.HTTPHost = "" // to make sure that no HTTP interface is started
if upstreamEnabled {
networkURL, err := GetRemoteURL()
@ -131,7 +130,7 @@ func (s *RPCTestSuite) TestCallRawResult() {
s.NoError(s.StatusNode.Start(nodeConfig))
client := s.StatusNode.RPCPrivateClient()
client := s.StatusNode.RPCClient()
s.NotNil(client)
jsonResult := client.CallRaw(`{"jsonrpc":"2.0","method":"shh_version","params":[],"id":67}`)

View File

@ -31,7 +31,6 @@ func (s *MailServiceSuite) TestShhextRequestMessagesRPCMethodAvailability() {
s.StartTestNode(func(config *params.NodeConfig) {
config.RPCEnabled = true
config.APIModules = "shhext"
})
defer s.StopTestNode()

View File

@ -62,7 +62,7 @@ func (s *WhisperExtensionSuite) TestSentSignal() {
}
})
defer signal.ResetDefaultNodeNotificationHandler()
client := s.nodes[0].RPCPrivateClient()
client := s.nodes[0].RPCClient()
s.NotNil(client)
var symID string
s.NoError(client.Call(&symID, "shh_newSymKey"))
@ -102,7 +102,7 @@ func (s *WhisperExtensionSuite) TestExpiredSignal() {
}
})
defer signal.ResetDefaultNodeNotificationHandler()
client := s.nodes[0].RPCPrivateClient()
client := s.nodes[0].RPCClient()
s.NotNil(client)
var symID string
s.NoError(client.Call(&symID, "shh_newSymKey"))

View File

@ -7,7 +7,6 @@ import (
"github.com/ethereum/go-ethereum/crypto"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/geth/jail"
"github.com/status-im/status-go/geth/params"
"github.com/status-im/status-go/static"
"github.com/status-im/status-go/t/e2e"
. "github.com/status-im/status-go/t/utils"
@ -61,9 +60,7 @@ func (s *WhisperJailTestSuite) AddKeyPair(address, password string) (string, err
}
func (s *WhisperJailTestSuite) TestJailWhisper() {
s.StartTestBackend(func(config *params.NodeConfig) {
config.APIModules = "shh"
})
s.StartTestBackend()
defer s.StopTestBackend()
r := s.Require()

View File

@ -64,7 +64,7 @@ func (s *WhisperMailboxSuite) TestRequestMessageFromMailboxAsync() {
MailServerKeyID, err := senderWhisperService.AddSymKeyFromPassword(password)
s.Require().NoError(err)
rpcClient := sender.StatusNode().RPCPrivateClient()
rpcClient := sender.StatusNode().RPCClient()
s.Require().NotNil(rpcClient)
// Create topic.
@ -163,9 +163,9 @@ func (s *WhisperMailboxSuite) TestRequestMessagesInGroupChat() {
charlieWhisperService, err := charlieBackend.StatusNode().WhisperService()
s.Require().NoError(err)
// Get rpc client.
aliceRPCClient := aliceBackend.StatusNode().RPCPrivateClient()
bobRPCClient := bobBackend.StatusNode().RPCPrivateClient()
charlieRPCClient := charlieBackend.StatusNode().RPCPrivateClient()
aliceRPCClient := aliceBackend.StatusNode().RPCClient()
bobRPCClient := bobBackend.StatusNode().RPCClient()
charlieRPCClient := charlieBackend.StatusNode().RPCClient()
// Bob and charlie add the mailserver key.
password := "status-offline-inbox"