Skip to content

Commit

Permalink
Use status-im whisper/whisperv6 module everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
dshulyak committed Oct 2, 2018
1 parent f3880f8 commit c26fd23
Show file tree
Hide file tree
Showing 44 changed files with 3,574 additions and 35 deletions.
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,
}

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

0 comments on commit c26fd23

Please sign in to comment.