From 284f18fa15b51a2bed843224e7ada8d53e4993f6 Mon Sep 17 00:00:00 2001 From: Nikita Kryuchkov Date: Mon, 3 Aug 2020 17:00:48 +0300 Subject: [PATCH 1/2] Migrate repo --- README.md | 2 +- ci_scripts/go_mod_replace.sh | 2 +- cmd/apps/helloworld/helloworld.go | 4 +- cmd/apps/skychat/chat.go | 4 +- cmd/apps/skysocks-client/skysocks-client.go | 4 +- cmd/apps/skysocks/skysocks.go | 2 +- cmd/hypervisor/commands/root.go | 6 +- cmd/setup-node/commands/root.go | 2 +- cmd/skywire-cli/commands/mdisc/root.go | 2 +- cmd/skywire-cli/commands/rtfind/root.go | 2 +- cmd/skywire-cli/commands/visor/gen-config.go | 2 +- cmd/skywire-cli/commands/visor/root.go | 2 +- .../commands/visor/transport_discovery.go | 2 +- cmd/skywire-cli/commands/visor/transports.go | 4 +- cmd/skywire-cli/internal/internal.go | 4 +- cmd/skywire-visor/commands/root.go | 2 +- go.mod | 8 +- go.sum | 19 +- internal/httpauth/auth.go | 2 +- internal/httpauth/client.go | 4 +- internal/httpauth/client_test.go | 4 +- internal/skysocks/client.go | 4 +- internal/skysocks/server.go | 4 +- internal/skysocks/server_test.go | 2 +- internal/utclient/client.go | 4 +- internal/utclient/client_test.go | 2 +- pkg/app/appnet/addr.go | 4 +- pkg/app/appnet/addr_test.go | 4 +- pkg/app/appnet/dmsg_networker.go | 2 +- pkg/app/appnet/networker_test.go | 2 +- pkg/app/appnet/skywire_networker.go | 4 +- pkg/app/appserver/mock_proc_manager.go | 2 +- pkg/app/appserver/proc.go | 2 +- pkg/app/appserver/proc_manager.go | 2 +- pkg/app/appserver/proc_manager_test.go | 2 +- pkg/app/appserver/rpc_gateway.go | 2 +- pkg/app/appserver/rpc_gateway_test.go | 6 +- pkg/app/appserver/server.go | 2 +- pkg/app/appserver/server_test.go | 6 +- pkg/app/client.go | 4 +- pkg/app/client_test.go | 4 +- pkg/app/conn_test.go | 2 +- pkg/app/listener.go | 2 +- pkg/app/listener_test.go | 4 +- pkg/app/log.go | 2 +- pkg/app/rpc_client_test.go | 6 +- pkg/hypervisor/config.go | 4 +- pkg/hypervisor/hypervisor.go | 10 +- pkg/hypervisor/hypervisor_test.go | 2 +- pkg/hypervisor/user.go | 2 +- pkg/hypervisor/user_manager.go | 2 +- pkg/restart/restart_test.go | 2 +- pkg/routefinder/rfclient/client.go | 2 +- pkg/routefinder/rfclient/mock.go | 2 +- pkg/router/mock_router.go | 2 +- pkg/router/route_group.go | 4 +- pkg/router/route_group_test.go | 2 +- pkg/router/router.go | 6 +- pkg/router/router_test.go | 6 +- pkg/router/routerclient/client.go | 2 +- pkg/router/routerclient/client_test.go | 2 +- pkg/router/routerclient/wrappers.go | 6 +- pkg/router/rpc_gateway.go | 2 +- pkg/router/rpc_gateway_test.go | 2 +- pkg/routing/addr.go | 2 +- pkg/routing/route.go | 2 +- pkg/routing/route_descriptor.go | 2 +- pkg/routing/route_descriptor_test.go | 2 +- pkg/routing/rule.go | 2 +- pkg/routing/rule_test.go | 2 +- pkg/routing/table_test.go | 2 +- pkg/setup/config.go | 2 +- pkg/setup/idreservoir.go | 6 +- pkg/setup/node.go | 6 +- pkg/setup/node_test.go | 6 +- pkg/setup/rpc_gateway.go | 4 +- pkg/setup/setupclient/client.go | 4 +- pkg/setup/setupclient/wrappers.go | 4 +- pkg/skyenv/values.go | 2 +- pkg/snet/network.go | 8 +- pkg/snet/network_test.go | 4 +- pkg/snet/snettest/env.go | 6 +- pkg/snet/stcp/client.go | 6 +- pkg/snet/stcp/client_test.go | 4 +- pkg/snet/stcp/handshake.go | 6 +- pkg/snet/stcp/handshake_test.go | 4 +- pkg/snet/stcp/pktable.go | 2 +- pkg/transport-discovery/client/client.go | 6 +- pkg/transport-discovery/client/client_test.go | 4 +- pkg/transport/discovery.go | 2 +- pkg/transport/discovery_test.go | 2 +- pkg/transport/entry.go | 2 +- pkg/transport/entry_test.go | 2 +- pkg/transport/handshake.go | 4 +- pkg/transport/handshake_test.go | 2 +- pkg/transport/managed_transport.go | 8 +- pkg/transport/manager.go | 4 +- pkg/transport/manager_test.go | 6 +- pkg/transport/transport.go | 4 +- pkg/util/pathutil/configpath.go | 4 +- pkg/util/updater/updater.go | 2 +- pkg/visor/config.go | 8 +- pkg/visor/config_test.go | 2 +- pkg/visor/rpc.go | 2 +- pkg/visor/rpc_client.go | 4 +- pkg/visor/rpc_client_serve.go | 4 +- pkg/visor/rpc_test.go | 4 +- pkg/visor/visor.go | 8 +- pkg/visor/visor_test.go | 8 +- .../cipher/secp256k1-go/secp256k1-go2/sig.go | 280 ------------------ .../dmsg/.gitignore | 10 +- .../dmsg/.golangci.yml | 0 .../dmsg/.travis.yml | 0 .../{SkycoinProject => skycoin}/dmsg/Makefile | 4 +- .../dmsg/README.md | 2 +- .../dmsg/TESTING.md | 0 .../dmsg/cipher/cipher.go | 4 +- .../dmsg/client.go | 75 ++++- .../dmsg/client_session.go | 15 +- .../{SkycoinProject => skycoin}/dmsg/const.go | 0 .../dmsg/disc/client.go | 4 +- .../dmsg/disc/entry.go | 2 +- .../dmsg/disc/http_message.go | 0 .../dmsg/disc/testing.go | 2 +- .../dmsg/entity_common.go | 12 +- .../dmsg/errors.go | 0 .../{SkycoinProject => skycoin}/dmsg/go.mod | 8 +- .../{SkycoinProject => skycoin}/dmsg/go.sum | 25 +- .../dmsg/httputil/error.go | 0 .../dmsg/httputil/httputil.go | 2 +- .../dmsg/ioutil/ack_waiter.go | 0 .../dmsg/ioutil/atomic_bool.go | 0 .../dmsg/ioutil/buf_read.go | 0 .../dmsg/ioutil/logging.go | 2 +- .../dmsg/listener.go | 0 .../dmsg/netutil/copy.go | 0 .../dmsg/netutil/porter.go | 0 .../dmsg/netutil/retrier.go | 0 .../dmsg/noise/dh.go | 2 +- .../dmsg/noise/net.go | 2 +- .../dmsg/noise/noise.go | 5 +- .../dmsg/noise/read_writer.go | 4 +- .../dmsg/server.go | 52 +++- .../dmsg/server_session.go | 29 +- .../dmsg/session_common.go | 25 +- .../dmsg/stream.go | 6 +- .../{SkycoinProject => skycoin}/dmsg/types.go | 2 +- .../{SkycoinProject => skycoin}/dmsg/util.go | 0 .../skycoin/src/cipher/address.go | 2 +- .../skycoin/src/cipher/base58/LICENSE | 0 .../skycoin/src/cipher/base58/LICENSE_old | 0 .../skycoin/src/cipher/base58/README.md | 4 +- .../skycoin/src/cipher/base58/base58.go | 0 .../skycoin/src/cipher/base58/base58_old.go | 0 .../skycoin/src/cipher/bitcoin.go | 2 +- .../skycoin/src/cipher/crypto.go | 17 +- .../skycoin/src/cipher/hash.go | 4 +- .../src/cipher/ripemd160/ripemd160block.go | 4 +- .../skycoin/src/cipher/ripemd160/ripmd_160.go | 8 +- .../skycoin/src/cipher/secp256k1-go/README.md | 0 .../src/cipher/secp256k1-go/secp256_rand.go | 2 +- .../cipher/secp256k1-go/secp256k1-go2/COPYING | 0 .../secp256k1-go/secp256k1-go2/README.md | 0 .../cipher/secp256k1-go/secp256k1-go2/ec.go | 37 +-- .../secp256k1-go/secp256k1-go2/field.go | 0 .../cipher/secp256k1-go/secp256k1-go2/num.go | 10 +- .../secp256k1-go/secp256k1-go2/secp256k1.go | 1 + .../cipher/secp256k1-go/secp256k1-go2/sig.go | 184 ++++++++++++ .../cipher/secp256k1-go/secp256k1-go2/xy.go | 15 +- .../cipher/secp256k1-go/secp256k1-go2/xyz.go | 12 +- .../secp256k1-go/secp256k1-go2/z_consts.go | 0 .../secp256k1-go/secp256k1-go2/z_init.go | 0 .../src/cipher/secp256k1-go/secp256k1.go | 87 ++---- .../skycoin/src/util/logging/formatter.go | 14 +- .../skycoin/src/util/logging/hooks.go | 0 .../skycoin/src/util/logging/logger.go | 6 - .../skycoin/src/util/logging/logging.go | 0 .../yamux/.gitignore | 0 .../{SkycoinProject => skycoin}/yamux/LICENSE | 0 .../yamux/README.md | 0 .../{SkycoinProject => skycoin}/yamux/addr.go | 0 .../yamux/const.go | 0 .../yamux/deadline.go | 0 .../{SkycoinProject => skycoin}/yamux/go.mod | 2 +- .../{SkycoinProject => skycoin}/yamux/go.sum | 0 .../{SkycoinProject => skycoin}/yamux/mux.go | 0 .../yamux/session.go | 0 .../{SkycoinProject => skycoin}/yamux/spec.md | 0 .../yamux/stream.go | 0 .../{SkycoinProject => skycoin}/yamux/util.go | 0 vendor/modules.txt | 36 +-- 191 files changed, 697 insertions(+), 727 deletions(-) delete mode 100644 vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/.gitignore (54%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/.golangci.yml (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/.travis.yml (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/Makefile (95%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/README.md (91%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/TESTING.md (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/cipher/cipher.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/client.go (77%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/client_session.go (89%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/const.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/disc/client.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/disc/entry.go (99%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/disc/http_message.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/disc/testing.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/entity_common.go (95%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/errors.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/go.mod (71%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/go.sum (94%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/httputil/error.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/httputil/httputil.go (97%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/ioutil/ack_waiter.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/ioutil/atomic_bool.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/ioutil/buf_read.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/ioutil/logging.go (56%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/listener.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/netutil/copy.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/netutil/porter.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/netutil/retrier.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/noise/dh.go (93%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/noise/net.go (99%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/noise/noise.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/noise/read_writer.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/server.go (69%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/server_session.go (79%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/session_common.go (82%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/stream.go (97%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/types.go (99%) rename vendor/github.com/{SkycoinProject => skycoin}/dmsg/util.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/address.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/base58/LICENSE (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/base58/LICENSE_old (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/base58/README.md (81%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/base58/base58.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/base58/base58_old.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/bitcoin.go (99%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/crypto.go (97%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/hash.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/ripemd160/ripemd160block.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/ripemd160/ripmd_160.go (91%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/README.md (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256_rand.go (98%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/COPYING (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/README.md (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/ec.go (85%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/field.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/num.go (87%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go (98%) create mode 100644 vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go (92%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xyz.go (96%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_consts.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_init.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/cipher/secp256k1-go/secp256k1.go (77%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/util/logging/formatter.go (97%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/util/logging/hooks.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/util/logging/logger.go (91%) rename vendor/github.com/{SkycoinProject => skycoin}/skycoin/src/util/logging/logging.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/.gitignore (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/LICENSE (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/README.md (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/addr.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/const.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/deadline.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/go.mod (64%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/go.sum (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/mux.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/session.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/spec.md (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/stream.go (100%) rename vendor/github.com/{SkycoinProject => skycoin}/yamux/util.go (100%) diff --git a/README.md b/README.md index 9d3a6f9589..c1114dcd05 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Skywire requires a version of [golang](https://golang.org/) with [go modules](ht ```bash # Clone. $ git clone https://github.com/skycoin/skywire.git -$ cd skywire-mainnet +$ cd skywire # Build. $ make build # installs all dependencies, build binaries and skywire apps diff --git a/ci_scripts/go_mod_replace.sh b/ci_scripts/go_mod_replace.sh index 19557c50fb..b7890cc86b 100755 --- a/ci_scripts/go_mod_replace.sh +++ b/ci_scripts/go_mod_replace.sh @@ -9,7 +9,7 @@ action=$1 filename=$2 # Line to comment/uncomment in go.mod -line="replace github.com\/SkycoinProject\/dmsg => ..\/dmsg" +line="replace github.com\/skycoin\/dmsg => ..\/dmsg" function print_usage() { echo $"Usage: $0 (comment|uncomment) " diff --git a/cmd/apps/helloworld/helloworld.go b/cmd/apps/helloworld/helloworld.go index e8a178f35d..bcbdd93bb6 100644 --- a/cmd/apps/helloworld/helloworld.go +++ b/cmd/apps/helloworld/helloworld.go @@ -7,8 +7,8 @@ import ( "log" "os" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app" "github.com/skycoin/skywire/pkg/app/appnet" diff --git a/cmd/apps/skychat/chat.go b/cmd/apps/skychat/chat.go index 844ac0efed..ce77230805 100644 --- a/cmd/apps/skychat/chat.go +++ b/cmd/apps/skychat/chat.go @@ -14,8 +14,8 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/internal/netutil" "github.com/skycoin/skywire/pkg/app" diff --git a/cmd/apps/skysocks-client/skysocks-client.go b/cmd/apps/skysocks-client/skysocks-client.go index a9fe47d878..4d55cc90d8 100644 --- a/cmd/apps/skysocks-client/skysocks-client.go +++ b/cmd/apps/skysocks-client/skysocks-client.go @@ -10,8 +10,8 @@ import ( "net" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/internal/netutil" "github.com/skycoin/skywire/internal/skysocks" diff --git a/cmd/apps/skysocks/skysocks.go b/cmd/apps/skysocks/skysocks.go index 71609d4bc4..b17dad9acb 100644 --- a/cmd/apps/skysocks/skysocks.go +++ b/cmd/apps/skysocks/skysocks.go @@ -9,7 +9,7 @@ import ( "os" "os/signal" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/internal/skysocks" "github.com/skycoin/skywire/pkg/app" diff --git a/cmd/hypervisor/commands/root.go b/cmd/hypervisor/commands/root.go index 8bdb60ce57..a3eb1108a2 100644 --- a/cmd/hypervisor/commands/root.go +++ b/cmd/hypervisor/commands/root.go @@ -5,10 +5,10 @@ import ( "net/http" "os" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/disc" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/rakyll/statik/fs" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/disc" + "github.com/skycoin/skycoin/src/util/logging" "github.com/spf13/cobra" _ "github.com/skycoin/skywire/cmd/hypervisor/statik" // embedded static files diff --git a/cmd/setup-node/commands/root.go b/cmd/setup-node/commands/root.go index a07c5f05eb..570650971b 100644 --- a/cmd/setup-node/commands/root.go +++ b/cmd/setup-node/commands/root.go @@ -10,9 +10,9 @@ import ( "net/http" "os" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/prometheus/client_golang/prometheus/promhttp" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" + "github.com/skycoin/skycoin/src/util/logging" "github.com/spf13/cobra" "github.com/skycoin/skywire/pkg/metrics" diff --git a/cmd/skywire-cli/commands/mdisc/root.go b/cmd/skywire-cli/commands/mdisc/root.go index 426105d2c1..ccee22cb9d 100644 --- a/cmd/skywire-cli/commands/mdisc/root.go +++ b/cmd/skywire-cli/commands/mdisc/root.go @@ -9,7 +9,7 @@ import ( "github.com/skycoin/skywire/pkg/skyenv" - "github.com/SkycoinProject/dmsg/disc" + "github.com/skycoin/dmsg/disc" "github.com/spf13/cobra" "github.com/skycoin/skywire/cmd/skywire-cli/internal" diff --git a/cmd/skywire-cli/commands/rtfind/root.go b/cmd/skywire-cli/commands/rtfind/root.go index ef43081590..cefc103f9e 100644 --- a/cmd/skywire-cli/commands/rtfind/root.go +++ b/cmd/skywire-cli/commands/rtfind/root.go @@ -8,7 +8,7 @@ import ( "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/skyenv" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/spf13/cobra" "golang.org/x/net/context" diff --git a/cmd/skywire-cli/commands/visor/gen-config.go b/cmd/skywire-cli/commands/visor/gen-config.go index f3e527d4e7..23cbfa0bb7 100644 --- a/cmd/skywire-cli/commands/visor/gen-config.go +++ b/cmd/skywire-cli/commands/visor/gen-config.go @@ -12,7 +12,7 @@ import ( "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/skyenv" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/spf13/cobra" "github.com/skycoin/skywire/pkg/util/pathutil" diff --git a/cmd/skywire-cli/commands/visor/root.go b/cmd/skywire-cli/commands/visor/root.go index 1c35f34216..723ed5d04a 100644 --- a/cmd/skywire-cli/commands/visor/root.go +++ b/cmd/skywire-cli/commands/visor/root.go @@ -5,7 +5,7 @@ import ( "net/rpc" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/spf13/cobra" "github.com/skycoin/skywire/pkg/visor" diff --git a/cmd/skywire-cli/commands/visor/transport_discovery.go b/cmd/skywire-cli/commands/visor/transport_discovery.go index 483a2da266..e16c359ae6 100644 --- a/cmd/skywire-cli/commands/visor/transport_discovery.go +++ b/cmd/skywire-cli/commands/visor/transport_discovery.go @@ -6,8 +6,8 @@ import ( "os" "text/tabwriter" - "github.com/SkycoinProject/dmsg/cipher" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" "github.com/spf13/cobra" "github.com/skycoin/skywire/cmd/skywire-cli/internal" diff --git a/cmd/skywire-cli/commands/visor/transports.go b/cmd/skywire-cli/commands/visor/transports.go index bd91eaa485..195caa89b9 100644 --- a/cmd/skywire-cli/commands/visor/transports.go +++ b/cmd/skywire-cli/commands/visor/transports.go @@ -7,8 +7,8 @@ import ( "text/tabwriter" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" "github.com/spf13/cobra" "github.com/skycoin/skywire/cmd/skywire-cli/internal" diff --git a/cmd/skywire-cli/internal/internal.go b/cmd/skywire-cli/internal/internal.go index e79539cea0..839bd31293 100644 --- a/cmd/skywire-cli/internal/internal.go +++ b/cmd/skywire-cli/internal/internal.go @@ -3,9 +3,9 @@ package internal import ( "fmt" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" ) var log = logging.MustGetLogger("skywire-cli") diff --git a/cmd/skywire-visor/commands/root.go b/cmd/skywire-visor/commands/root.go index e4524a5102..bc6f826611 100644 --- a/cmd/skywire-visor/commands/root.go +++ b/cmd/skywire-visor/commands/root.go @@ -19,9 +19,9 @@ import ( "syscall" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/pkg/profile" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" + "github.com/skycoin/skycoin/src/util/logging" "github.com/spf13/cobra" "github.com/skycoin/skywire/internal/utclient" diff --git a/go.mod b/go.mod index 052b55cd77..76ea90b64e 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,6 @@ module github.com/skycoin/skywire go 1.13 require ( - github.com/SkycoinProject/dmsg v0.2.0 - github.com/SkycoinProject/skycoin v0.27.0 - github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/go-chi/chi v4.0.2+incompatible github.com/google/uuid v1.1.1 @@ -17,6 +14,9 @@ require ( github.com/rakyll/statik v0.1.7 github.com/schollz/progressbar/v2 v2.15.0 github.com/sirupsen/logrus v1.4.2 + github.com/skycoin/dmsg v0.0.0-20200803194104-78ff5746d8a3 + github.com/skycoin/skycoin v0.26.0 + github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f github.com/spf13/cobra v0.0.5 github.com/stretchr/testify v1.4.0 go.etcd.io/bbolt v1.3.4 @@ -24,4 +24,4 @@ require ( ) // Uncomment for tests with alternate branches of 'dmsg' -//replace github.com/SkycoinProject/dmsg => ../dmsg +//replace github.com/skycoin/dmsg => ../dmsg diff --git a/go.sum b/go.sum index cd670f98e2..5e0ba3f367 100644 --- a/go.sum +++ b/go.sum @@ -1,15 +1,11 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/SkycoinProject/dmsg v0.0.0-20200306152741-acee74fa4514 h1:Ysxe5a/uGJq5eeSPhlIkS0Ft29LzoVv4waaN0VE4JXM= github.com/SkycoinProject/dmsg v0.0.0-20200306152741-acee74fa4514/go.mod h1:DzykXMLlx6Fx0fGjZsCIRas/MIvxW8DZpmDA6f2nCRk= -github.com/SkycoinProject/dmsg v0.2.0 h1:YAalAHTs89Ncu0AbuCz00umX/ITYPAkPRT2w4tp4odE= github.com/SkycoinProject/dmsg v0.2.0/go.mod h1:MiX+UG/6fl3g+9rS13/fq7BwUQ2eOlg1yOBOnNf6J6A= github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= -github.com/SkycoinProject/skycoin v0.27.0 h1:N3IHxj8ossHOcsxLYOYugT+OaELLncYHJHxbbYLPPmY= github.com/SkycoinProject/skycoin v0.27.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= -github.com/skycoin/skywire v0.0.0-20200309204032-14af5342da86/go.mod h1:xuOpE5ZZU2kR39u0tJWtOpak/sJpnEFj1HpTxtyPU/A= -github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a h1:6nHCJqh7trsuRcpMC5JmtDukUndn2VC9sY64K6xQ7hQ= +github.com/SkycoinProject/skywire-mainnet v0.0.0-20200309204032-14af5342da86/go.mod h1:xuOpE5ZZU2kR39u0tJWtOpak/sJpnEFj1HpTxtyPU/A= github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a/go.mod h1:IaE1dxncLQs4RJcQTZPikJfAZY4szH87u2h0lT0SDuM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= @@ -118,12 +114,10 @@ github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.1 h1:oIPZROsWuPHpOdMVWLuJZXwgjhrW8r1yEX8UqMyeNHM= github.com/klauspost/pgzip v1.2.1/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -132,11 +126,9 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -200,7 +192,13 @@ github.com/schollz/progressbar/v2 v2.15.0/go.mod h1:UdPq3prGkfQ7MOzZKlDRpYKcFqEM github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/skycoin/dmsg v0.0.0-20200803194104-78ff5746d8a3 h1:mSraFLdscptO1H9nJ1rrzXegC+hIC8TeWP4LoO9Oe6I= +github.com/skycoin/dmsg v0.0.0-20200803194104-78ff5746d8a3/go.mod h1:wyteEV9/z7kxG6nAWslHlQtEpixpB/RWtzFg7GLlIEQ= +github.com/skycoin/skycoin v0.26.0 h1:xDxe2r8AclMntZ550Y/vUQgwgLtwrf9Wu5UYiYcN5/o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= +github.com/skycoin/skywire v0.2.3-0.20200803142942-0f8b9981f6f9/go.mod h1:VtQTQdSwPvAZDzDgFK41PwGGQGeY3ehlFCtT0F8C7/8= +github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f h1:A5dEM1OE9YhN3LciZU9qPjo7fJ46JeHNi3JCroDkK0Y= +github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f/go.mod h1:48cleOxgkiLbgv322LOg2Vrxtu180Mb8GG1HbuhmFYM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -241,7 +239,6 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -273,10 +270,8 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= diff --git a/internal/httpauth/auth.go b/internal/httpauth/auth.go index c742e387f5..a3417facac 100644 --- a/internal/httpauth/auth.go +++ b/internal/httpauth/auth.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) // Nonce is used to sign requests in order to avoid replay attack diff --git a/internal/httpauth/client.go b/internal/httpauth/client.go index 65ed8f5b2c..356ce2c4b1 100644 --- a/internal/httpauth/client.go +++ b/internal/httpauth/client.go @@ -14,8 +14,8 @@ import ( "strings" "sync/atomic" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" ) const ( diff --git a/internal/httpauth/client_test.go b/internal/httpauth/client_test.go index 2b0ed48df0..cd74a577b6 100644 --- a/internal/httpauth/client_test.go +++ b/internal/httpauth/client_test.go @@ -12,8 +12,8 @@ import ( "strconv" "testing" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/internal/skysocks/client.go b/internal/skysocks/client.go index a144bb8fde..3b78f6ec70 100644 --- a/internal/skysocks/client.go +++ b/internal/skysocks/client.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/SkycoinProject/yamux" + "github.com/skycoin/skycoin/src/util/logging" + "github.com/skycoin/yamux" "github.com/skycoin/skywire/pkg/router" ) diff --git a/internal/skysocks/server.go b/internal/skysocks/server.go index 8a90c1d275..c282665579 100644 --- a/internal/skysocks/server.go +++ b/internal/skysocks/server.go @@ -5,9 +5,9 @@ import ( "net" "sync/atomic" - "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/SkycoinProject/yamux" "github.com/armon/go-socks5" + "github.com/skycoin/skycoin/src/util/logging" + "github.com/skycoin/yamux" ) // Server implements multiplexing proxy server using yamux. diff --git a/internal/skysocks/server_test.go b/internal/skysocks/server_test.go index 7159688490..2562c19bb5 100644 --- a/internal/skysocks/server_test.go +++ b/internal/skysocks/server_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/internal/utclient/client.go b/internal/utclient/client.go index 49ea2e3d77..7bd27d734a 100644 --- a/internal/utclient/client.go +++ b/internal/utclient/client.go @@ -11,8 +11,8 @@ import ( "io/ioutil" "net/http" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/internal/httpauth" ) diff --git a/internal/utclient/client_test.go b/internal/utclient/client_test.go index a6a88c1ece..fc2ab2827d 100644 --- a/internal/utclient/client_test.go +++ b/internal/utclient/client_test.go @@ -9,7 +9,7 @@ import ( "sync" "testing" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/app/appnet/addr.go b/pkg/app/appnet/addr.go index 7e6805f526..edbf30471a 100644 --- a/pkg/app/appnet/addr.go +++ b/pkg/app/appnet/addr.go @@ -5,8 +5,8 @@ import ( "fmt" "net" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/routing" ) diff --git a/pkg/app/appnet/addr_test.go b/pkg/app/appnet/addr_test.go index d0a00854e3..41489d99b3 100644 --- a/pkg/app/appnet/addr_test.go +++ b/pkg/app/appnet/addr_test.go @@ -4,8 +4,8 @@ import ( "net" "testing" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/require" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/app/appnet/dmsg_networker.go b/pkg/app/appnet/dmsg_networker.go index 3560f5ef1d..36ed83dbde 100644 --- a/pkg/app/appnet/dmsg_networker.go +++ b/pkg/app/appnet/dmsg_networker.go @@ -4,7 +4,7 @@ import ( "context" "net" - "github.com/SkycoinProject/dmsg" + "github.com/skycoin/dmsg" ) // DmsgNetworker implements `Networker` for dmsg network. diff --git a/pkg/app/appnet/networker_test.go b/pkg/app/appnet/networker_test.go index c681392ceb..1be2861bac 100644 --- a/pkg/app/appnet/networker_test.go +++ b/pkg/app/appnet/networker_test.go @@ -5,7 +5,7 @@ import ( "net" "testing" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/require" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/app/appnet/skywire_networker.go b/pkg/app/appnet/skywire_networker.go index 58b9b6722b..a84b18eca5 100644 --- a/pkg/app/appnet/skywire_networker.go +++ b/pkg/app/appnet/skywire_networker.go @@ -9,8 +9,8 @@ import ( "sync" "sync/atomic" - "github.com/SkycoinProject/dmsg/netutil" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/netutil" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/router" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/app/appserver/mock_proc_manager.go b/pkg/app/appserver/mock_proc_manager.go index 7009504f6c..6cb098d8f0 100644 --- a/pkg/app/appserver/mock_proc_manager.go +++ b/pkg/app/appserver/mock_proc_manager.go @@ -7,7 +7,7 @@ import ( appcommon "github.com/skycoin/skywire/pkg/app/appcommon" - logging "github.com/SkycoinProject/skycoin/src/util/logging" + logging "github.com/skycoin/skycoin/src/util/logging" mock "github.com/stretchr/testify/mock" ) diff --git a/pkg/app/appserver/proc.go b/pkg/app/appserver/proc.go index 84d8fbe31e..ac11685790 100644 --- a/pkg/app/appserver/proc.go +++ b/pkg/app/appserver/proc.go @@ -10,7 +10,7 @@ import ( "sync" "sync/atomic" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" ) diff --git a/pkg/app/appserver/proc_manager.go b/pkg/app/appserver/proc_manager.go index d9ac0bed74..7d679cde35 100644 --- a/pkg/app/appserver/proc_manager.go +++ b/pkg/app/appserver/proc_manager.go @@ -8,7 +8,7 @@ import ( "strings" "sync" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" ) diff --git a/pkg/app/appserver/proc_manager_test.go b/pkg/app/appserver/proc_manager_test.go index 4a74a72c04..5cf1fab5a4 100644 --- a/pkg/app/appserver/proc_manager_test.go +++ b/pkg/app/appserver/proc_manager_test.go @@ -6,7 +6,7 @@ import ( "github.com/skycoin/skywire/pkg/app/appcommon" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/require" ) diff --git a/pkg/app/appserver/rpc_gateway.go b/pkg/app/appserver/rpc_gateway.go index f0643fbdb8..46b95288b0 100644 --- a/pkg/app/appserver/rpc_gateway.go +++ b/pkg/app/appserver/rpc_gateway.go @@ -7,7 +7,7 @@ import ( "net" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appnet" "github.com/skycoin/skywire/pkg/app/idmanager" diff --git a/pkg/app/appserver/rpc_gateway_test.go b/pkg/app/appserver/rpc_gateway_test.go index 31297df6eb..49fa80474d 100644 --- a/pkg/app/appserver/rpc_gateway_test.go +++ b/pkg/app/appserver/rpc_gateway_test.go @@ -10,9 +10,9 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/pkg/app/appserver/server.go b/pkg/app/appserver/server.go index 88f96e865a..c54ff203c5 100644 --- a/pkg/app/appserver/server.go +++ b/pkg/app/appserver/server.go @@ -7,7 +7,7 @@ import ( "strings" "sync" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" ) diff --git a/pkg/app/appserver/server_test.go b/pkg/app/appserver/server_test.go index 33dac3bc12..45c29f20ad 100644 --- a/pkg/app/appserver/server_test.go +++ b/pkg/app/appserver/server_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/pkg/app/client.go b/pkg/app/client.go index 46d97e257a..fefec555d8 100644 --- a/pkg/app/client.go +++ b/pkg/app/client.go @@ -8,8 +8,8 @@ import ( "os" "strings" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" "github.com/skycoin/skywire/pkg/app/appnet" diff --git a/pkg/app/client_test.go b/pkg/app/client_test.go index 884348c1e9..609c7acfc0 100644 --- a/pkg/app/client_test.go +++ b/pkg/app/client_test.go @@ -5,8 +5,8 @@ import ( "os" "testing" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/require" "github.com/skycoin/skywire/pkg/app/appcommon" diff --git a/pkg/app/conn_test.go b/pkg/app/conn_test.go index 1b01a6869a..8e0e36f909 100644 --- a/pkg/app/conn_test.go +++ b/pkg/app/conn_test.go @@ -7,7 +7,7 @@ import ( "net/rpc" "testing" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/app/listener.go b/pkg/app/listener.go index d8e08a3413..6a0ca829e6 100644 --- a/pkg/app/listener.go +++ b/pkg/app/listener.go @@ -5,7 +5,7 @@ import ( "net" "sync" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appnet" "github.com/skycoin/skywire/pkg/app/idmanager" diff --git a/pkg/app/listener_test.go b/pkg/app/listener_test.go index 4b9630907b..cb380f1593 100644 --- a/pkg/app/listener_test.go +++ b/pkg/app/listener_test.go @@ -4,8 +4,8 @@ import ( "errors" "testing" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/require" "github.com/skycoin/skywire/pkg/app/appnet" diff --git a/pkg/app/log.go b/pkg/app/log.go index 8fad8a1d26..fe8ddca83e 100644 --- a/pkg/app/log.go +++ b/pkg/app/log.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" ) // NewLogger returns a logger which persists app logs. This logger should be passed down diff --git a/pkg/app/rpc_client_test.go b/pkg/app/rpc_client_test.go index 4a3371005c..6ad4855149 100644 --- a/pkg/app/rpc_client_test.go +++ b/pkg/app/rpc_client_test.go @@ -11,9 +11,9 @@ import ( "github.com/skycoin/skywire/internal/testhelpers" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/hypervisor/config.go b/pkg/hypervisor/config.go index 4a02697785..a45c2894a0 100644 --- a/pkg/hypervisor/config.go +++ b/pkg/hypervisor/config.go @@ -8,7 +8,7 @@ import ( "path/filepath" "time" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/skyenv" "github.com/skycoin/skywire/pkg/util/pathutil" @@ -84,7 +84,7 @@ func GenerateHomeConfig(testenv bool) Config { // GenerateLocalConfig generates a config with default values and uses db from shared folder. func GenerateLocalConfig(testenv bool) Config { c := makeConfig(testenv) - c.DBPath = "/usr/local/SkycoinProject/hypervisor/users.db" + c.DBPath = "/usr/local/skycoin/hypervisor/users.db" return c } diff --git a/pkg/hypervisor/hypervisor.go b/pkg/hypervisor/hypervisor.go index d1edebbf56..b83d1cfa3e 100644 --- a/pkg/hypervisor/hypervisor.go +++ b/pkg/hypervisor/hypervisor.go @@ -14,14 +14,14 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/dmsgpty" - "github.com/SkycoinProject/dmsg/httputil" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" "github.com/google/uuid" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/dmsgpty" + "github.com/skycoin/dmsg/httputil" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/hypervisor/hypervisor_test.go b/pkg/hypervisor/hypervisor_test.go index 242615205f..ff545a6f45 100644 --- a/pkg/hypervisor/hypervisor_test.go +++ b/pkg/hypervisor/hypervisor_test.go @@ -13,7 +13,7 @@ import ( "strings" "testing" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/hypervisor/user.go b/pkg/hypervisor/user.go index 44a383f028..4b6886e323 100644 --- a/pkg/hypervisor/user.go +++ b/pkg/hypervisor/user.go @@ -10,7 +10,7 @@ import ( "time" "unicode" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "go.etcd.io/bbolt" ) diff --git a/pkg/hypervisor/user_manager.go b/pkg/hypervisor/user_manager.go index df708751e7..2d675c6b8b 100644 --- a/pkg/hypervisor/user_manager.go +++ b/pkg/hypervisor/user_manager.go @@ -12,7 +12,7 @@ import ( "github.com/google/uuid" "github.com/gorilla/securecookie" - "github.com/SkycoinProject/dmsg/httputil" + "github.com/skycoin/dmsg/httputil" ) const ( diff --git a/pkg/restart/restart_test.go b/pkg/restart/restart_test.go index ed224bf91f..4d774b86c5 100644 --- a/pkg/restart/restart_test.go +++ b/pkg/restart/restart_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/routefinder/rfclient/client.go b/pkg/routefinder/rfclient/client.go index b7e333e6a8..a5de59cee2 100644 --- a/pkg/routefinder/rfclient/client.go +++ b/pkg/routefinder/rfclient/client.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" ) diff --git a/pkg/routefinder/rfclient/mock.go b/pkg/routefinder/rfclient/mock.go index 8317ed3cab..498f81e64e 100644 --- a/pkg/routefinder/rfclient/mock.go +++ b/pkg/routefinder/rfclient/mock.go @@ -3,7 +3,7 @@ package rfclient import ( "fmt" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "golang.org/x/net/context" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/router/mock_router.go b/pkg/router/mock_router.go index 99f8d41584..2e2acaf3e4 100644 --- a/pkg/router/mock_router.go +++ b/pkg/router/mock_router.go @@ -5,7 +5,7 @@ package router import ( context "context" - cipher "github.com/SkycoinProject/dmsg/cipher" + cipher "github.com/skycoin/dmsg/cipher" mock "github.com/stretchr/testify/mock" diff --git a/pkg/router/route_group.go b/pkg/router/route_group.go index 4d8e4d31fb..a57fbbd72d 100644 --- a/pkg/router/route_group.go +++ b/pkg/router/route_group.go @@ -11,8 +11,8 @@ import ( "sync/atomic" "time" - "github.com/SkycoinProject/dmsg/ioutil" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/ioutil" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/transport" diff --git a/pkg/router/route_group_test.go b/pkg/router/route_group_test.go index b5d0d6c1cd..845ca1d564 100644 --- a/pkg/router/route_group_test.go +++ b/pkg/router/route_group_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/router/router.go b/pkg/router/router.go index 038eaea53d..158eeaa79a 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -11,9 +11,9 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routefinder/rfclient" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/router/router_test.go b/pkg/router/router_test.go index e321b8f67d..e45696e240 100644 --- a/pkg/router/router_test.go +++ b/pkg/router/router_test.go @@ -12,10 +12,10 @@ import ( "github.com/sirupsen/logrus" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/router/routerclient/client.go b/pkg/router/routerclient/client.go index 5957978cb2..a82a2deefd 100644 --- a/pkg/router/routerclient/client.go +++ b/pkg/router/routerclient/client.go @@ -4,7 +4,7 @@ import ( "context" "net/rpc" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/snet" diff --git a/pkg/router/routerclient/client_test.go b/pkg/router/routerclient/client_test.go index da7f8add80..7e86c3d48e 100644 --- a/pkg/router/routerclient/client_test.go +++ b/pkg/router/routerclient/client_test.go @@ -6,7 +6,7 @@ import ( "net/rpc" "testing" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/router/routerclient/wrappers.go b/pkg/router/routerclient/wrappers.go index 12310e7d8e..aa482a31a6 100644 --- a/pkg/router/routerclient/wrappers.go +++ b/pkg/router/routerclient/wrappers.go @@ -7,9 +7,9 @@ import ( "github.com/skycoin/skywire/pkg/snet" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" ) diff --git a/pkg/router/rpc_gateway.go b/pkg/router/rpc_gateway.go index ca6bbd7db0..1ad26fc3ca 100644 --- a/pkg/router/rpc_gateway.go +++ b/pkg/router/rpc_gateway.go @@ -1,7 +1,7 @@ package router import ( - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" ) diff --git a/pkg/router/rpc_gateway_test.go b/pkg/router/rpc_gateway_test.go index 1e3153c96a..c97f34ba4f 100644 --- a/pkg/router/rpc_gateway_test.go +++ b/pkg/router/rpc_gateway_test.go @@ -3,7 +3,7 @@ package router import ( "testing" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/require" "github.com/skycoin/skywire/internal/testhelpers" diff --git a/pkg/routing/addr.go b/pkg/routing/addr.go index c41e230c35..ff72a137da 100644 --- a/pkg/routing/addr.go +++ b/pkg/routing/addr.go @@ -3,7 +3,7 @@ package routing import ( "fmt" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) // Port is a network port number diff --git a/pkg/routing/route.go b/pkg/routing/route.go index 2e7c0607d3..c24c0af2aa 100644 --- a/pkg/routing/route.go +++ b/pkg/routing/route.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/SkycoinProject/dmsg/cipher" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" ) // Route is a succession of transport entries that denotes a path from source visor to destination visor diff --git a/pkg/routing/route_descriptor.go b/pkg/routing/route_descriptor.go index 047b86276f..ae5d945c1a 100644 --- a/pkg/routing/route_descriptor.go +++ b/pkg/routing/route_descriptor.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "fmt" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) // RouteDescriptor describes a route (from the perspective of the source and destination edges). diff --git a/pkg/routing/route_descriptor_test.go b/pkg/routing/route_descriptor_test.go index 61ac184bd8..5a59d02772 100644 --- a/pkg/routing/route_descriptor_test.go +++ b/pkg/routing/route_descriptor_test.go @@ -3,7 +3,7 @@ package routing import ( "testing" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/require" ) diff --git a/pkg/routing/rule.go b/pkg/routing/rule.go index e5d1f04f18..edebf487b8 100644 --- a/pkg/routing/rule.go +++ b/pkg/routing/rule.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - "github.com/SkycoinProject/dmsg/cipher" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" ) // RuleHeaderSize represents the base size of a rule. diff --git a/pkg/routing/rule_test.go b/pkg/routing/rule_test.go index c60d0e5c2a..b63ac77cab 100644 --- a/pkg/routing/rule_test.go +++ b/pkg/routing/rule_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg/cipher" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/assert" ) diff --git a/pkg/routing/table_test.go b/pkg/routing/table_test.go index df5660bb4c..025b8fb81f 100644 --- a/pkg/routing/table_test.go +++ b/pkg/routing/table_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/setup/config.go b/pkg/setup/config.go index 9446728e02..eb30c65902 100644 --- a/pkg/setup/config.go +++ b/pkg/setup/config.go @@ -3,7 +3,7 @@ package setup import ( "time" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) // Various timeouts for setup node. diff --git a/pkg/setup/idreservoir.go b/pkg/setup/idreservoir.go index 65cd1ebbe3..2f78fbf794 100644 --- a/pkg/setup/idreservoir.go +++ b/pkg/setup/idreservoir.go @@ -7,9 +7,9 @@ import ( "fmt" "sync" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" ) diff --git a/pkg/setup/node.go b/pkg/setup/node.go index f776f3351d..4312df61f0 100644 --- a/pkg/setup/node.go +++ b/pkg/setup/node.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/disc" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/disc" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/metrics" "github.com/skycoin/skywire/pkg/router/routerclient" diff --git a/pkg/setup/node_test.go b/pkg/setup/node_test.go index 8da5e7c5cb..1db1a89175 100644 --- a/pkg/setup/node_test.go +++ b/pkg/setup/node_test.go @@ -18,10 +18,10 @@ import ( "github.com/skycoin/skywire/pkg/snet/snettest" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/pkg/setup/rpc_gateway.go b/pkg/setup/rpc_gateway.go index 1bbf0be204..c910e5f97b 100644 --- a/pkg/setup/rpc_gateway.go +++ b/pkg/setup/rpc_gateway.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" ) diff --git a/pkg/setup/setupclient/client.go b/pkg/setup/setupclient/client.go index 7e21444448..1ae2b0a3bd 100644 --- a/pkg/setup/setupclient/client.go +++ b/pkg/setup/setupclient/client.go @@ -5,8 +5,8 @@ import ( "errors" "net/rpc" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/snet" diff --git a/pkg/setup/setupclient/wrappers.go b/pkg/setup/setupclient/wrappers.go index d735145e56..7201ce317f 100644 --- a/pkg/setup/setupclient/wrappers.go +++ b/pkg/setup/setupclient/wrappers.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/snet" diff --git a/pkg/skyenv/values.go b/pkg/skyenv/values.go index e7ecc0bea1..7e4adcb336 100644 --- a/pkg/skyenv/values.go +++ b/pkg/skyenv/values.go @@ -1,7 +1,7 @@ package skyenv import ( - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) // Constants for default services. diff --git a/pkg/snet/network.go b/pkg/snet/network.go index 6cca119d0b..d645fd071a 100644 --- a/pkg/snet/network.go +++ b/pkg/snet/network.go @@ -11,11 +11,11 @@ import ( "github.com/skycoin/skywire/pkg/snet/stcp" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/disc" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/disc" ) // Default ports. diff --git a/pkg/snet/network_test.go b/pkg/snet/network_test.go index f8a87b1809..d21d517588 100644 --- a/pkg/snet/network_test.go +++ b/pkg/snet/network_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" ) func TestDisassembleAddr(t *testing.T) { diff --git a/pkg/snet/snettest/env.go b/pkg/snet/snettest/env.go index 0b09d03452..f3c9247e6e 100644 --- a/pkg/snet/snettest/env.go +++ b/pkg/snet/snettest/env.go @@ -5,9 +5,9 @@ import ( "strconv" "testing" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/disc" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/disc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" diff --git a/pkg/snet/stcp/client.go b/pkg/snet/stcp/client.go index bf2e004ae9..7de2a21bf4 100644 --- a/pkg/snet/stcp/client.go +++ b/pkg/snet/stcp/client.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" ) // Type is stcp type. diff --git a/pkg/snet/stcp/client_test.go b/pkg/snet/stcp/client_test.go index 3a6709f6f9..9fc362c5cc 100644 --- a/pkg/snet/stcp/client_test.go +++ b/pkg/snet/stcp/client_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/require" "golang.org/x/net/nettest" ) diff --git a/pkg/snet/stcp/handshake.go b/pkg/snet/stcp/handshake.go index 7b55a5d748..0671641b6c 100644 --- a/pkg/snet/stcp/handshake.go +++ b/pkg/snet/stcp/handshake.go @@ -9,10 +9,10 @@ import ( "net" "time" - cipher2 "github.com/SkycoinProject/skycoin/src/cipher" + cipher2 "github.com/skycoin/skycoin/src/cipher" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" ) const ( diff --git a/pkg/snet/stcp/handshake_test.go b/pkg/snet/stcp/handshake_test.go index 075b923079..a4c5abcb0a 100644 --- a/pkg/snet/stcp/handshake_test.go +++ b/pkg/snet/stcp/handshake_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/snet/stcp/pktable.go b/pkg/snet/stcp/pktable.go index 1f5b192592..fd5f740160 100644 --- a/pkg/snet/stcp/pktable.go +++ b/pkg/snet/stcp/pktable.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) // PKTable associates public keys to tcp addresses. diff --git a/pkg/transport-discovery/client/client.go b/pkg/transport-discovery/client/client.go index 3b03bf3938..6a2ccb55fc 100644 --- a/pkg/transport-discovery/client/client.go +++ b/pkg/transport-discovery/client/client.go @@ -8,10 +8,10 @@ import ( "fmt" "net/http" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/httputil" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/httputil" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/internal/httpauth" "github.com/skycoin/skywire/pkg/transport" diff --git a/pkg/transport-discovery/client/client_test.go b/pkg/transport-discovery/client/client_test.go index 54057b92d9..3272e1b91d 100644 --- a/pkg/transport-discovery/client/client_test.go +++ b/pkg/transport-discovery/client/client_test.go @@ -11,8 +11,8 @@ import ( "sync" "testing" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/transport/discovery.go b/pkg/transport/discovery.go index 5fbcafa25b..8e38440299 100644 --- a/pkg/transport/discovery.go +++ b/pkg/transport/discovery.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg/cipher" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" ) // DiscoveryClient performs Transport discovery operations. diff --git a/pkg/transport/discovery_test.go b/pkg/transport/discovery_test.go index c2e42808a0..de633dd8d6 100644 --- a/pkg/transport/discovery_test.go +++ b/pkg/transport/discovery_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/transport" ) diff --git a/pkg/transport/entry.go b/pkg/transport/entry.go index ac7c6d18ca..9c323dbfca 100644 --- a/pkg/transport/entry.go +++ b/pkg/transport/entry.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "github.com/SkycoinProject/dmsg/cipher" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" ) var ( diff --git a/pkg/transport/entry_test.go b/pkg/transport/entry_test.go index 7d8af44f6c..dc9d60a636 100644 --- a/pkg/transport/entry_test.go +++ b/pkg/transport/entry_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/transport" ) diff --git a/pkg/transport/handshake.go b/pkg/transport/handshake.go index ad523b3140..1baf4be1a7 100644 --- a/pkg/transport/handshake.go +++ b/pkg/transport/handshake.go @@ -8,8 +8,8 @@ import ( "io" "net/http" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/httputil" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/httputil" "github.com/skycoin/skywire/pkg/snet" ) diff --git a/pkg/transport/handshake_test.go b/pkg/transport/handshake_test.go index 7d3adfb619..d0225a768b 100644 --- a/pkg/transport/handshake_test.go +++ b/pkg/transport/handshake_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg" + "github.com/skycoin/dmsg" "github.com/stretchr/testify/require" "github.com/skycoin/skywire/pkg/skyenv" diff --git a/pkg/transport/managed_transport.go b/pkg/transport/managed_transport.go index 3d88f21b0a..9e1ec941fb 100644 --- a/pkg/transport/managed_transport.go +++ b/pkg/transport/managed_transport.go @@ -11,10 +11,10 @@ import ( "sync/atomic" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/httputil" - "github.com/SkycoinProject/dmsg/netutil" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/httputil" + "github.com/skycoin/dmsg/netutil" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/skyenv" diff --git a/pkg/transport/manager.go b/pkg/transport/manager.go index 0b6f6d3fcd..bf373440fa 100644 --- a/pkg/transport/manager.go +++ b/pkg/transport/manager.go @@ -14,9 +14,9 @@ import ( "github.com/skycoin/skywire/pkg/snet" "github.com/skycoin/skywire/pkg/snet/snettest" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" ) // ManagerConfig configures a Manager. diff --git a/pkg/transport/manager_test.go b/pkg/transport/manager_test.go index ea57209f95..b2b3083aeb 100644 --- a/pkg/transport/manager_test.go +++ b/pkg/transport/manager_test.go @@ -9,14 +9,14 @@ import ( "testing" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/snet/snettest" "github.com/skycoin/skywire/pkg/transport" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/transport/transport.go b/pkg/transport/transport.go index 353bf45086..d4af4a0e4e 100644 --- a/pkg/transport/transport.go +++ b/pkg/transport/transport.go @@ -6,9 +6,9 @@ import ( "crypto/sha256" "math/big" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" ) var log = logging.MustGetLogger("transport") diff --git a/pkg/util/pathutil/configpath.go b/pkg/util/pathutil/configpath.go index 29070696b6..48dc1621f7 100644 --- a/pkg/util/pathutil/configpath.go +++ b/pkg/util/pathutil/configpath.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" ) var log = logging.MustGetLogger("pathutil") @@ -94,7 +94,7 @@ func HypervisorDefaults() ConfigPaths { } paths[HomeLoc] = filepath.Join(HomeDir(), ".skycoin/hypervisor/hypervisor-config.json") - paths[LocalLoc] = "/usr/local/SkycoinProject/hypervisor/hypervisor-config.json" + paths[LocalLoc] = "/usr/local/skycoin/hypervisor/hypervisor-config.json" return paths } diff --git a/pkg/util/updater/updater.go b/pkg/util/updater/updater.go index 8d542a5afb..94f12209f4 100644 --- a/pkg/util/updater/updater.go +++ b/pkg/util/updater/updater.go @@ -18,9 +18,9 @@ import ( "time" "unicode" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/mholt/archiver/v3" "github.com/schollz/progressbar/v2" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/restart" "github.com/skycoin/skywire/pkg/util/buildinfo" diff --git a/pkg/visor/config.go b/pkg/visor/config.go index e796f352f4..844b7bd77c 100644 --- a/pkg/visor/config.go +++ b/pkg/visor/config.go @@ -11,10 +11,10 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/dmsgpty" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/dmsgpty" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/visor/config_test.go b/pkg/visor/config_test.go index ed72dc7675..7b5704646d 100644 --- a/pkg/visor/config_test.go +++ b/pkg/visor/config_test.go @@ -8,7 +8,7 @@ import ( "path/filepath" "testing" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/visor/rpc.go b/pkg/visor/rpc.go index b9bf804023..4ce45b2aff 100644 --- a/pkg/visor/rpc.go +++ b/pkg/visor/rpc.go @@ -10,9 +10,9 @@ import ( "path/filepath" "time" - "github.com/SkycoinProject/dmsg/cipher" "github.com/google/uuid" "github.com/sirupsen/logrus" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skywire/pkg/app" "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/visor/rpc_client.go b/pkg/visor/rpc_client.go index 568617155a..b01234bd5b 100644 --- a/pkg/visor/rpc_client.go +++ b/pkg/visor/rpc_client.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app" "github.com/skycoin/skywire/pkg/router" diff --git a/pkg/visor/rpc_client_serve.go b/pkg/visor/rpc_client_serve.go index 62f77bd9e0..8cdc34a5ed 100644 --- a/pkg/visor/rpc_client_serve.go +++ b/pkg/visor/rpc_client_serve.go @@ -4,9 +4,9 @@ import ( "context" "net/rpc" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/netutil" "github.com/sirupsen/logrus" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/netutil" "github.com/skycoin/skywire/pkg/snet" ) diff --git a/pkg/visor/rpc_test.go b/pkg/visor/rpc_test.go index b9a0bbaf79..40528d6856 100644 --- a/pkg/visor/rpc_test.go +++ b/pkg/visor/rpc_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/sirupsen/logrus" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/pkg/visor/visor.go b/pkg/visor/visor.go index bdb1c779f6..734e89f3d2 100644 --- a/pkg/visor/visor.go +++ b/pkg/visor/visor.go @@ -17,10 +17,10 @@ import ( "syscall" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/dmsgpty" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/dmsgpty" + "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/app/appcommon" "github.com/skycoin/skywire/pkg/app/appnet" diff --git a/pkg/visor/visor_test.go b/pkg/visor/visor_test.go index 81965757ab..efb3c47003 100644 --- a/pkg/visor/visor_test.go +++ b/pkg/visor/visor_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/SkycoinProject/dmsg" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/disc" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/disc" + "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go b/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go deleted file mode 100644 index 2ea702c3a3..0000000000 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go +++ /dev/null @@ -1,280 +0,0 @@ -package secp256k1go - -import ( - "bytes" - "log" -) - -// Signature represents the signature -type Signature struct { - R, S Number -} - -// Verify verify the signature -func (sig *Signature) Verify(pubkey *XY, message *Number) bool { - var r2 Number - return sig.recompute(&r2, pubkey, message) && sig.R.Cmp(&r2.Int) == 0 -} - -func (sig *Signature) recompute(r2 *Number, pubkey *XY, message *Number) bool { - var sn, u1, u2 Number - - sn.modInv(&sig.S, &TheCurve.Order) - u1.modMul(&sn, message, &TheCurve.Order) - u2.modMul(&sn, &sig.R, &TheCurve.Order) - - var pr, pubkeyj XYZ - pubkeyj.SetXY(pubkey) - - pubkeyj.ECmult(&pr, &u2, &u1) - if pr.IsInfinity() { - return false - } - - var xr Field - pr.getX(&xr) - xr.Normalize() - var xrb [32]byte - xr.GetB32(xrb[:]) - r2.SetBytes(xrb[:]) - r2.Mod(&r2.Int, &TheCurve.Order.Int) - - return true -} - -/* -Reference code for Signature.Recover - -https://github.com/bitcoin-core/secp256k1/blob/e541a90ef6461007d9c6a74b9f9a7fb8aa34aaa8/src/modules/recovery/main_impl.h - -static int secp256k1_ecdsa_sig_recover(const secp256k1_ecmult_context *ctx, const secp256k1_scalar *sigr, const secp256k1_scalar* sigs, secp256k1_ge *pubkey, const secp256k1_scalar *message, int recid) { - unsigned char brx[32]; - secp256k1_fe fx; - secp256k1_ge x; - secp256k1_gej xj; - secp256k1_scalar rn, u1, u2; - secp256k1_gej qj; - int r; - - if (secp256k1_scalar_is_zero(sigr) || secp256k1_scalar_is_zero(sigs)) { - return 0; - } - - secp256k1_scalar_get_b32(brx, sigr); - r = secp256k1_fe_set_b32(&fx, brx); - (void)r; - VERIFY_CHECK(r); // brx comes from a scalar, so is less than the order; certainly less than p - if (recid & 2) { - if (secp256k1_fe_cmp_var(&fx, &secp256k1_ecdsa_const_p_minus_order) >= 0) { - return 0; - } - secp256k1_fe_add(&fx, &secp256k1_ecdsa_const_order_as_fe); - } - if (!secp256k1_ge_set_xo_var(&x, &fx, recid & 1)) { - return 0; - } - secp256k1_gej_set_ge(&xj, &x); - secp256k1_scalar_inverse_var(&rn, sigr); - secp256k1_scalar_mul(&u1, &rn, message); - secp256k1_scalar_negate(&u1, &u1); - secp256k1_scalar_mul(&u2, &rn, sigs); - secp256k1_ecmult(ctx, &qj, &xj, &u2, &u1); - secp256k1_ge_set_gej_var(pubkey, &qj); - return !secp256k1_gej_is_infinity(&qj); -} -*/ - -// Recover recovers a pubkey XY point given the message that was signed to create -// this signature. -func (sig *Signature) Recover(pubkey *XY, msg *Number, recid int) bool { - var rx, rn, u1, u2 Number - var fx Field - var x XY - var xj, qj XYZ - - if sig.R.Sign() == 0 || sig.S.Sign() == 0 { - return false - } - - rx.Set(&sig.R.Int) - if (recid & 2) != 0 { - rx.Add(&rx.Int, &TheCurve.Order.Int) - if rx.Cmp(&TheCurve.p.Int) >= 0 { - return false - } - } - - fx.SetB32(LeftPadBytes(rx.Bytes(), 32)) - - x.SetXO(&fx, (recid&1) != 0) - if !x.IsValid() { - return false - } - - xj.SetXY(&x) - rn.modInv(&sig.R, &TheCurve.Order) - u1.modMul(&rn, msg, &TheCurve.Order) - u1.Sub(&TheCurve.Order.Int, &u1.Int) - u2.modMul(&rn, &sig.S, &TheCurve.Order) - xj.ECmult(&qj, &u2, &u1) - pubkey.SetXYZ(&qj) - return !qj.IsInfinity() -} - -/* -Reference code for Signature.Sign - -https://github.com/bitcoin-core/secp256k1/blob/master/src/ecdsa_impl.h - -static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar *sigr, secp256k1_scalar *sigs, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid) { - unsigned char b[32]; - secp256k1_gej rp; - secp256k1_ge r; - secp256k1_scalar n; - int overflow = 0; - - secp256k1_ecmult_gen(ctx, &rp, nonce); - secp256k1_ge_set_gej(&r, &rp); - secp256k1_fe_normalize(&r.x); - secp256k1_fe_normalize(&r.y); - secp256k1_fe_get_b32(b, &r.x); - secp256k1_scalar_set_b32(sigr, b, &overflow); - // These two conditions should be checked before calling - VERIFY_CHECK(!secp256k1_scalar_is_zero(sigr)); - VERIFY_CHECK(overflow == 0); - - if (recid) { - // The overflow condition is cryptographically unreachable as hitting it requires finding the discrete log - // of some P where P.x >= order, and only 1 in about 2^127 points meet this criteria. - *recid = (overflow ? 2 : 0) | (secp256k1_fe_is_odd(&r.y) ? 1 : 0); - } - secp256k1_scalar_mul(&n, sigr, seckey); - secp256k1_scalar_add(&n, &n, message); - secp256k1_scalar_inverse(sigs, nonce); - secp256k1_scalar_mul(sigs, sigs, &n); - secp256k1_scalar_clear(&n); - secp256k1_gej_clear(&rp); - secp256k1_ge_clear(&r); - if (secp256k1_scalar_is_zero(sigs)) { - return 0; - } - if (secp256k1_scalar_is_high(sigs)) { - secp256k1_scalar_negate(sigs, sigs); - if (recid) { - *recid ^= 1; - } - } - return 1; -} -*/ - -// Sign signs the signature. Returns 1 on success, 0 on failure -func (sig *Signature) Sign(seckey, message, nonce *Number, recid *int) int { - var r XY - var n Number - var b [32]byte - - // r = nonce*G - rp := ECmultGen(*nonce) - r.SetXYZ(&rp) - r.X.Normalize() - r.Y.Normalize() - r.X.GetB32(b[:]) - sig.R.SetBytes(b[:]) - - if sig.R.Sign() == 0 { - log.Panic("sig R value should not be 0") - } - - if recid != nil { - *recid = 0 - // The overflow condition is cryptographically unreachable as hitting - // it requires finding the discrete log of some P where P.x >= order, - // and only 1 in about 2^127 points meet this criteria. - if sig.R.Cmp(&TheCurve.Order.Int) >= 0 { - *recid |= 2 - } - if r.Y.IsOdd() { - *recid |= 1 - } - } - - sig.R.mod(&TheCurve.Order) - n.modMul(&sig.R, seckey, &TheCurve.Order) - n.Add(&n.Int, &message.Int) - n.mod(&TheCurve.Order) - sig.S.modInv(nonce, &TheCurve.Order) - sig.S.modMul(&sig.S, &n, &TheCurve.Order) - - if sig.S.Sign() == 0 { - return 0 - } - - // Break signature malleability - if sig.S.Cmp(&TheCurve.halfOrder.Int) == 1 { - sig.S.Sub(&TheCurve.Order.Int, &sig.S.Int) - if recid != nil { - *recid ^= 1 - } - } - - return 1 -} - -// ParseBytes parses a serialized R||S pair to Signature. -// R and S should be in big-endian encoding. -func (sig *Signature) ParseBytes(v []byte) { - if len(v) != 64 { - log.Panic("Signature.ParseBytes requires 64 bytes") - } - sig.R.SetBytes(v[0:32]) - sig.S.SetBytes(v[32:64]) -} - -//secp256k1_num_get_bin(sig64, 32, &sig.r); -//secp256k1_num_get_bin(sig64 + 32, 32, &sig.s); - -// Bytes serializes compressed signatures as bytes. -// The serialization format is R||S. R and S bytes are big-endian. -// R and S are left-padded with the NUL byte to ensure their length is 32 bytes. -func (sig *Signature) Bytes() []byte { - r := sig.R.Bytes() // big-endian - s := sig.S.Bytes() // big-endian - - for len(r) < 32 { - r = append([]byte{0}, r...) - } - for len(s) < 32 { - s = append([]byte{0}, s...) - } - - if len(r) != 32 || len(s) != 32 { - log.Panicf("signature size invalid: %d, %d", len(r), len(s)) - } - - res := new(bytes.Buffer) - if _, err := res.Write(r); err != nil { - log.Panic(err) - } - if _, err := res.Write(s); err != nil { - log.Panic(err) - } - - //test - if true { - ret := res.Bytes() - var sig2 Signature - sig2.ParseBytes(ret) - if !bytes.Equal(sig.R.Bytes(), sig2.R.Bytes()) { - log.Panic("serialization failed 1") - } - if !bytes.Equal(sig.S.Bytes(), sig2.S.Bytes()) { - log.Panic("serialization failed 2") - } - } - - if len(res.Bytes()) != 64 { - log.Panic("Signature.Bytes result bytes must be 64 bytes long") - } - return res.Bytes() -} diff --git a/vendor/github.com/SkycoinProject/dmsg/.gitignore b/vendor/github.com/skycoin/dmsg/.gitignore similarity index 54% rename from vendor/github.com/SkycoinProject/dmsg/.gitignore rename to vendor/github.com/skycoin/dmsg/.gitignore index 3aa72e870b..7084aa6b1c 100644 --- a/vendor/github.com/SkycoinProject/dmsg/.gitignore +++ b/vendor/github.com/skycoin/dmsg/.gitignore @@ -12,8 +12,8 @@ .idea/ bin/ -dmsg-discovery -dmsg-server -dmsgpty-cli -dmsgpty-host -dmsgpty-ui +/dmsg-discovery +/dmsg-server +/dmsgpty-cli +/dmsgpty-host +/dmsgpty-ui diff --git a/vendor/github.com/SkycoinProject/dmsg/.golangci.yml b/vendor/github.com/skycoin/dmsg/.golangci.yml similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/.golangci.yml rename to vendor/github.com/skycoin/dmsg/.golangci.yml diff --git a/vendor/github.com/SkycoinProject/dmsg/.travis.yml b/vendor/github.com/skycoin/dmsg/.travis.yml similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/.travis.yml rename to vendor/github.com/skycoin/dmsg/.travis.yml diff --git a/vendor/github.com/SkycoinProject/dmsg/Makefile b/vendor/github.com/skycoin/dmsg/Makefile similarity index 95% rename from vendor/github.com/SkycoinProject/dmsg/Makefile rename to vendor/github.com/skycoin/dmsg/Makefile index c9898b9086..4e4faa69a3 100644 --- a/vendor/github.com/SkycoinProject/dmsg/Makefile +++ b/vendor/github.com/skycoin/dmsg/Makefile @@ -19,7 +19,7 @@ ifneq (,$(findstring 64,$(GOARCH))) TEST_OPTS:=$(TEST_OPTS) $(RACE_FLAG) endif -SKYWIRE_MAINNET := github.com/SkycoinProject/skywire-mainnet +SKYWIRE_MAINNET := github.com/skycoin/skywire BUILDINFO_PATH := $(SKYWIRE_MAINNET)/pkg/util/buildinfo BUILDINFO_VERSION := -X $(BUILDINFO_PATH).version=$(VERSION) @@ -53,7 +53,7 @@ install-linters: ## Install linters ${OPTS} go get -u golang.org/x/tools/cmd/goimports format: ## Formats the code. Must have goimports installed (use make install-linters). - ${OPTS} goimports -w -local github.com/SkycoinProject/dmsg . + ${OPTS} goimports -w -local github.com/skycoin/dmsg . dep: ## Sorts dependencies ${OPTS} go mod download diff --git a/vendor/github.com/SkycoinProject/dmsg/README.md b/vendor/github.com/skycoin/dmsg/README.md similarity index 91% rename from vendor/github.com/SkycoinProject/dmsg/README.md rename to vendor/github.com/skycoin/dmsg/README.md index b83ba96dcc..192d3bb5ab 100644 --- a/vendor/github.com/SkycoinProject/dmsg/README.md +++ b/vendor/github.com/skycoin/dmsg/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.com/SkycoinProject/dmsg.svg?branch=master)](https://travis-ci.com/SkycoinProject/dmsg) +[![Build Status](https://travis-ci.com/skycoin/dmsg.svg?branch=master)](https://travis-ci.com/skycoin/dmsg) # dmsg diff --git a/vendor/github.com/SkycoinProject/dmsg/TESTING.md b/vendor/github.com/skycoin/dmsg/TESTING.md similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/TESTING.md rename to vendor/github.com/skycoin/dmsg/TESTING.md diff --git a/vendor/github.com/SkycoinProject/dmsg/cipher/cipher.go b/vendor/github.com/skycoin/dmsg/cipher/cipher.go similarity index 98% rename from vendor/github.com/SkycoinProject/dmsg/cipher/cipher.go rename to vendor/github.com/skycoin/dmsg/cipher/cipher.go index 55f0a4df9f..9b140badfb 100644 --- a/vendor/github.com/SkycoinProject/dmsg/cipher/cipher.go +++ b/vendor/github.com/skycoin/dmsg/cipher/cipher.go @@ -1,5 +1,5 @@ // Package cipher implements common golang encoding interfaces for -// github.com/SkycoinProject/skycoin/src/cipher +// github.com/skycoin/skycoin/src/cipher package cipher import ( @@ -8,7 +8,7 @@ import ( "math/big" "strings" - "github.com/SkycoinProject/skycoin/src/cipher" + "github.com/skycoin/skycoin/src/cipher" ) func init() { diff --git a/vendor/github.com/SkycoinProject/dmsg/client.go b/vendor/github.com/skycoin/dmsg/client.go similarity index 77% rename from vendor/github.com/SkycoinProject/dmsg/client.go rename to vendor/github.com/skycoin/dmsg/client.go index 083b0a298c..25785adee8 100644 --- a/vendor/github.com/SkycoinProject/dmsg/client.go +++ b/vendor/github.com/skycoin/dmsg/client.go @@ -8,20 +8,43 @@ import ( "sync" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/sirupsen/logrus" + "github.com/skycoin/skycoin/src/util/logging" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/disc" - "github.com/SkycoinProject/dmsg/netutil" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/disc" + "github.com/skycoin/dmsg/netutil" ) // TODO(evanlinjin): We should implement exponential backoff at some point. const serveWait = time.Second +// SessionDialCallback is triggered BEFORE a session is dialed to. +// If a non-nil error is returned, the session dial is instantly terminated. +type SessionDialCallback func(network, addr string) (err error) + +// SessionDisconnectCallback triggers after a session is closed. +type SessionDisconnectCallback func(network, addr string, err error) + +// ClientCallbacks contains callbacks which a Client uses. +type ClientCallbacks struct { + OnSessionDial SessionDialCallback + OnSessionDisconnect SessionDisconnectCallback +} + +func (sc *ClientCallbacks) ensure() { + if sc.OnSessionDial == nil { + sc.OnSessionDial = func(network, addr string) (err error) { return nil } + } + if sc.OnSessionDisconnect == nil { + sc.OnSessionDisconnect = func(network, addr string, err error) {} + } +} + // Config configures a dmsg client entity. type Config struct { MinSessions int + Callbacks *ClientCallbacks } // PrintWarnings prints warnings with config. @@ -51,7 +74,6 @@ type Client struct { errCh chan error done chan struct{} once sync.Once - sesMx sync.Mutex } @@ -79,6 +101,10 @@ func NewClient(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, conf *Conf if conf == nil { conf = DefaultConfig() } + if conf.Callbacks == nil { + conf.Callbacks = new(ClientCallbacks) + } + conf.Callbacks.ensure() c.conf = conf c.conf.PrintWarnings(c.log) @@ -249,6 +275,18 @@ func (ce *Client) AllSessions() []ClientSession { return ce.allClientSessions(ce.porter) } +// ConnectedServers obtains all the servers client is connected to. +// +// Deprecated: we can now obtain the remote TCP address of a session from the ClientSession struct directly. +func (ce *Client) ConnectedServers() []string { + sessions := ce.allClientSessions(ce.porter) + addrs := make([]string, len(sessions)) + for i, s := range sessions { + addrs[i] = s.RemoteTCPAddr().String() + } + return addrs +} + // EnsureAndObtainSession attempts to obtain a session. // If the session does not exist, we will attempt to establish one. // It returns an error if the session does not exist AND cannot be established. @@ -287,13 +325,27 @@ func (ce *Client) ensureSession(ctx context.Context, entry *disc.Entry) error { // It is expected that the session is created and served before the context cancels, otherwise an error will be returned. // NOTE: This should not be called directly as it may lead to session duplicates. // Only `ensureSession` or `EnsureAndObtainSession` should call this function. -func (ce *Client) dialSession(ctx context.Context, entry *disc.Entry) (ClientSession, error) { +func (ce *Client) dialSession(ctx context.Context, entry *disc.Entry) (cs ClientSession, err error) { ce.log.WithField("remote_pk", entry.Static).Info("Dialing session...") - conn, err := net.Dial("tcp", entry.Server.Address) + const network = "tcp" + + // Trigger dial callback. + if err := ce.conf.Callbacks.OnSessionDial(network, entry.Server.Address); err != nil { + return ClientSession{}, fmt.Errorf("session dial is rejected by callback: %w", err) + } + defer func() { + if err != nil { + // Trigger disconnect callback when dial fails. + ce.conf.Callbacks.OnSessionDisconnect(network, entry.Server.Address, err) + } + }() + + conn, err := net.Dial(network, entry.Server.Address) if err != nil { return ClientSession{}, err } + dSes, err := makeClientSession(&ce.EntityCommon, ce.porter, conn, entry.Static) if err != nil { return ClientSession{}, err @@ -303,12 +355,19 @@ func (ce *Client) dialSession(ctx context.Context, entry *disc.Entry) (ClientSes _ = dSes.Close() //nolint:errcheck return ClientSession{}, errors.New("session already exists") } + go func() { ce.log.WithField("remote_pk", dSes.RemotePK()).Info("Serving session.") - if err := dSes.serve(); !isClosed(ce.done) { + err := dSes.serve() + if !isClosed(ce.done) { + // We should only report an error when client is not closed. + // Also, when the client is closed, it will automatically delete all sessions. ce.errCh <- fmt.Errorf("failed to serve dialed session to %s: %v", dSes.RemotePK(), err) ce.delSession(ctx, dSes.RemotePK()) } + + // Trigger disconnect callback. + ce.conf.Callbacks.OnSessionDisconnect(network, entry.Server.Address, err) }() return dSes, nil diff --git a/vendor/github.com/SkycoinProject/dmsg/client_session.go b/vendor/github.com/skycoin/dmsg/client_session.go similarity index 89% rename from vendor/github.com/SkycoinProject/dmsg/client_session.go rename to vendor/github.com/skycoin/dmsg/client_session.go index 12f9ee4a85..8747739326 100644 --- a/vendor/github.com/SkycoinProject/dmsg/client_session.go +++ b/vendor/github.com/skycoin/dmsg/client_session.go @@ -4,8 +4,8 @@ import ( "net" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/netutil" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/netutil" ) // ClientSession represents a session from the perspective of a dmsg client. @@ -26,6 +26,10 @@ func makeClientSession(entity *EntityCommon, porter *netutil.Porter, conn net.Co // DialStream attempts to dial a stream to a remote client via the dmsg server that this session is connected to. func (cs *ClientSession) DialStream(dst Addr) (dStr *Stream, err error) { + log := cs.log. + WithField("func", "ClientSession.DialStream"). + WithField("dst_addr", dst) + if dStr, err = newInitiatingStream(cs); err != nil { return nil, err } @@ -33,8 +37,9 @@ func (cs *ClientSession) DialStream(dst Addr) (dStr *Stream, err error) { // Close stream on failure. defer func() { if err != nil { - cs.log.WithError(dStr.Close()). - Debug("Stream closed on DialStream() failure.") + log.WithError(err). + WithField("close_error", dStr.Close()). + Debug("Stream closed on failure.") } }() @@ -74,7 +79,7 @@ func (cs *ClientSession) serve() error { if netErr, ok := err.(net.Error); ok && netErr.Temporary() { cs.log. WithError(err). - Info("ClientSession.acceptStream() temporary error, continuing...") + Info("Failed to accept stream.") continue } cs.log.WithError(err).Warn("Stopped accepting streams.") diff --git a/vendor/github.com/SkycoinProject/dmsg/const.go b/vendor/github.com/skycoin/dmsg/const.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/const.go rename to vendor/github.com/skycoin/dmsg/const.go diff --git a/vendor/github.com/SkycoinProject/dmsg/disc/client.go b/vendor/github.com/skycoin/dmsg/disc/client.go similarity index 98% rename from vendor/github.com/SkycoinProject/dmsg/disc/client.go rename to vendor/github.com/skycoin/dmsg/disc/client.go index da8c2faef4..a2784ed1ae 100644 --- a/vendor/github.com/SkycoinProject/dmsg/disc/client.go +++ b/vendor/github.com/skycoin/dmsg/disc/client.go @@ -11,9 +11,9 @@ import ( "sync" "time" - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) var log = logging.MustGetLogger("disc") diff --git a/vendor/github.com/SkycoinProject/dmsg/disc/entry.go b/vendor/github.com/skycoin/dmsg/disc/entry.go similarity index 99% rename from vendor/github.com/SkycoinProject/dmsg/disc/entry.go rename to vendor/github.com/skycoin/dmsg/disc/entry.go index 99e0589ca2..9b5fc12498 100644 --- a/vendor/github.com/SkycoinProject/dmsg/disc/entry.go +++ b/vendor/github.com/skycoin/dmsg/disc/entry.go @@ -7,7 +7,7 @@ import ( "strings" "time" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) const currentVersion = "0.0.1" diff --git a/vendor/github.com/SkycoinProject/dmsg/disc/http_message.go b/vendor/github.com/skycoin/dmsg/disc/http_message.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/disc/http_message.go rename to vendor/github.com/skycoin/dmsg/disc/http_message.go diff --git a/vendor/github.com/SkycoinProject/dmsg/disc/testing.go b/vendor/github.com/skycoin/dmsg/disc/testing.go similarity index 98% rename from vendor/github.com/SkycoinProject/dmsg/disc/testing.go rename to vendor/github.com/skycoin/dmsg/disc/testing.go index d45a8b5c6c..92159f7e3e 100644 --- a/vendor/github.com/SkycoinProject/dmsg/disc/testing.go +++ b/vendor/github.com/skycoin/dmsg/disc/testing.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) // MockClient is an APIClient mock. The mock doesn't reply with the same errors as the diff --git a/vendor/github.com/SkycoinProject/dmsg/entity_common.go b/vendor/github.com/skycoin/dmsg/entity_common.go similarity index 95% rename from vendor/github.com/SkycoinProject/dmsg/entity_common.go rename to vendor/github.com/skycoin/dmsg/entity_common.go index c60a2b9f5b..a924341d6d 100644 --- a/vendor/github.com/SkycoinProject/dmsg/entity_common.go +++ b/vendor/github.com/skycoin/dmsg/entity_common.go @@ -7,9 +7,9 @@ import ( "github.com/sirupsen/logrus" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/disc" - "github.com/SkycoinProject/dmsg/netutil" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/disc" + "github.com/skycoin/dmsg/netutil" ) // EntityCommon contains the common fields and methods for server and client entities. @@ -122,6 +122,10 @@ func (c *EntityCommon) delSession(ctx context.Context, pk cipher.PubKey) { // updateServerEntry updates the dmsg server's entry within dmsg discovery. // If 'addr' is an empty string, the Entry.addr field will not be updated in discovery. func (c *EntityCommon) updateServerEntry(ctx context.Context, addr string, availableSessions int) error { + if addr == "" { + panic("updateServerEntry cannot accept empty 'addr' input") // this should never happen + } + entry, err := c.dc.Entry(ctx, c.pk) if err != nil { entry = disc.NewServerEntry(c.pk, 0, addr, availableSessions) @@ -136,7 +140,7 @@ func (c *EntityCommon) updateServerEntry(ctx context.Context, addr string, avail } updateSessions := entry.Server.AvailableSessions != availableSessions - updateAddr := addr != "" && entry.Server.Address != addr + updateAddr := entry.Server.Address != addr if !updateSessions && !updateAddr { // Nothing to be done. diff --git a/vendor/github.com/SkycoinProject/dmsg/errors.go b/vendor/github.com/skycoin/dmsg/errors.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/errors.go rename to vendor/github.com/skycoin/dmsg/errors.go diff --git a/vendor/github.com/SkycoinProject/dmsg/go.mod b/vendor/github.com/skycoin/dmsg/go.mod similarity index 71% rename from vendor/github.com/SkycoinProject/dmsg/go.mod rename to vendor/github.com/skycoin/dmsg/go.mod index 562f6bc8f9..3dbb70749d 100644 --- a/vendor/github.com/SkycoinProject/dmsg/go.mod +++ b/vendor/github.com/skycoin/dmsg/go.mod @@ -1,17 +1,17 @@ -module github.com/SkycoinProject/dmsg +module github.com/skycoin/dmsg go 1.12 require ( - github.com/SkycoinProject/skycoin v0.27.0 - github.com/SkycoinProject/skywire-mainnet v0.0.0-20200309204032-14af5342da86 - github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a github.com/creack/pty v1.1.9 github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 github.com/go-redis/redis v6.15.6+incompatible github.com/gorilla/handlers v1.4.2 github.com/prometheus/client_golang v1.3.0 github.com/sirupsen/logrus v1.4.2 + github.com/skycoin/skycoin v0.26.0 + github.com/skycoin/skywire v0.2.3-0.20200803142942-0f8b9981f6f9 + github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f github.com/spf13/cast v1.3.0 github.com/spf13/cobra v0.0.5 github.com/spf13/pflag v1.0.3 diff --git a/vendor/github.com/SkycoinProject/dmsg/go.sum b/vendor/github.com/skycoin/dmsg/go.sum similarity index 94% rename from vendor/github.com/SkycoinProject/dmsg/go.sum rename to vendor/github.com/skycoin/dmsg/go.sum index e3a8db7fe6..cc583ed4e8 100644 --- a/vendor/github.com/SkycoinProject/dmsg/go.sum +++ b/vendor/github.com/skycoin/dmsg/go.sum @@ -3,19 +3,14 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/SkycoinProject/dmsg v0.0.0-20200306152741-acee74fa4514/go.mod h1:DzykXMLlx6Fx0fGjZsCIRas/MIvxW8DZpmDA6f2nCRk= -github.com/SkycoinProject/skycoin v0.26.0 h1:8/ZRZb2VM2DM4YTIitRJMZ3Yo/3H1FFmbCMx5o6ekmA= +github.com/SkycoinProject/dmsg v0.2.0/go.mod h1:MiX+UG/6fl3g+9rS13/fq7BwUQ2eOlg1yOBOnNf6J6A= github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= -github.com/SkycoinProject/skycoin v0.27.0 h1:N3IHxj8ossHOcsxLYOYugT+OaELLncYHJHxbbYLPPmY= github.com/SkycoinProject/skycoin v0.27.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= -github.com/SkycoinProject/skywire-mainnet v0.0.0-20200309204032-14af5342da86 h1:SI1BA3NLIO9odP49zzdWpjzHBUhFMJme08SYZufp/wo= github.com/SkycoinProject/skywire-mainnet v0.0.0-20200309204032-14af5342da86/go.mod h1:xuOpE5ZZU2kR39u0tJWtOpak/sJpnEFj1HpTxtyPU/A= -github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a h1:6nHCJqh7trsuRcpMC5JmtDukUndn2VC9sY64K6xQ7hQ= github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a/go.mod h1:IaE1dxncLQs4RJcQTZPikJfAZY4szH87u2h0lT0SDuM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -72,7 +67,6 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= @@ -116,27 +110,22 @@ github.com/klauspost/compress v1.10.0 h1:92XGj1AcYzA6UrVdd4qIIBrT8OroryvRvdmg/If github.com/klauspost/compress v1.10.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.1/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -190,6 +179,7 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/schollz/progressbar/v2 v2.15.0/go.mod h1:UdPq3prGkfQ7MOzZKlDRpYKcFqEMczbD7YmbPgpzKMI= @@ -198,6 +188,10 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/skycoin/skycoin v0.26.0 h1:xDxe2r8AclMntZ550Y/vUQgwgLtwrf9Wu5UYiYcN5/o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= +github.com/skycoin/skywire v0.2.3-0.20200803142942-0f8b9981f6f9 h1:Ubt6eBID6rv8ChVqUt2NnCUyulF5d7Yx08xoI5nURrg= +github.com/skycoin/skywire v0.2.3-0.20200803142942-0f8b9981f6f9/go.mod h1:VtQTQdSwPvAZDzDgFK41PwGGQGeY3ehlFCtT0F8C7/8= +github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f h1:A5dEM1OE9YhN3LciZU9qPjo7fJ46JeHNi3JCroDkK0Y= +github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f/go.mod h1:48cleOxgkiLbgv322LOg2Vrxtu180Mb8GG1HbuhmFYM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -214,14 +208,12 @@ github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9 github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E= github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -236,13 +228,13 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -274,9 +266,9 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -310,7 +302,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/SkycoinProject/dmsg/httputil/error.go b/vendor/github.com/skycoin/dmsg/httputil/error.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/httputil/error.go rename to vendor/github.com/skycoin/dmsg/httputil/error.go diff --git a/vendor/github.com/SkycoinProject/dmsg/httputil/httputil.go b/vendor/github.com/skycoin/dmsg/httputil/httputil.go similarity index 97% rename from vendor/github.com/SkycoinProject/dmsg/httputil/httputil.go rename to vendor/github.com/skycoin/dmsg/httputil/httputil.go index e299a9c8fb..41d73f5ea4 100644 --- a/vendor/github.com/SkycoinProject/dmsg/httputil/httputil.go +++ b/vendor/github.com/skycoin/dmsg/httputil/httputil.go @@ -9,8 +9,8 @@ import ( "strconv" "strings" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/gorilla/handlers" + "github.com/skycoin/skycoin/src/util/logging" ) var log = logging.MustGetLogger("httputil") diff --git a/vendor/github.com/SkycoinProject/dmsg/ioutil/ack_waiter.go b/vendor/github.com/skycoin/dmsg/ioutil/ack_waiter.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/ioutil/ack_waiter.go rename to vendor/github.com/skycoin/dmsg/ioutil/ack_waiter.go diff --git a/vendor/github.com/SkycoinProject/dmsg/ioutil/atomic_bool.go b/vendor/github.com/skycoin/dmsg/ioutil/atomic_bool.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/ioutil/atomic_bool.go rename to vendor/github.com/skycoin/dmsg/ioutil/atomic_bool.go diff --git a/vendor/github.com/SkycoinProject/dmsg/ioutil/buf_read.go b/vendor/github.com/skycoin/dmsg/ioutil/buf_read.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/ioutil/buf_read.go rename to vendor/github.com/skycoin/dmsg/ioutil/buf_read.go diff --git a/vendor/github.com/SkycoinProject/dmsg/ioutil/logging.go b/vendor/github.com/skycoin/dmsg/ioutil/logging.go similarity index 56% rename from vendor/github.com/SkycoinProject/dmsg/ioutil/logging.go rename to vendor/github.com/skycoin/dmsg/ioutil/logging.go index cc42d0d4ed..71c97a40ee 100644 --- a/vendor/github.com/SkycoinProject/dmsg/ioutil/logging.go +++ b/vendor/github.com/skycoin/dmsg/ioutil/logging.go @@ -1,7 +1,7 @@ package ioutil import ( - "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/skycoin/skycoin/src/util/logging" ) var log = logging.MustGetLogger("ioutil") diff --git a/vendor/github.com/SkycoinProject/dmsg/listener.go b/vendor/github.com/skycoin/dmsg/listener.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/listener.go rename to vendor/github.com/skycoin/dmsg/listener.go diff --git a/vendor/github.com/SkycoinProject/dmsg/netutil/copy.go b/vendor/github.com/skycoin/dmsg/netutil/copy.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/netutil/copy.go rename to vendor/github.com/skycoin/dmsg/netutil/copy.go diff --git a/vendor/github.com/SkycoinProject/dmsg/netutil/porter.go b/vendor/github.com/skycoin/dmsg/netutil/porter.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/netutil/porter.go rename to vendor/github.com/skycoin/dmsg/netutil/porter.go diff --git a/vendor/github.com/SkycoinProject/dmsg/netutil/retrier.go b/vendor/github.com/skycoin/dmsg/netutil/retrier.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/netutil/retrier.go rename to vendor/github.com/skycoin/dmsg/netutil/retrier.go diff --git a/vendor/github.com/SkycoinProject/dmsg/noise/dh.go b/vendor/github.com/skycoin/dmsg/noise/dh.go similarity index 93% rename from vendor/github.com/SkycoinProject/dmsg/noise/dh.go rename to vendor/github.com/skycoin/dmsg/noise/dh.go index 6bba0b03f4..6da7ab6931 100644 --- a/vendor/github.com/SkycoinProject/dmsg/noise/dh.go +++ b/vendor/github.com/skycoin/dmsg/noise/dh.go @@ -3,8 +3,8 @@ package noise import ( "io" - "github.com/SkycoinProject/skycoin/src/cipher" "github.com/flynn/noise" + "github.com/skycoin/skycoin/src/cipher" ) // Secp256k1 implements `noise.DHFunc`. diff --git a/vendor/github.com/SkycoinProject/dmsg/noise/net.go b/vendor/github.com/skycoin/dmsg/noise/net.go similarity index 99% rename from vendor/github.com/SkycoinProject/dmsg/noise/net.go rename to vendor/github.com/skycoin/dmsg/noise/net.go index 5bf2f606ae..52f83a1c8a 100644 --- a/vendor/github.com/SkycoinProject/dmsg/noise/net.go +++ b/vendor/github.com/skycoin/dmsg/noise/net.go @@ -9,7 +9,7 @@ import ( "github.com/flynn/noise" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) var ( diff --git a/vendor/github.com/SkycoinProject/dmsg/noise/noise.go b/vendor/github.com/skycoin/dmsg/noise/noise.go similarity index 98% rename from vendor/github.com/SkycoinProject/dmsg/noise/noise.go rename to vendor/github.com/skycoin/dmsg/noise/noise.go index b6d4192368..e9405d8b42 100644 --- a/vendor/github.com/SkycoinProject/dmsg/noise/noise.go +++ b/vendor/github.com/skycoin/dmsg/noise/noise.go @@ -5,11 +5,10 @@ import ( "encoding/binary" "fmt" - "github.com/SkycoinProject/skycoin/src/util/logging" - "github.com/flynn/noise" + "github.com/skycoin/skycoin/src/util/logging" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) var noiseLogger = logging.MustGetLogger("noise") // TODO: initialize properly or remove diff --git a/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go b/vendor/github.com/skycoin/dmsg/noise/read_writer.go similarity index 98% rename from vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go rename to vendor/github.com/skycoin/dmsg/noise/read_writer.go index 93d57bb405..c9f5296428 100644 --- a/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go +++ b/vendor/github.com/skycoin/dmsg/noise/read_writer.go @@ -9,8 +9,8 @@ import ( "sync" "time" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/ioutil" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/ioutil" ) // MaxWriteSize is the largest amount for a single write. diff --git a/vendor/github.com/SkycoinProject/dmsg/server.go b/vendor/github.com/skycoin/dmsg/server.go similarity index 69% rename from vendor/github.com/SkycoinProject/dmsg/server.go rename to vendor/github.com/skycoin/dmsg/server.go index eb2a8161d1..8a1b1ec793 100644 --- a/vendor/github.com/SkycoinProject/dmsg/server.go +++ b/vendor/github.com/skycoin/dmsg/server.go @@ -5,12 +5,12 @@ import ( "net" "sync" - "github.com/SkycoinProject/skycoin/src/util/logging" "github.com/sirupsen/logrus" + "github.com/skycoin/skycoin/src/util/logging" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/disc" - "github.com/SkycoinProject/dmsg/netutil" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/disc" + "github.com/skycoin/dmsg/netutil" ) // Server represents a dsmg server entity. @@ -24,6 +24,11 @@ type Server struct { once sync.Once wg sync.WaitGroup + // Public TCP address which the dmsg server advertises itself as. + // This should only be set once. Once set, addrDone closes. + addr string + addrDone chan struct{} + maxSessions int } @@ -33,14 +38,15 @@ func NewServer(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, maxSession s.EntityCommon.init(pk, sk, dc, logging.MustGetLogger("dmsg_server")) s.ready = make(chan struct{}) s.done = make(chan struct{}) + s.addrDone = make(chan struct{}) s.maxSessions = maxSessions s.setSessionCallback = func(ctx context.Context, sessionCount int) error { available := s.maxSessions - sessionCount - return s.updateServerEntry(ctx, "", available) + return s.updateServerEntry(ctx, s.AdvertisedAddr(), available) } s.delSessionCallback = func(ctx context.Context, sessionCount int) error { available := s.maxSessions - sessionCount - return s.updateServerEntry(ctx, "", available) + return s.updateServerEntry(ctx, s.AdvertisedAddr(), available) } return s } @@ -59,11 +65,14 @@ func (s *Server) Close() error { // Serve serves the server. func (s *Server) Serve(lis net.Listener, addr string) error { - log := logrus.FieldLogger(s.log.WithField("local_addr", addr).WithField("local_pk", s.pk)) + s.SetAdvertisedAddr(lis, &addr) + + log := s.log. + WithField("advertised_addr", addr). + WithField("local_pk", s.pk) log.Info("Serving server.") s.wg.Add(1) - defer func() { log.Info("Stopped server.") s.wg.Done() @@ -75,10 +84,7 @@ func (s *Server) Serve(lis net.Listener, addr string) error { Info("Stopping server, net.Listener closed.") }() - if addr == "" { - addr = lis.Addr().String() - } - if err := s.updateEntryLoop(addr); err != nil { + if err := s.updateEntryLoop(); err != nil { return err } @@ -110,12 +116,30 @@ func (s *Server) Serve(lis net.Listener, addr string) error { } } +// AdvertisedAddr returns the TCP address in which the dmsg server is advertised by. +// This is the TCP address that should be contained within the dmsg discovery entry of this server. +func (s *Server) AdvertisedAddr() string { + <-s.addrDone + return s.addr +} + +// SetAdvertisedAddr sets the advertised TCP address in which the dmsg server is advertised by. +// This should only be called once. +func (s *Server) SetAdvertisedAddr(lis net.Listener, addr *string) { + if *addr == "" { + s.log.Warn("We are using a local addr as the advertised addr. This should only be done in a local test env.") + *addr = lis.Addr().String() + } + s.addr = *addr + close(s.addrDone) +} + // Ready returns a chan which blocks until the server begins serving. func (s *Server) Ready() <-chan struct{} { return s.ready } -func (s *Server) updateEntryLoop(addr string) error { +func (s *Server) updateEntryLoop() error { ctx, cancel := context.WithCancel(context.Background()) defer cancel() go func() { @@ -126,7 +150,7 @@ func (s *Server) updateEntryLoop(addr string) error { } }() return netutil.NewDefaultRetrier(s.log).Do(ctx, func() error { - return s.updateServerEntry(ctx, addr, s.maxSessions) + return s.updateServerEntry(ctx, s.AdvertisedAddr(), s.maxSessions) }) } diff --git a/vendor/github.com/SkycoinProject/dmsg/server_session.go b/vendor/github.com/skycoin/dmsg/server_session.go similarity index 79% rename from vendor/github.com/SkycoinProject/dmsg/server_session.go rename to vendor/github.com/skycoin/dmsg/server_session.go index 297dbff6fb..ac0fc6ec26 100644 --- a/vendor/github.com/SkycoinProject/dmsg/server_session.go +++ b/vendor/github.com/skycoin/dmsg/server_session.go @@ -4,10 +4,11 @@ import ( "io" "net" - "github.com/SkycoinProject/yamux" + "github.com/sirupsen/logrus" + "github.com/skycoin/yamux" - "github.com/SkycoinProject/dmsg/netutil" - "github.com/SkycoinProject/dmsg/noise" + "github.com/skycoin/dmsg/netutil" + "github.com/skycoin/dmsg/noise" ) // ServerSession represents a session from the perspective of a dmsg server. @@ -52,15 +53,19 @@ func (ss *ServerSession) Serve() { return } - ss.log.Info("Serving stream.") + var log logrus.FieldLogger = ss.log. + WithField("yamux_id", yStr.StreamID()) + + log.Info("Initiating stream.") + go func(yStr *yamux.Stream) { - err := ss.serveStream(yStr) - ss.log.WithError(err).Info("Stopped stream.") + err := ss.serveStream(log, yStr) + log.WithError(err).Info("Stopped stream.") }(yStr) } } -func (ss *ServerSession) serveStream(yStr *yamux.Stream) error { +func (ss *ServerSession) serveStream(log logrus.FieldLogger, yStr *yamux.Stream) error { readRequest := func() (StreamRequest, error) { obj, err := ss.readObject(yStr) if err != nil { @@ -86,24 +91,34 @@ func (ss *ServerSession) serveStream(yStr *yamux.Stream) error { return err } + log = log. + WithField("src_addr", req.SrcAddr). + WithField("dst_addr", req.DstAddr) + + log.Debug("Read stream request from initiating side.") + // Obtain next session. ss2, ok := ss.entity.serverSession(req.DstAddr.PK) if !ok { return ErrReqNoNextSession } + log.Debug("Obtained next session.") // Forward request and obtain/check response. yStr2, resp, err := ss2.forwardRequest(req) if err != nil { return err } + log.Debug("Forwarded stream request.") // Forward response. if err := ss.writeObject(yStr, resp); err != nil { return err } + log.Debug("Forwarded stream response.") // Serve stream. + log.Info("Serving stream.") return netutil.CopyReadWriteCloser(yStr, yStr2) } diff --git a/vendor/github.com/SkycoinProject/dmsg/session_common.go b/vendor/github.com/skycoin/dmsg/session_common.go similarity index 82% rename from vendor/github.com/SkycoinProject/dmsg/session_common.go rename to vendor/github.com/skycoin/dmsg/session_common.go index b4a5698e4d..8700f2c966 100644 --- a/vendor/github.com/SkycoinProject/dmsg/session_common.go +++ b/vendor/github.com/skycoin/dmsg/session_common.go @@ -7,11 +7,11 @@ import ( "net" "sync" - "github.com/SkycoinProject/yamux" "github.com/sirupsen/logrus" + "github.com/skycoin/yamux" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/noise" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/noise" ) // SessionCommon contains the common fields and methods used by a session, whether it be it from the client or server @@ -20,11 +20,12 @@ type SessionCommon struct { entity *EntityCommon // back reference rPK cipher.PubKey // remote pk - ys *yamux.Session - ns *noise.Noise - nMap noise.NonceMap - rMx sync.Mutex - wMx sync.Mutex + netConn net.Conn // underlying net.Conn (TCP connection to the dmsg server) + ys *yamux.Session + ns *noise.Noise + nMap noise.NonceMap + rMx sync.Mutex + wMx sync.Mutex log logrus.FieldLogger } @@ -55,6 +56,7 @@ func (sc *SessionCommon) initClient(entity *EntityCommon, conn net.Conn, rPK cip sc.entity = entity sc.rPK = rPK + sc.netConn = conn sc.ys = ySes sc.ns = ns sc.nMap = make(noise.NonceMap) @@ -87,6 +89,7 @@ func (sc *SessionCommon) initServer(entity *EntityCommon, conn net.Conn) error { sc.entity = entity sc.rPK = ns.RemoteStatic() + sc.netConn = conn sc.ys = ySes sc.ns = ns sc.nMap = make(noise.NonceMap) @@ -134,6 +137,12 @@ func (sc *SessionCommon) LocalPK() cipher.PubKey { return sc.entity.pk } // RemotePK returns the remote public key of the session. func (sc *SessionCommon) RemotePK() cipher.PubKey { return sc.rPK } +// LocalTCPAddr returns the local address of the underlying TCP connection. +func (sc *SessionCommon) LocalTCPAddr() net.Addr { return sc.netConn.LocalAddr() } + +// RemoteTCPAddr returns the remote address of the underlying TCP connection. +func (sc *SessionCommon) RemoteTCPAddr() net.Addr { return sc.netConn.RemoteAddr() } + // Close closes the session. func (sc *SessionCommon) Close() (err error) { if sc != nil { diff --git a/vendor/github.com/SkycoinProject/dmsg/stream.go b/vendor/github.com/skycoin/dmsg/stream.go similarity index 97% rename from vendor/github.com/SkycoinProject/dmsg/stream.go rename to vendor/github.com/skycoin/dmsg/stream.go index a8f62d6608..00cdf625c9 100644 --- a/vendor/github.com/SkycoinProject/dmsg/stream.go +++ b/vendor/github.com/skycoin/dmsg/stream.go @@ -5,11 +5,11 @@ import ( "net" "time" - "github.com/SkycoinProject/yamux" "github.com/sirupsen/logrus" + "github.com/skycoin/yamux" - "github.com/SkycoinProject/dmsg/cipher" - "github.com/SkycoinProject/dmsg/noise" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/dmsg/noise" ) // Stream represents a dmsg connection between two dmsg clients. diff --git a/vendor/github.com/SkycoinProject/dmsg/types.go b/vendor/github.com/skycoin/dmsg/types.go similarity index 99% rename from vendor/github.com/SkycoinProject/dmsg/types.go rename to vendor/github.com/skycoin/dmsg/types.go index 1b932ed692..8f8e93b9d0 100644 --- a/vendor/github.com/SkycoinProject/dmsg/types.go +++ b/vendor/github.com/skycoin/dmsg/types.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/SkycoinProject/dmsg/cipher" + "github.com/skycoin/dmsg/cipher" ) const ( diff --git a/vendor/github.com/SkycoinProject/dmsg/util.go b/vendor/github.com/skycoin/dmsg/util.go similarity index 100% rename from vendor/github.com/SkycoinProject/dmsg/util.go rename to vendor/github.com/skycoin/dmsg/util.go diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/address.go b/vendor/github.com/skycoin/skycoin/src/cipher/address.go similarity index 98% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/address.go rename to vendor/github.com/skycoin/skycoin/src/cipher/address.go index 3ada34ac8a..b5d93275b0 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/address.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/address.go @@ -4,7 +4,7 @@ import ( "errors" "log" - "github.com/SkycoinProject/skycoin/src/cipher/base58" + "github.com/skycoin/skycoin/src/cipher/base58" ) var ( diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/LICENSE b/vendor/github.com/skycoin/skycoin/src/cipher/base58/LICENSE similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/LICENSE rename to vendor/github.com/skycoin/skycoin/src/cipher/base58/LICENSE diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/LICENSE_old b/vendor/github.com/skycoin/skycoin/src/cipher/base58/LICENSE_old similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/LICENSE_old rename to vendor/github.com/skycoin/skycoin/src/cipher/base58/LICENSE_old diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/README.md b/vendor/github.com/skycoin/skycoin/src/cipher/base58/README.md similarity index 81% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/README.md rename to vendor/github.com/skycoin/skycoin/src/cipher/base58/README.md index 94251a4400..5042659adf 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/README.md +++ b/vendor/github.com/skycoin/skycoin/src/cipher/base58/README.md @@ -1,6 +1,6 @@ # Fast Implementation of Base58 encoding -[![GoDoc](https://godoc.org/github.com/SkycoinProject/skycoin/src/cipher/base58?status.svg)](https://godoc.org/github.com/SkycoinProject/skycoin/src/cipher/base58) +[![GoDoc](https://godoc.org/github.com/skycoin/skycoin/src/cipher/base58?status.svg)](https://godoc.org/github.com/skycoin/skycoin/src/cipher/base58) Fast implementation of base58 encoding in Go. @@ -24,7 +24,7 @@ import ( "fmt" "os" - "github.com/SkycoinProject/skycoin/src/cipher/base58" + "github.com/skycoin/skycoin/src/cipher/base58" ) func main() { diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/base58.go b/vendor/github.com/skycoin/skycoin/src/cipher/base58/base58.go similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/base58.go rename to vendor/github.com/skycoin/skycoin/src/cipher/base58/base58.go diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/base58_old.go b/vendor/github.com/skycoin/skycoin/src/cipher/base58/base58_old.go similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/base58/base58_old.go rename to vendor/github.com/skycoin/skycoin/src/cipher/base58/base58_old.go diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/bitcoin.go b/vendor/github.com/skycoin/skycoin/src/cipher/bitcoin.go similarity index 99% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/bitcoin.go rename to vendor/github.com/skycoin/skycoin/src/cipher/bitcoin.go index 61747e4f09..e601d5a2cf 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/bitcoin.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/bitcoin.go @@ -5,7 +5,7 @@ import ( "errors" "log" - "github.com/SkycoinProject/skycoin/src/cipher/base58" + "github.com/skycoin/skycoin/src/cipher/base58" ) var ( diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/crypto.go b/vendor/github.com/skycoin/skycoin/src/cipher/crypto.go similarity index 97% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/crypto.go rename to vendor/github.com/skycoin/skycoin/src/cipher/crypto.go index f1f51902c3..94499df00c 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/crypto.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/crypto.go @@ -24,8 +24,8 @@ import ( "log" "time" - "github.com/SkycoinProject/skycoin/src/cipher/ripemd160" - secp256k1 "github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go" + "github.com/skycoin/skycoin/src/cipher/ripemd160" + secp256k1 "github.com/skycoin/skycoin/src/cipher/secp256k1-go" ) var ( @@ -50,10 +50,8 @@ var ( ErrInvalidLengthSig = errors.New("Invalid signature length") // ErrInvalidPubKey Invalid public key ErrInvalidPubKey = errors.New("Invalid public key") - // ErrInvalidSecKey Invalid secret key + // ErrInvalidSecKey Invalid public key ErrInvalidSecKey = errors.New("Invalid secret key") - // ErrNullSignHash Attempted to sign null hash digest - ErrNullSignHash = errors.New("Cannot sign null hash digest") // ErrInvalidSig Invalid signature ErrInvalidSig = errors.New("Invalid signature") // ErrInvalidSigPubKeyRecovery could not recover pubkey from sig @@ -136,7 +134,7 @@ func MustPubKeyFromHex(s string) PubKey { // PubKeyFromSecKey recovers the public key for a secret key func PubKeyFromSecKey(seckey SecKey) (PubKey, error) { - if seckey.Null() { + if seckey == (SecKey{}) { return PubKey{}, ErrPubKeyFromNullSecKey } @@ -362,15 +360,10 @@ func (s Sig) Hex() string { // SignHash sign hash func SignHash(hash SHA256, sec SecKey) (Sig, error) { if secp256k1.VerifySeckey(sec[:]) != 1 { - // Can't use sec.Verify() because that calls SignHash again, with DebugLevel2 set + // can't use sec.Verify() because that calls SignHash again, with DebugLevel2 set return Sig{}, ErrInvalidSecKey } - // Null hashes can't be signed - if hash.Null() { - return Sig{}, ErrNullSignHash - } - s := secp256k1.Sign(hash[:], sec[:]) sig, err := NewSig(s) diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/hash.go b/vendor/github.com/skycoin/skycoin/src/cipher/hash.go similarity index 98% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/hash.go rename to vendor/github.com/skycoin/skycoin/src/cipher/hash.go index 039cf6a4c4..af1ab5bf32 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/hash.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/hash.go @@ -65,7 +65,7 @@ func HashRipemd160(data []byte) Ripemd160 { ripemd160Hash := <-ripemd160HashPool ripemd160Hash.Reset() // ripemd160.Write never returns an error - ripemd160Hash.Write(data) //nolint:errcheck + ripemd160Hash.Write(data) // nolint: errcheck sum := ripemd160Hash.Sum(nil) ripemd160HashPool <- ripemd160Hash @@ -159,7 +159,7 @@ func SumSHA256(b []byte) SHA256 { sha256Hash := <-sha256HashPool sha256Hash.Reset() // sha256.Write never returns an error - sha256Hash.Write(b) //nolint:errcheck + sha256Hash.Write(b) // nolint: errcheck sum := sha256Hash.Sum(nil) sha256HashPool <- sha256Hash diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/ripemd160/ripemd160block.go b/vendor/github.com/skycoin/skycoin/src/cipher/ripemd160/ripemd160block.go similarity index 98% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/ripemd160/ripemd160block.go rename to vendor/github.com/skycoin/skycoin/src/cipher/ripemd160/ripemd160block.go index 2f45a532c1..4195209e04 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/ripemd160/ripemd160block.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/ripemd160/ripemd160block.go @@ -26,7 +26,7 @@ var _r = [80]uint{ } // same for the other parallel one -var n_ = [80]uint{ //nolint:golint +var n_ = [80]uint{ // nolint: golint 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, @@ -34,7 +34,7 @@ var n_ = [80]uint{ //nolint:golint 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11, } -var r_ = [80]uint{ //nolint:golint +var r_ = [80]uint{ // nolint: golint 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/ripemd160/ripmd_160.go b/vendor/github.com/skycoin/skycoin/src/cipher/ripemd160/ripmd_160.go similarity index 91% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/ripemd160/ripmd_160.go rename to vendor/github.com/skycoin/skycoin/src/cipher/ripemd160/ripmd_160.go index d406bbfe85..f9e4f05d1d 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/ripemd160/ripmd_160.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/ripemd160/ripmd_160.go @@ -83,7 +83,7 @@ func (d *digest) Write(p []byte) (nn int, err error) { return } -func (d0 *digest) Sum(in []byte) []byte { //nolint:golint +func (d0 *digest) Sum(in []byte) []byte { // nolint: golint // Make a copy of d0 so that caller can keep writing and summing. d := *d0 @@ -93,9 +93,9 @@ func (d0 *digest) Sum(in []byte) []byte { //nolint:golint tmp[0] = 0x80 if tc%64 < 56 { - d.Write(tmp[0 : 56-tc%64]) //nolint:errcheck,gosec + d.Write(tmp[0 : 56-tc%64]) // nolint: errcheck,gosec } else { - d.Write(tmp[0 : 64+56-tc%64]) //nolint:errcheck,gosec + d.Write(tmp[0 : 64+56-tc%64]) // nolint: errcheck,gosec } // Length in bits. @@ -103,7 +103,7 @@ func (d0 *digest) Sum(in []byte) []byte { //nolint:golint for i := uint(0); i < 8; i++ { tmp[i] = byte(tc >> (8 * i)) } - d.Write(tmp[0:8]) //nolint:errcheck,gosec + d.Write(tmp[0:8]) // nolint: errcheck,gosec if d.nx != 0 { panic("d.nx != 0") diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/README.md b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/README.md similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/README.md rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/README.md diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256_rand.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256_rand.go similarity index 98% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256_rand.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256_rand.go index 3a785a9e24..292c4926ca 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256_rand.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256_rand.go @@ -24,7 +24,7 @@ func SumSHA256(b []byte) []byte { sha256Hash := <-sha256HashPool sha256Hash.Reset() // sha256.Write never returns an error - sha256Hash.Write(b) //nolint:errcheck + sha256Hash.Write(b) // nolint: errcheck sum := sha256Hash.Sum(nil) sha256HashPool <- sha256Hash return sum[:] diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/COPYING b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/COPYING similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/COPYING rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/COPYING diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/README.md b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/README.md similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/README.md rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/README.md diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/ec.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/ec.go similarity index 85% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/ec.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/ec.go index 0ade1604be..70c84ce879 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/ec.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/ec.go @@ -24,8 +24,8 @@ func DecompressPoint(X []byte, off bool, Y []byte) { // RecoverPublicKey recovers a public key from a signature and the message it signed. // Returns nil on error with an int error code. Returns 1 on success. -func RecoverPublicKey(sigBytes, msgBytes []byte, recid int) ([]byte, int) { - if len(sigBytes) != 64 { +func RecoverPublicKey(sigByte, h []byte, recid int) ([]byte, int) { + if len(sigByte) != 64 { log.Panic("must pass in 64 byte pubkey") } @@ -33,7 +33,7 @@ func RecoverPublicKey(sigBytes, msgBytes []byte, recid int) ([]byte, int) { var sig Signature var msg Number - sig.ParseBytes(sigBytes[0:64]) + sig.ParseBytes(sigByte[0:64]) if sig.R.Sign() <= 0 || sig.R.Cmp(&TheCurve.Order.Int) >= 0 { if sig.R.Sign() == 0 { @@ -51,7 +51,7 @@ func RecoverPublicKey(sigBytes, msgBytes []byte, recid int) ([]byte, int) { return nil, -5 } - msg.SetBytes(msgBytes) + msg.SetBytes(h) if !sig.Recover(&pubkey, &msg, recid) { return nil, -6 } @@ -59,7 +59,7 @@ func RecoverPublicKey(sigBytes, msgBytes []byte, recid int) ([]byte, int) { return pubkey.Bytes(), 1 } -// Multiply standard EC multiplication k(xy) +// Multiply standard EC multiplacation k(xy) // xy is the compressed public key format (33 bytes long) func Multiply(xy, k []byte) []byte { var pk XY @@ -74,12 +74,12 @@ func Multiply(xy, k []byte) []byte { pk.SetXYZ(&xyz) if !pk.IsValid() { - log.Panic("Multiply pk is invalid") + log.Panic() } return pk.Bytes() } -// pubkeyTest panics if assumptions about pubkey are violated +//test assumptions func pubkeyTest(pk XY) { if !pk.IsValid() { log.Panic("IMPOSSIBLE3: pubkey invalid") @@ -98,13 +98,14 @@ func pubkeyTest(pk XY) { // BaseMultiply base multiply func BaseMultiply(k []byte) []byte { + var r XYZ var n Number var pk XY n.SetBytes(k) - r := ECmultGen(n) + ECmultGen(&r, &n) pk.SetXYZ(&r) if !pk.IsValid() { - log.Panic("BaseMultiply pk is invalid") + log.Panic() // should not occur } pubkeyTest(pk) @@ -115,13 +116,14 @@ func BaseMultiply(k []byte) []byte { // BaseMultiplyAdd computes G*k + xy // Returns 33 bytes out (compressed pubkey). func BaseMultiplyAdd(xy, k []byte) []byte { + var r XYZ var n Number var pk XY if err := pk.ParsePubkey(xy); err != nil { return nil } n.SetBytes(k) - r := ECmultGen(n) + ECmultGen(&r, &n) r.AddXY(&r, &pk) pk.SetXYZ(&r) @@ -135,6 +137,7 @@ func GeneratePublicKey(k []byte) []byte { if len(k) != 32 { log.Panic("secret key length must be 32 bytes") } + var r XYZ var n Number var pk XY @@ -146,24 +149,22 @@ func GeneratePublicKey(k []byte) []byte { log.Panic("only call for valid seckey, check that seckey is valid first") return nil } - r := ECmultGen(n) + ECmultGen(&r, &n) pk.SetXYZ(&r) if !pk.IsValid() { - log.Panic("public key derived from secret key is unexpectedly valid") + log.Panic("public key derived from secret key is unexpectedly valid") // should not occur } pubkeyTest(pk) return pk.Bytes() } // SeckeyIsValid 1 on success -// Must be 32 bytes -// Must not be zero -// Must not be negative -// Must be less than order of curve -// The probability of any 32 bytes being an invalid secret key is ~2^-128 +// must not be zero +// must not be negative +// must be less than order of curve func SeckeyIsValid(seckey []byte) int { if len(seckey) != 32 { - log.Panic("SeckeyIsValid seckey must be 32 bytes") + log.Panic() } var n Number n.SetBytes(seckey) diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/field.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/field.go similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/field.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/field.go diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/num.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/num.go similarity index 87% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/num.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/num.go index 07527d85be..76cf6b822f 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/num.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/num.go @@ -29,9 +29,7 @@ func (num *Number) mod(a *Number) { // SetHex sets number from string func (num *Number) SetHex(s string) { - if _, ok := num.SetString(s, 16); !ok { - panic("Number.SetHex failed") - } + num.SetString(s, 16) } func (num *Number) maskBits(bits uint) { @@ -63,13 +61,13 @@ func (num *Number) splitExp(r1, r2 *Number) { r2.Sub(&bnt1.Int, &bnt2.Int) } -func (num *Number) split(rl, rh *Number, bits uint) { //nolint:unparam +func (num *Number) split(rl, rh *Number, bits uint) { // nolint: unparam rl.Int.Set(&num.Int) rh.Int.Rsh(&rl.Int, bits) rl.maskBits(bits) } -func (num *Number) rsh(bits uint) { //nolint:unparam +func (num *Number) rsh(bits uint) { // nolint: unparam num.Rsh(&num.Int, bits) } @@ -89,7 +87,7 @@ func (num *Number) IsOdd() bool { } // LeftPadBytes left-pads a byte slice with NUL bytes up to a length -func LeftPadBytes(b []byte, length int) []byte { //nolint:unparam +func LeftPadBytes(b []byte, length int) []byte { // nolint: unparam if len(b) > length { panic("buffer too small") } diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go similarity index 98% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go index 1cbb4ae335..065f245119 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/secp256k1.go @@ -5,6 +5,7 @@ package secp256k1go const winA = 5 const winG = 14 +const forceLowS = true // At the output of the Sign() function // TheCurve is the secp256k1 curve var TheCurve struct { diff --git a/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go new file mode 100644 index 0000000000..9d32229fcf --- /dev/null +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/sig.go @@ -0,0 +1,184 @@ +package secp256k1go + +import ( + "bytes" + "log" +) + +// Signature represents the signature +type Signature struct { + R, S Number +} + +// Verify verify the signature +func (sig *Signature) Verify(pubkey *XY, message *Number) (ret bool) { + var r2 Number + ret = sig.recompute(&r2, pubkey, message) && sig.R.Cmp(&r2.Int) == 0 + return +} + +func (sig *Signature) recompute(r2 *Number, pubkey *XY, message *Number) (ret bool) { + var sn, u1, u2 Number + + sn.modInv(&sig.S, &TheCurve.Order) + u1.modMul(&sn, message, &TheCurve.Order) + u2.modMul(&sn, &sig.R, &TheCurve.Order) + + var pr, pubkeyj XYZ + pubkeyj.SetXY(pubkey) + + pubkeyj.ECmult(&pr, &u2, &u1) + if !pr.IsInfinity() { + var xr Field + pr.getX(&xr) + xr.Normalize() + var xrb [32]byte + xr.GetB32(xrb[:]) + r2.SetBytes(xrb[:]) + r2.Mod(&r2.Int, &TheCurve.Order.Int) + ret = true + } + + return +} + +// Recover recovers a pubkey XY point given the message that was signed to create +// this signature. +// TODO: return type, or nil on failure +func (sig *Signature) Recover(pubkey *XY, m *Number, recid int) (ret bool) { + var rx, rn, u1, u2 Number + var fx Field + var x XY + var xj, qj XYZ + + rx.Set(&sig.R.Int) + if (recid & 2) != 0 { + rx.Add(&rx.Int, &TheCurve.Order.Int) + if rx.Cmp(&TheCurve.p.Int) >= 0 { + return false + } + } + + fx.SetB32(LeftPadBytes(rx.Bytes(), 32)) + + x.SetXO(&fx, (recid&1) != 0) + if !x.IsValid() { + return false + } + + xj.SetXY(&x) + rn.modInv(&sig.R, &TheCurve.Order) + u1.modMul(&rn, m, &TheCurve.Order) + u1.Sub(&TheCurve.Order.Int, &u1.Int) + u2.modMul(&rn, &sig.S, &TheCurve.Order) + xj.ECmult(&qj, &u2, &u1) + pubkey.SetXYZ(&qj) + + return true +} + +// Sign signs the signature +func (sig *Signature) Sign(seckey, message, nonce *Number, recid *int) int { + var r XY + var rp XYZ + var n Number + var b [32]byte + + ECmultGen(&rp, nonce) + r.SetXYZ(&rp) + r.X.Normalize() + r.Y.Normalize() + r.X.GetB32(b[:]) + sig.R.SetBytes(b[:]) + if recid != nil { + *recid = 0 + if sig.R.Cmp(&TheCurve.Order.Int) >= 0 { + *recid |= 2 + } + if r.Y.IsOdd() { + *recid |= 1 + } + } + sig.R.mod(&TheCurve.Order) + n.modMul(&sig.R, seckey, &TheCurve.Order) + n.Add(&n.Int, &message.Int) + n.mod(&TheCurve.Order) + sig.S.modInv(nonce, &TheCurve.Order) + sig.S.modMul(&sig.S, &n, &TheCurve.Order) + if sig.S.Sign() == 0 { + return 0 + } + if sig.S.IsOdd() { + sig.S.Sub(&TheCurve.Order.Int, &sig.S.Int) + if recid != nil { + *recid ^= 1 + } + } + + if forceLowS && sig.S.Cmp(&TheCurve.halfOrder.Int) == 1 { + sig.S.Sub(&TheCurve.Order.Int, &sig.S.Int) + if recid != nil { + *recid ^= 1 + } + } + + return 1 +} + +// ParseBytes parses a serialized R||S pair to Signature. +// R and S should be in big-endian encoding. +func (sig *Signature) ParseBytes(v []byte) { + if len(v) != 64 { + log.Panic("Signature.ParseBytes requires 64 bytes") + } + sig.R.SetBytes(v[0:32]) + sig.S.SetBytes(v[32:64]) +} + +//secp256k1_num_get_bin(sig64, 32, &sig.r); +//secp256k1_num_get_bin(sig64 + 32, 32, &sig.s); + +// Bytes serializes compressed signatures as bytes. +// The serialization format is R||S. R and S bytes are big-endian. +// R and S are left-padded with the NUL byte to ensure their length is 32 bytes. +func (sig *Signature) Bytes() []byte { + r := sig.R.Bytes() // big-endian + s := sig.S.Bytes() // big-endian + + for len(r) < 32 { + r = append([]byte{0}, r...) + } + for len(s) < 32 { + s = append([]byte{0}, s...) + } + + if len(r) != 32 || len(s) != 32 { + log.Panicf("signature size invalid: %d, %d", len(r), len(s)) + } + + res := new(bytes.Buffer) + if _, err := res.Write(r); err != nil { + panic(err) + } + if _, err := res.Write(s); err != nil { + panic(err) + } + + //test + if true { + ret := res.Bytes() + var sig2 Signature + sig2.ParseBytes(ret) + if !bytes.Equal(sig.R.Bytes(), sig2.R.Bytes()) { + log.Panic("serialization failed 1") + } + if !bytes.Equal(sig.S.Bytes(), sig2.S.Bytes()) { + log.Panic("serialization failed 2") + } + } + + if len(res.Bytes()) != 64 { + log.Panic() + } + return res.Bytes() +} diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go similarity index 92% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go index a6f9d6c893..f4f5150ab9 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xy.go @@ -70,10 +70,11 @@ func (xy *XY) ParsePubkey(pub []byte) error { return nil } -// Bytes returns the compressed public key (33 bytes) in the format -// "<0x03> " or <0x02> ". The leading byte is 0x03 if the Y point is odd. +// Bytes Returns serialized key in in compressed format: "<02> ", +// eventually "<03> " +//33 bytes func (xy XY) Bytes() []byte { - xy.X.Normalize() // See https://github.com/piotrnar/gocoin/issues/15 + xy.X.Normalize() // See GitHub issue #15 raw := make([]byte, 33) if xy.Y.IsOdd() { @@ -88,8 +89,8 @@ func (xy XY) Bytes() []byte { // BytesUncompressed returns serialized key in uncompressed format "<04> " //65 bytes func (xy *XY) BytesUncompressed() (raw []byte) { - xy.X.Normalize() // See https://github.com/piotrnar/gocoin/issues/15 - xy.Y.Normalize() // See https://github.com/piotrnar/gocoin/issues/15 + xy.X.Normalize() // See GitHub issue #15 + xy.Y.Normalize() // See GitHub issue #15 raw = make([]byte, 65) raw[0] = 0x04 @@ -177,7 +178,7 @@ func (xy *XY) SetXYZ(a *XYZ) { xy.Y = a.Y } -func (xy *XY) precomp(w int) []XY { //nolint:unused,megacheck +func (xy *XY) precomp(w int) []XY { // nolint: unused,megacheck pre := make([]XY, (1 << (uint(w) - 2))) pre[0] = *xy var X, d, tmp XYZ @@ -231,7 +232,7 @@ func (xy *XY) SetXO(X *Field, odd bool) { xy.Y.Negate(&xy.Y, 1) } - //r.X.Normalize() // See https://github.com/piotrnar/gocoin/issues/15 + //r.X.Normalize() // See GitHub issue #15 xy.Y.Normalize() } diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xyz.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xyz.go similarity index 96% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xyz.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xyz.go index 88a0a1ce01..40be6bdc81 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xyz.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/xyz.go @@ -70,7 +70,7 @@ func (xyz *XYZ) Equals(b *XYZ) bool { return xyz.X.Equals(&b.X) && xyz.Y.Equals(&b.Y) && xyz.Z.Equals(&b.Z) } -func (xyz *XYZ) precomp(w int) (pre []XYZ) { //nolint:unparam +func (xyz *XYZ) precomp(w int) (pre []XYZ) { // nolint: unparam var d XYZ pre = make([]XYZ, (1 << (uint(w) - 2))) pre[0] = *xyz @@ -365,14 +365,14 @@ func (xyz *XYZ) Add(r, b *XYZ) { } // ECmultGen r = a*G -func ECmultGen(a Number) XYZ { +//TODO: Change to returning result +//TODO: input should not be pointer +func ECmultGen(r *XYZ, a *Number) { var n Number - var r XYZ n.Set(&a.Int) r.SetXY(&prec[0][n.rshX(4)]) for j := 1; j < 64; j++ { - r.AddXY(&r, &prec[j][n.rshX(4)]) + r.AddXY(r, &prec[j][n.rshX(4)]) } - r.AddXY(&r, &fin) - return r + r.AddXY(r, &fin) } diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_consts.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_consts.go similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_consts.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_consts.go diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_init.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_init.go similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_init.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/z_init.go diff --git a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1.go b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1.go similarity index 77% rename from vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1.go rename to vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1.go index 673f2eca9a..f4b8fa93d9 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1.go +++ b/vendor/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1.go @@ -1,6 +1,7 @@ /* Package secp256k1 provides private and public key generation with the secp256k1 elliptic curve. */ +// nolint: golint package secp256k1 import ( @@ -8,7 +9,7 @@ import ( "encoding/hex" "log" - secp "github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2" + secp "github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2" ) // DebugPrint enable debug print statements @@ -26,9 +27,9 @@ func pubkeyFromSeckey(seckey []byte) []byte { return nil } - pubkey := secp.GeneratePublicKey(seckey) + var pubkey = secp.GeneratePublicKey(seckey) // always returns true if pubkey == nil { - log.Panic("ERROR: impossible, secp.GeneratePublicKey should never fail") + log.Panic("ERROR: impossible, secp.BaseMultiply always returns true") return nil } if len(pubkey) != 33 { @@ -41,8 +42,8 @@ func pubkeyFromSeckey(seckey []byte) []byte { } if ret := VerifyPubkey(pubkey); ret != 1 { - log.Printf("seckey=%s\n", hex.EncodeToString(seckey)) - log.Printf("pubkey=%s\n", hex.EncodeToString(pubkey)) + log.Printf("seckey= %s", hex.EncodeToString(seckey)) + log.Printf("pubkey= %s", hex.EncodeToString(pubkey)) log.Panicf("ERROR: pubkey verification failed, for deterministic. ret=%d", ret) return nil } @@ -59,7 +60,7 @@ func GenerateKeyPair() ([]byte, []byte) { new_seckey: seckey = RandByte(seckeyLen) if secp.SeckeyIsValid(seckey) != 1 { - goto new_seckey // regen + goto new_seckey //regen } pubkey = pubkeyFromSeckey(seckey) @@ -110,7 +111,7 @@ func UncompressPubkey(pubkey []byte) []byte { log.Panicf("ERROR: impossible, pubkey parse fail: %v", err) } - var pubkey2 = pubXY.BytesUncompressed() + var pubkey2 = pubXY.BytesUncompressed() // uncompressed if pubkey2 == nil { log.Panic("ERROR: pubkey, uncompression fail") return nil @@ -145,11 +146,11 @@ func UncompressedPubkeyFromSeckey(seckey []byte) []byte { return uncompressedPubkey } -// deterministicKeyPairIteratorStep generates deterministic keypair with weak SHA256 hash of seed. +// generateDeterministicKeyPair generates deterministic keypair with weak SHA256 hash of seed. // internal use only -func deterministicKeyPairIteratorStep(seed []byte) ([]byte, []byte) { +func generateDeterministicKeyPair(seed []byte) ([]byte, []byte) { if len(seed) != 32 { - log.Panic("ERROR: deterministicKeyPairIteratorStep: seed must be 32 bytes") + log.Panic("ERROR: generateDeterministicKeyPair: seed must be 32 bytes") } const seckeyLen = 32 @@ -161,30 +162,30 @@ new_seckey: if secp.SeckeyIsValid(seckey) != 1 { if DebugPrint { - log.Printf("deterministicKeyPairIteratorStep, secp.SeckeyIsValid fail") + log.Printf("generateDeterministicKeyPair, secp.SeckeyIsValid fail") } goto new_seckey //regen } pubkey := secp.GeneratePublicKey(seckey) if pubkey == nil { - log.Panic("ERROR: deterministicKeyPairIteratorStep: GeneratePublicKey failed, impossible, secp.BaseMultiply always returns true") + log.Panic("ERROR: generateDeterministicKeyPair: GeneratePublicKey failed, impossible, secp.BaseMultiply always returns true") goto new_seckey } if len(pubkey) != 33 { - log.Panic("ERROR: deterministicKeyPairIteratorStep: impossible, pubkey length wrong") + log.Panic("ERROR: generateDeterministicKeyPair: impossible, pubkey length wrong") } if ret := secp.PubkeyIsValid(pubkey); ret != 1 { - log.Panicf("ERROR: deterministicKeyPairIteratorStep: PubkeyIsValid failed, ret=%d", ret) + log.Panicf("ERROR: generateDeterministicKeyPair: PubkeyIsValid failed, ret=%d", ret) } if ret := VerifyPubkey(pubkey); ret != 1 { log.Printf("seckey= %s", hex.EncodeToString(seckey)) log.Printf("pubkey= %s", hex.EncodeToString(pubkey)) - log.Panicf("ERROR: deterministicKeyPairIteratorStep: VerifyPubkey failed, ret=%d", ret) + log.Panicf("ERROR: generateDeterministicKeyPair: VerifyPubkey failed, ret=%d", ret) goto new_seckey } @@ -192,14 +193,12 @@ new_seckey: } // Secp256k1Hash double SHA256, salted with ECDH operation in curve -func Secp256k1Hash(seed []byte) []byte { //nolint:golint - hash := SumSHA256(seed) - _, seckey := deterministicKeyPairIteratorStep(hash) // seckey1 is usually sha256 of hash - pubkeySeed := SumSHA256(hash) // SumSHA256(hash) usually equals seckey - pubkey, _ := deterministicKeyPairIteratorStep(pubkeySeed) - ecdh := ECDH(pubkey, seckey) // raise pubkey to power of seckey in curve - out := SumSHA256(append(hash, ecdh...)) // append signature to sha256(seed) and hash - return out +func Secp256k1Hash(hash []byte) []byte { + hash = SumSHA256(hash) + _, seckey := generateDeterministicKeyPair(hash) // seckey1 is usually sha256 of hash + pubkey, _ := generateDeterministicKeyPair(SumSHA256(hash)) // SumSHA256(hash) equals seckey usually + ecdh := ECDH(pubkey, seckey) // raise pubkey to power of seckey in curve + return SumSHA256(append(hash, ecdh...)) // append signature to sha256(seed) and hash } // GenerateDeterministicKeyPair generate a single secure key @@ -215,27 +214,10 @@ func GenerateDeterministicKeyPair(seed []byte) ([]byte, []byte) { func DeterministicKeyPairIterator(seedIn []byte) ([]byte, []byte, []byte) { seed1 := Secp256k1Hash(seedIn) // make it difficult to derive future seckeys from previous seckeys seed2 := SumSHA256(append(seedIn, seed1...)) - pubkey, seckey := deterministicKeyPairIteratorStep(seed2) // this is our seckey + pubkey, seckey := generateDeterministicKeyPair(seed2) // this is our seckey return seed1, pubkey, seckey } -func newRandomNonceNumber() secp.Number { - nonce := RandByte(32) - var n secp.Number - n.SetBytes(nonce) - return n -} - -// newSigningNonce creates a nonce for signing. This is the `k` parameter in -// ECDSA signing. `k` must be 0 < k < n, where `n` is the order of the curve -func newSigningNonce() secp.Number { - nonce := newRandomNonceNumber() - for nonce.Sign() == 0 || nonce.Cmp(&secp.TheCurve.Order.Int) >= 0 { - nonce = newRandomNonceNumber() - } - return nonce -} - // Sign sign hash, returns a compact recoverable signature func Sign(msg []byte, seckey []byte) []byte { if len(seckey) != 32 { @@ -247,27 +229,21 @@ func Sign(msg []byte, seckey []byte) []byte { if len(msg) == 0 { log.Panic("Sign, message nil") } - if len(msg) != 32 { - log.Panic("Sign, message must be 32 bytes") - } - - nonce := newSigningNonce() - sig := make([]byte, 65) + var nonce = RandByte(32) + var sig = make([]byte, 65) var recid int // recovery byte, used to recover pubkey from sig var cSig secp.Signature var seckey1 secp.Number var msg1 secp.Number + var nonce1 secp.Number seckey1.SetBytes(seckey) msg1.SetBytes(msg) + nonce1.SetBytes(nonce) - if msg1.Sign() == 0 { - log.Panic("Sign: message is 0") - } - - ret := cSig.Sign(&seckey1, &msg1, &nonce, &recid) + ret := cSig.Sign(&seckey1, &msg1, &nonce1, &recid) if ret != 1 { log.Panic("Secp25k1-go, Sign, signature operation failed") @@ -389,6 +365,7 @@ func VerifySignature(msg []byte, sig []byte, pubkey1 []byte) int { } // RecoverPubkey recovers the public key from the signature +//recovery of pubkey means correct signature func RecoverPubkey(msg []byte, sig []byte) []byte { if len(sig) != 65 { log.Panic("sig length must be 65 bytes") @@ -408,15 +385,15 @@ func RecoverPubkey(msg []byte, sig []byte) []byte { if pubkey == nil { log.Panic("ERROR: impossible, pubkey nil and ret == 1") } - if secp.PubkeyIsValid(pubkey) != 1 { - log.Panicf("secp.RecoverPublicKey returned invalid pubkey %s", hex.EncodeToString(pubkey)) + if len(pubkey) != 33 { + log.Panic("pubkey length wrong") } return pubkey } // ECDH raise a pubkey to the power of a seckey -func ECDH(pub, sec []byte) []byte { +func ECDH(pub []byte, sec []byte) []byte { if len(sec) != 32 { log.Panic("secret key must be 32 bytes") } diff --git a/vendor/github.com/SkycoinProject/skycoin/src/util/logging/formatter.go b/vendor/github.com/skycoin/skycoin/src/util/logging/formatter.go similarity index 97% rename from vendor/github.com/SkycoinProject/skycoin/src/util/logging/formatter.go rename to vendor/github.com/skycoin/skycoin/src/util/logging/formatter.go index e9066f4ccc..983a382bb1 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/util/logging/formatter.go +++ b/vendor/github.com/skycoin/skycoin/src/util/logging/formatter.go @@ -231,7 +231,7 @@ func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error) { } } - b.WriteByte('\n') //nolint:gosec + b.WriteByte('\n') // nolint: gosec return b.Bytes(), nil } @@ -411,12 +411,12 @@ func (f *TextFormatter) formatValue(value interface{}) string { } func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interface{}, appendSpace bool) { - b.WriteString(key) //nolint:gosec - b.WriteByte('=') //nolint:gosec - f.appendValue(b, value) //nolint:gosec + b.WriteString(key) // nolint: gosec + b.WriteByte('=') // nolint: gosec + f.appendValue(b, value) // nolint: gosec if appendSpace { - b.WriteByte(' ') //nolint:gosec + b.WriteByte(' ') // nolint: gosec } } @@ -426,14 +426,14 @@ func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { if f.needsQuoting(value) { fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, value, f.QuoteCharacter) } else { - b.WriteString(value) //nolint:gosec + b.WriteString(value) // nolint: gosec } case error: errmsg := value.Error() if f.needsQuoting(errmsg) { fmt.Fprintf(b, "%s%+v%s", f.QuoteCharacter, errmsg, f.QuoteCharacter) } else { - b.WriteString(errmsg) //nolint:gosec + b.WriteString(errmsg) // nolint: gosec } default: fmt.Fprint(b, value) diff --git a/vendor/github.com/SkycoinProject/skycoin/src/util/logging/hooks.go b/vendor/github.com/skycoin/skycoin/src/util/logging/hooks.go similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/util/logging/hooks.go rename to vendor/github.com/skycoin/skycoin/src/util/logging/hooks.go diff --git a/vendor/github.com/SkycoinProject/skycoin/src/util/logging/logger.go b/vendor/github.com/skycoin/skycoin/src/util/logging/logger.go similarity index 91% rename from vendor/github.com/SkycoinProject/skycoin/src/util/logging/logger.go rename to vendor/github.com/skycoin/skycoin/src/util/logging/logger.go index 7b7e335973..2f3b4f7b59 100644 --- a/vendor/github.com/SkycoinProject/skycoin/src/util/logging/logger.go +++ b/vendor/github.com/skycoin/skycoin/src/util/logging/logger.go @@ -2,7 +2,6 @@ package logging import ( "os" - "time" "github.com/sirupsen/logrus" ) @@ -18,11 +17,6 @@ func (logger *Logger) Critical() logrus.FieldLogger { return logger.WithField(logPriorityKey, logPriorityCritical) } -// WithTime overrides time, used by logger. -func (logger *Logger) WithTime(t time.Time) *logrus.Entry { - return logger.WithFields(logrus.Fields{}).WithTime(t) -} - // MasterLogger wraps logrus.Logger and is able to create new package-aware loggers type MasterLogger struct { *logrus.Logger diff --git a/vendor/github.com/SkycoinProject/skycoin/src/util/logging/logging.go b/vendor/github.com/skycoin/skycoin/src/util/logging/logging.go similarity index 100% rename from vendor/github.com/SkycoinProject/skycoin/src/util/logging/logging.go rename to vendor/github.com/skycoin/skycoin/src/util/logging/logging.go diff --git a/vendor/github.com/SkycoinProject/yamux/.gitignore b/vendor/github.com/skycoin/yamux/.gitignore similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/.gitignore rename to vendor/github.com/skycoin/yamux/.gitignore diff --git a/vendor/github.com/SkycoinProject/yamux/LICENSE b/vendor/github.com/skycoin/yamux/LICENSE similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/LICENSE rename to vendor/github.com/skycoin/yamux/LICENSE diff --git a/vendor/github.com/SkycoinProject/yamux/README.md b/vendor/github.com/skycoin/yamux/README.md similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/README.md rename to vendor/github.com/skycoin/yamux/README.md diff --git a/vendor/github.com/SkycoinProject/yamux/addr.go b/vendor/github.com/skycoin/yamux/addr.go similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/addr.go rename to vendor/github.com/skycoin/yamux/addr.go diff --git a/vendor/github.com/SkycoinProject/yamux/const.go b/vendor/github.com/skycoin/yamux/const.go similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/const.go rename to vendor/github.com/skycoin/yamux/const.go diff --git a/vendor/github.com/SkycoinProject/yamux/deadline.go b/vendor/github.com/skycoin/yamux/deadline.go similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/deadline.go rename to vendor/github.com/skycoin/yamux/deadline.go diff --git a/vendor/github.com/SkycoinProject/yamux/go.mod b/vendor/github.com/skycoin/yamux/go.mod similarity index 64% rename from vendor/github.com/SkycoinProject/yamux/go.mod rename to vendor/github.com/skycoin/yamux/go.mod index 0a0e0db17c..89047b7605 100644 --- a/vendor/github.com/SkycoinProject/yamux/go.mod +++ b/vendor/github.com/skycoin/yamux/go.mod @@ -1,4 +1,4 @@ -module github.com/SkycoinProject/yamux +module github.com/skycoin/yamux go 1.13 diff --git a/vendor/github.com/SkycoinProject/yamux/go.sum b/vendor/github.com/skycoin/yamux/go.sum similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/go.sum rename to vendor/github.com/skycoin/yamux/go.sum diff --git a/vendor/github.com/SkycoinProject/yamux/mux.go b/vendor/github.com/skycoin/yamux/mux.go similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/mux.go rename to vendor/github.com/skycoin/yamux/mux.go diff --git a/vendor/github.com/SkycoinProject/yamux/session.go b/vendor/github.com/skycoin/yamux/session.go similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/session.go rename to vendor/github.com/skycoin/yamux/session.go diff --git a/vendor/github.com/SkycoinProject/yamux/spec.md b/vendor/github.com/skycoin/yamux/spec.md similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/spec.md rename to vendor/github.com/skycoin/yamux/spec.md diff --git a/vendor/github.com/SkycoinProject/yamux/stream.go b/vendor/github.com/skycoin/yamux/stream.go similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/stream.go rename to vendor/github.com/skycoin/yamux/stream.go diff --git a/vendor/github.com/SkycoinProject/yamux/util.go b/vendor/github.com/skycoin/yamux/util.go similarity index 100% rename from vendor/github.com/SkycoinProject/yamux/util.go rename to vendor/github.com/skycoin/yamux/util.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 818b8bc9f0..390e0dc5ac 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,21 +1,3 @@ -# github.com/SkycoinProject/dmsg v0.2.0 -github.com/SkycoinProject/dmsg -github.com/SkycoinProject/dmsg/cipher -github.com/SkycoinProject/dmsg/disc -github.com/SkycoinProject/dmsg/dmsgpty -github.com/SkycoinProject/dmsg/httputil -github.com/SkycoinProject/dmsg/ioutil -github.com/SkycoinProject/dmsg/netutil -github.com/SkycoinProject/dmsg/noise -# github.com/SkycoinProject/skycoin v0.27.0 -github.com/SkycoinProject/skycoin/src/cipher -github.com/SkycoinProject/skycoin/src/cipher/base58 -github.com/SkycoinProject/skycoin/src/cipher/ripemd160 -github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go -github.com/SkycoinProject/skycoin/src/cipher/secp256k1-go/secp256k1-go2 -github.com/SkycoinProject/skycoin/src/util/logging -# github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a -github.com/SkycoinProject/yamux # github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/alecthomas/template github.com/alecthomas/template/parse @@ -115,6 +97,24 @@ github.com/schollz/progressbar/v2 # github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog +# github.com/skycoin/dmsg v0.0.0-20200803194104-78ff5746d8a3 +github.com/skycoin/dmsg +github.com/skycoin/dmsg/cipher +github.com/skycoin/dmsg/disc +github.com/skycoin/dmsg/dmsgpty +github.com/skycoin/dmsg/httputil +github.com/skycoin/dmsg/ioutil +github.com/skycoin/dmsg/netutil +github.com/skycoin/dmsg/noise +# github.com/skycoin/skycoin v0.26.0 +github.com/skycoin/skycoin/src/cipher +github.com/skycoin/skycoin/src/cipher/base58 +github.com/skycoin/skycoin/src/cipher/ripemd160 +github.com/skycoin/skycoin/src/cipher/secp256k1-go +github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2 +github.com/skycoin/skycoin/src/util/logging +# github.com/skycoin/yamux v0.0.0-20200803175205-571ceb89da9f +github.com/skycoin/yamux # github.com/spf13/cobra v0.0.5 github.com/spf13/cobra # github.com/spf13/pflag v1.0.3 From c57de02dbed92b634fad7cfa67f378c0bdeab071 Mon Sep 17 00:00:00 2001 From: Nikita Kryuchkov Date: Mon, 3 Aug 2020 22:59:58 +0300 Subject: [PATCH 2/2] Fix imports --- cmd/skywire-cli/commands/mdisc/root.go | 3 +-- cmd/skywire-cli/commands/rtfind/root.go | 7 +++---- cmd/skywire-cli/commands/visor/gen-config.go | 7 +++---- pkg/app/appserver/mock_proc_manager.go | 5 ++--- pkg/app/appserver/proc_manager_test.go | 4 ++-- pkg/app/mock_rpc_client.go | 5 ++--- pkg/app/rpc_client_test.go | 8 +++----- pkg/hypervisor/user_manager.go | 1 - pkg/router/mock_router.go | 1 - pkg/router/router_test.go | 3 +-- pkg/router/routerclient/wrappers.go | 3 +-- pkg/setup/node_test.go | 9 +++------ pkg/snet/network.go | 7 +++---- pkg/snet/network_test.go | 3 +-- pkg/snet/stcp/handshake.go | 3 +-- pkg/transport/discovery_test.go | 3 +-- pkg/transport/entry_test.go | 3 +-- pkg/transport/manager.go | 8 ++++---- pkg/transport/manager_test.go | 9 ++++----- pkg/util/pathutil/configpath.go | 1 + 20 files changed, 37 insertions(+), 56 deletions(-) diff --git a/cmd/skywire-cli/commands/mdisc/root.go b/cmd/skywire-cli/commands/mdisc/root.go index ccee22cb9d..aff26c1563 100644 --- a/cmd/skywire-cli/commands/mdisc/root.go +++ b/cmd/skywire-cli/commands/mdisc/root.go @@ -7,12 +7,11 @@ import ( "text/tabwriter" "time" - "github.com/skycoin/skywire/pkg/skyenv" - "github.com/skycoin/dmsg/disc" "github.com/spf13/cobra" "github.com/skycoin/skywire/cmd/skywire-cli/internal" + "github.com/skycoin/skywire/pkg/skyenv" ) var mdAddr string diff --git a/cmd/skywire-cli/commands/rtfind/root.go b/cmd/skywire-cli/commands/rtfind/root.go index cefc103f9e..29e29d35d0 100644 --- a/cmd/skywire-cli/commands/rtfind/root.go +++ b/cmd/skywire-cli/commands/rtfind/root.go @@ -4,15 +4,14 @@ import ( "fmt" "time" - "github.com/skycoin/skywire/pkg/routefinder/rfclient" - "github.com/skycoin/skywire/pkg/routing" - "github.com/skycoin/skywire/pkg/skyenv" - "github.com/skycoin/dmsg/cipher" "github.com/spf13/cobra" "golang.org/x/net/context" "github.com/skycoin/skywire/cmd/skywire-cli/internal" + "github.com/skycoin/skywire/pkg/routefinder/rfclient" + "github.com/skycoin/skywire/pkg/routing" + "github.com/skycoin/skywire/pkg/skyenv" ) var frAddr string diff --git a/cmd/skywire-cli/commands/visor/gen-config.go b/cmd/skywire-cli/commands/visor/gen-config.go index 23cbfa0bb7..ba5abc2538 100644 --- a/cmd/skywire-cli/commands/visor/gen-config.go +++ b/cmd/skywire-cli/commands/visor/gen-config.go @@ -7,14 +7,13 @@ import ( "path" "path/filepath" + "github.com/skycoin/dmsg/cipher" + "github.com/spf13/cobra" + "github.com/skycoin/skywire/pkg/app/appcommon" "github.com/skycoin/skywire/pkg/restart" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/skyenv" - - "github.com/skycoin/dmsg/cipher" - "github.com/spf13/cobra" - "github.com/skycoin/skywire/pkg/util/pathutil" "github.com/skycoin/skywire/pkg/visor" ) diff --git a/pkg/app/appserver/mock_proc_manager.go b/pkg/app/appserver/mock_proc_manager.go index 6cb098d8f0..47e46419ed 100644 --- a/pkg/app/appserver/mock_proc_manager.go +++ b/pkg/app/appserver/mock_proc_manager.go @@ -5,11 +5,10 @@ package appserver import ( io "io" - appcommon "github.com/skycoin/skywire/pkg/app/appcommon" - logging "github.com/skycoin/skycoin/src/util/logging" - mock "github.com/stretchr/testify/mock" + + appcommon "github.com/skycoin/skywire/pkg/app/appcommon" ) // MockProcManager is an autogenerated mock type for the ProcManager type diff --git a/pkg/app/appserver/proc_manager_test.go b/pkg/app/appserver/proc_manager_test.go index 5cf1fab5a4..311cccc0b9 100644 --- a/pkg/app/appserver/proc_manager_test.go +++ b/pkg/app/appserver/proc_manager_test.go @@ -4,10 +4,10 @@ import ( "sort" "testing" - "github.com/skycoin/skywire/pkg/app/appcommon" - "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/require" + + "github.com/skycoin/skywire/pkg/app/appcommon" ) func TestProcManager_Exists(t *testing.T) { diff --git a/pkg/app/mock_rpc_client.go b/pkg/app/mock_rpc_client.go index 1f7155b372..e5bbe9d3a4 100644 --- a/pkg/app/mock_rpc_client.go +++ b/pkg/app/mock_rpc_client.go @@ -3,13 +3,12 @@ package app import ( + time "time" + mock "github.com/stretchr/testify/mock" appnet "github.com/skycoin/skywire/pkg/app/appnet" - routing "github.com/skycoin/skywire/pkg/routing" - - time "time" ) // MockRPCClient is an autogenerated mock type for the RPCClient type diff --git a/pkg/app/rpc_client_test.go b/pkg/app/rpc_client_test.go index 6ad4855149..e0a904e2ca 100644 --- a/pkg/app/rpc_client_test.go +++ b/pkg/app/rpc_client_test.go @@ -9,8 +9,6 @@ import ( "testing" "time" - "github.com/skycoin/skywire/internal/testhelpers" - "github.com/skycoin/dmsg" "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skycoin/src/util/logging" @@ -18,11 +16,11 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/net/nettest" - "github.com/skycoin/skywire/pkg/app/appnet" - "github.com/skycoin/skywire/pkg/routing" - + "github.com/skycoin/skywire/internal/testhelpers" "github.com/skycoin/skywire/pkg/app/appcommon" + "github.com/skycoin/skywire/pkg/app/appnet" "github.com/skycoin/skywire/pkg/app/appserver" + "github.com/skycoin/skywire/pkg/routing" ) func TestRPCClient_Dial(t *testing.T) { diff --git a/pkg/hypervisor/user_manager.go b/pkg/hypervisor/user_manager.go index 2d675c6b8b..5771c16d39 100644 --- a/pkg/hypervisor/user_manager.go +++ b/pkg/hypervisor/user_manager.go @@ -11,7 +11,6 @@ import ( "github.com/google/uuid" "github.com/gorilla/securecookie" - "github.com/skycoin/dmsg/httputil" ) diff --git a/pkg/router/mock_router.go b/pkg/router/mock_router.go index 2e2acaf3e4..898055badf 100644 --- a/pkg/router/mock_router.go +++ b/pkg/router/mock_router.go @@ -6,7 +6,6 @@ import ( context "context" cipher "github.com/skycoin/dmsg/cipher" - mock "github.com/stretchr/testify/mock" routing "github.com/skycoin/skywire/pkg/routing" diff --git a/pkg/router/router_test.go b/pkg/router/router_test.go index e45696e240..685c227d65 100644 --- a/pkg/router/router_test.go +++ b/pkg/router/router_test.go @@ -10,9 +10,8 @@ import ( "testing" "time" - "github.com/sirupsen/logrus" - "github.com/google/uuid" + "github.com/sirupsen/logrus" "github.com/skycoin/dmsg" "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skycoin/src/util/logging" diff --git a/pkg/router/routerclient/wrappers.go b/pkg/router/routerclient/wrappers.go index aa482a31a6..23834a8a94 100644 --- a/pkg/router/routerclient/wrappers.go +++ b/pkg/router/routerclient/wrappers.go @@ -5,13 +5,12 @@ import ( "fmt" "net" - "github.com/skycoin/skywire/pkg/snet" - "github.com/skycoin/dmsg" "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skycoin/src/util/logging" "github.com/skycoin/skywire/pkg/routing" + "github.com/skycoin/skywire/pkg/snet" ) // TODO: remove this diff --git a/pkg/setup/node_test.go b/pkg/setup/node_test.go index 1db1a89175..0afb83a293 100644 --- a/pkg/setup/node_test.go +++ b/pkg/setup/node_test.go @@ -12,12 +12,6 @@ import ( "testing" "time" - "github.com/skycoin/skywire/pkg/setup/setupclient" - - "github.com/skycoin/skywire/internal/testhelpers" - - "github.com/skycoin/skywire/pkg/snet/snettest" - "github.com/google/uuid" "github.com/skycoin/dmsg" "github.com/skycoin/dmsg/cipher" @@ -25,10 +19,13 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/skycoin/skywire/internal/testhelpers" "github.com/skycoin/skywire/pkg/metrics" "github.com/skycoin/skywire/pkg/router" "github.com/skycoin/skywire/pkg/routing" + "github.com/skycoin/skywire/pkg/setup/setupclient" "github.com/skycoin/skywire/pkg/skyenv" + "github.com/skycoin/skywire/pkg/snet/snettest" ) func TestMain(m *testing.M) { diff --git a/pkg/snet/network.go b/pkg/snet/network.go index d645fd071a..96fd296b72 100644 --- a/pkg/snet/network.go +++ b/pkg/snet/network.go @@ -9,13 +9,12 @@ import ( "sync" "time" - "github.com/skycoin/skywire/pkg/snet/stcp" - - "github.com/skycoin/skycoin/src/util/logging" - "github.com/skycoin/dmsg" "github.com/skycoin/dmsg/cipher" "github.com/skycoin/dmsg/disc" + "github.com/skycoin/skycoin/src/util/logging" + + "github.com/skycoin/skywire/pkg/snet/stcp" ) // Default ports. diff --git a/pkg/snet/network_test.go b/pkg/snet/network_test.go index d21d517588..3dce54c361 100644 --- a/pkg/snet/network_test.go +++ b/pkg/snet/network_test.go @@ -3,10 +3,9 @@ package snet import ( "testing" - "github.com/stretchr/testify/require" - "github.com/skycoin/dmsg" "github.com/skycoin/dmsg/cipher" + "github.com/stretchr/testify/require" ) func TestDisassembleAddr(t *testing.T) { diff --git a/pkg/snet/stcp/handshake.go b/pkg/snet/stcp/handshake.go index 0671641b6c..f56210d8dc 100644 --- a/pkg/snet/stcp/handshake.go +++ b/pkg/snet/stcp/handshake.go @@ -9,10 +9,9 @@ import ( "net" "time" - cipher2 "github.com/skycoin/skycoin/src/cipher" - "github.com/skycoin/dmsg" "github.com/skycoin/dmsg/cipher" + cipher2 "github.com/skycoin/skycoin/src/cipher" ) const ( diff --git a/pkg/transport/discovery_test.go b/pkg/transport/discovery_test.go index de633dd8d6..d8e449b8f7 100644 --- a/pkg/transport/discovery_test.go +++ b/pkg/transport/discovery_test.go @@ -4,9 +4,8 @@ import ( "context" "testing" - "github.com/stretchr/testify/require" - "github.com/skycoin/dmsg/cipher" + "github.com/stretchr/testify/require" "github.com/skycoin/skywire/pkg/transport" ) diff --git a/pkg/transport/entry_test.go b/pkg/transport/entry_test.go index dc9d60a636..e6f2dbff26 100644 --- a/pkg/transport/entry_test.go +++ b/pkg/transport/entry_test.go @@ -4,9 +4,8 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" - "github.com/skycoin/dmsg/cipher" + "github.com/stretchr/testify/assert" "github.com/skycoin/skywire/pkg/transport" ) diff --git a/pkg/transport/manager.go b/pkg/transport/manager.go index bf373440fa..2855def17f 100644 --- a/pkg/transport/manager.go +++ b/pkg/transport/manager.go @@ -9,14 +9,14 @@ import ( "sync" "time" + "github.com/google/uuid" + "github.com/skycoin/dmsg/cipher" + "github.com/skycoin/skycoin/src/util/logging" + "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/skyenv" "github.com/skycoin/skywire/pkg/snet" "github.com/skycoin/skywire/pkg/snet/snettest" - - "github.com/google/uuid" - "github.com/skycoin/dmsg/cipher" - "github.com/skycoin/skycoin/src/util/logging" ) // ManagerConfig configures a Manager. diff --git a/pkg/transport/manager_test.go b/pkg/transport/manager_test.go index b2b3083aeb..0644e66ac3 100644 --- a/pkg/transport/manager_test.go +++ b/pkg/transport/manager_test.go @@ -9,16 +9,15 @@ import ( "testing" "time" + "github.com/skycoin/dmsg" + "github.com/skycoin/dmsg/cipher" "github.com/skycoin/skycoin/src/util/logging" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/skycoin/skywire/pkg/routing" "github.com/skycoin/skywire/pkg/snet/snettest" "github.com/skycoin/skywire/pkg/transport" - - "github.com/skycoin/dmsg" - "github.com/skycoin/dmsg/cipher" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var masterLogger *logging.MasterLogger diff --git a/pkg/util/pathutil/configpath.go b/pkg/util/pathutil/configpath.go index 48dc1621f7..9b3432fb7c 100644 --- a/pkg/util/pathutil/configpath.go +++ b/pkg/util/pathutil/configpath.go @@ -165,6 +165,7 @@ func WriteJSONConfig(conf interface{}, output string, replace bool) { log.WithError(err).Fatalln("failed to create output directory") } + // nolint:gosec if err := ioutil.WriteFile(output, raw, 0744); err != nil { log.WithError(err).Fatalln("failed to write file") }