Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use status-im/whisper module with all changes that we have #1215

Merged
merged 1 commit into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,7 @@
[[constraint]]
name = "github.com/status-im/migrate"
branch = "master"

[[constraint]]
branch = "master"
name = "github.com/status-im/whisper"
2 changes: 1 addition & 1 deletion cmd/node-canary/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discv5"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/api"
"github.com/status-im/status-go/logutils"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/rpc"
"github.com/status-im/status-go/services/shhext"
"github.com/status-im/status-go/t/helpers"
whisper "github.com/status-im/whisper/whisperv6"
"golang.org/x/crypto/ssh/terminal"
)

Expand Down
2 changes: 1 addition & 1 deletion mailserver/cleaner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/require"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/storage"
Expand Down
2 changes: 1 addition & 1 deletion mailserver/mailserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/rlp"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/db"
"github.com/status-im/status-go/params"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
Expand Down
2 changes: 1 addition & 1 deletion mailserver/mailserver_db_panic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package mailserver
import (
"testing"

whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/suite"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
Expand Down
2 changes: 1 addition & 1 deletion mailserver/mailserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rlp"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/params"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/suite"
)

Expand Down
11 changes: 6 additions & 5 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/nat"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/mailserver"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/services/peer"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/status-im/status-go/services/status"
"github.com/status-im/status-go/static"
"github.com/status-im/status-go/timesource"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/syndtr/goleveldb/leveldb"
)

Expand Down Expand Up @@ -271,17 +271,18 @@ func activateShhService(stack *node.Node, config *params.NodeConfig, db *leveldb
whisperServiceConfig := &whisper.Config{
MaxMessageSize: whisper.DefaultMaxMessageSize,
MinimumAcceptedPOW: 0.001,
TimeSource: time.Now,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean that TimeSource in config is unused and can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in what config? i removed TimeSource from whisper.Config and now it is set with separate method. it was simpler to integrate with tests this way. as for NTPSyncEnabled parameter from status config - it is still used and doesn't need to be removed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed TimeSource from whisper.Config

That's what I meant :)

}

whisperService := whisper.New(whisperServiceConfig)

if config.WhisperConfig.EnableNTPSync {
if whisperServiceConfig.TimeSource, err = whisperTimeSource(ctx); err != nil {
timesource, err := whisperTimeSource(ctx)
if err != nil {
return nil, err
}
whisperService.SetTimeSource(timesource)
}

whisperService := whisper.New(whisperServiceConfig)

// enable mail service
if config.WhisperConfig.EnableMailServer {
if err := registerMailServer(whisperService, &config.WhisperConfig); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion node/node_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package node
import (
"testing"

whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"

"github.com/status-im/status-go/params"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion node/status_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
ma "github.com/multiformats/go-multiaddr"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/syndtr/goleveldb/leveldb"

"github.com/status-im/status-go/db"
Expand Down
2 changes: 1 addition & 1 deletion node/status_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
gethnode "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"

"github.com/status-im/status-go/discovery"
"github.com/status-im/status-go/params"
Expand Down
2 changes: 1 addition & 1 deletion peers/peerpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/whisper/whisperv6"
lcrypto "github.com/libp2p/go-libp2p-crypto"
ma "github.com/multiformats/go-multiaddr"
"github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand Down
2 changes: 1 addition & 1 deletion services/shhext/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/services/shhext/chat"
whisper "github.com/status-im/whisper/whisperv6"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion services/shhext/chat/whisper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package chat

import (
"github.com/ethereum/go-ethereum/crypto"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"
)

var discoveryTopic = "contact-discovery"
Expand Down
5 changes: 3 additions & 2 deletions services/shhext/chat/whisper_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package chat

import (
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"

"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestPublicMessageToWhisper(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion services/shhext/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/services"
whisper "github.com/status-im/whisper/whisperv6"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion services/shhext/dedup/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"time"

"github.com/ethereum/go-ethereum/crypto/sha3"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/db"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
)
Expand Down
2 changes: 1 addition & 1 deletion services/shhext/dedup/deduplicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package dedup

import (
"github.com/ethereum/go-ethereum/log"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/syndtr/goleveldb/leveldb"
)

Expand Down
2 changes: 1 addition & 1 deletion services/shhext/dedup/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dedup
import (
"crypto/rand"

whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"
)

func generateMessages(count int) []*whisper.Message {
Expand Down
2 changes: 1 addition & 1 deletion services/shhext/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rpc"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/services/shhext/chat"
"github.com/status-im/status-go/services/shhext/dedup"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/syndtr/goleveldb/leveldb"
)

Expand Down
2 changes: 1 addition & 1 deletion services/shhext/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/t/helpers"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/suite"
)

Expand Down
2 changes: 1 addition & 1 deletion t/benchmarks/mailserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/ethereum/go-ethereum/node"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/services/shhext"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion t/benchmarks/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/ethereum/go-ethereum/node"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 1 addition & 3 deletions t/benchmarks/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package benchmarks

import (
"fmt"
"time"

"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/nat"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"
)

var (
Expand Down Expand Up @@ -53,7 +52,6 @@ func createWhisperService() *whisper.Whisper {
whisperServiceConfig := &whisper.Config{
MaxMessageSize: whisper.DefaultMaxMessageSize,
MinimumAcceptedPOW: 0.005,
TimeSource: func() time.Time { return time.Now().UTC() },
}
return whisper.New(whisperServiceConfig)
}
2 changes: 1 addition & 1 deletion t/e2e/node/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/ethereum/go-ethereum/les"
gethnode "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/rpc"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/node"
"github.com/status-im/status-go/params"
whisper "github.com/status-im/whisper/whisperv6"

"github.com/status-im/status-go/t/e2e"
. "github.com/status-im/status-go/t/utils"
Expand Down
2 changes: 1 addition & 1 deletion t/e2e/services/debug_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/p2p"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/node"
"github.com/status-im/status-go/params"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

Expand Down
2 changes: 1 addition & 1 deletion t/e2e/suites.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package e2e
import (
"github.com/ethereum/go-ethereum/log"

whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
whisper "github.com/status-im/whisper/whisperv6"

"github.com/status-im/status-go/api"
"github.com/status-im/status-go/node"
Expand Down
2 changes: 1 addition & 1 deletion t/e2e/whisper/whisper_ext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/node"
"github.com/status-im/status-go/signal"
"github.com/status-im/status-go/t/utils"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/suite"
)

Expand Down
2 changes: 1 addition & 1 deletion t/e2e/whisper/whisper_mailbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/ethereum/go-ethereum/p2p"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/api"
"github.com/status-im/status-go/rpc"
"github.com/status-im/status-go/t/helpers"
. "github.com/status-im/status-go/t/utils"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/suite"
)

Expand Down
2 changes: 1 addition & 1 deletion t/e2e/whisper/whisper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"testing"

"github.com/ethereum/go-ethereum/crypto"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/status-im/status-go/account"
e2e "github.com/status-im/status-go/t/e2e"
. "github.com/status-im/status-go/t/utils"
whisper "github.com/status-im/whisper/whisperv6"
"github.com/stretchr/testify/suite"
)

Expand Down
Loading