mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 00:27:38 +00:00
Fix travis (#1493)
* fix travis * test 2 * goimports * Remove unused p2p config * remove unused var
This commit is contained in:
parent
4ccc3b1941
commit
4b27b8408b
@ -8,9 +8,8 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- lint
|
- lint
|
||||||
script:
|
script:
|
||||||
-
|
- go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./...
|
||||||
go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./...
|
email: false
|
||||||
email: false
|
|
||||||
after_success:
|
after_success:
|
||||||
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
|
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
|
||||||
- chmod +x send.sh
|
- chmod +x send.sh
|
||||||
|
@ -2,10 +2,11 @@ package db
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"github.com/prysmaticlabs/prysm/shared/params"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/prysmaticlabs/prysm/shared/params"
|
||||||
|
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
||||||
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||||
|
@ -2,10 +2,11 @@ package dbcleanup
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/prysmaticlabs/prysm/shared/params"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/prysmaticlabs/prysm/shared/params"
|
||||||
|
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
||||||
|
|
||||||
|
@ -2,13 +2,14 @@ package sync
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strconv"
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||||
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/proto"
|
"github.com/gogo/protobuf/proto"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/db"
|
"github.com/prysmaticlabs/prysm/beacon-chain/db"
|
||||||
"github.com/prysmaticlabs/prysm/beacon-chain/internal"
|
"github.com/prysmaticlabs/prysm/beacon-chain/internal"
|
||||||
|
3
shared/p2p/mock/broadcaster_mock.go
generated
3
shared/p2p/mock/broadcaster_mock.go
generated
@ -5,9 +5,10 @@
|
|||||||
package mock_p2p
|
package mock_p2p
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
proto "github.com/gogo/protobuf/proto"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
reflect "reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockBroadcaster is a mock of Broadcaster interface
|
// MockBroadcaster is a mock of Broadcaster interface
|
||||||
|
@ -204,13 +204,10 @@ func TestProposeBlock_ComputeStateFailure(t *testing.T) {
|
|||||||
gomock.Eq(&ptypes.Empty{}),
|
gomock.Eq(&ptypes.Empty{}),
|
||||||
).Return(&pb.Eth1DataResponse{}, nil /*err*/)
|
).Return(&pb.Eth1DataResponse{}, nil /*err*/)
|
||||||
|
|
||||||
var broadcastedBlock *pbp2p.BeaconBlock
|
|
||||||
m.proposerClient.EXPECT().ProposeBlock(
|
m.proposerClient.EXPECT().ProposeBlock(
|
||||||
gomock.Any(), // ctx
|
gomock.Any(), // ctx
|
||||||
gomock.AssignableToTypeOf(&pbp2p.BeaconBlock{}),
|
gomock.AssignableToTypeOf(&pbp2p.BeaconBlock{}),
|
||||||
).Do(func(_ context.Context, blk *pbp2p.BeaconBlock) {
|
).Return(&pb.ProposeResponse{}, nil /*error*/)
|
||||||
broadcastedBlock = blk
|
|
||||||
}).Return(&pb.ProposeResponse{}, nil /*error*/)
|
|
||||||
|
|
||||||
m.proposerClient.EXPECT().ComputeStateRoot(
|
m.proposerClient.EXPECT().ComputeStateRoot(
|
||||||
gomock.Any(), // context
|
gomock.Any(), // context
|
||||||
|
3
validator/internal/attester_service_mock.go
generated
3
validator/internal/attester_service_mock.go
generated
@ -6,10 +6,11 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
reflect "reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockAttesterServiceClient is a mock of AttesterServiceClient interface
|
// MockAttesterServiceClient is a mock of AttesterServiceClient interface
|
||||||
|
3
validator/internal/beacon_service_mock.go
generated
3
validator/internal/beacon_service_mock.go
generated
@ -6,13 +6,14 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
types "github.com/gogo/protobuf/types"
|
types "github.com/gogo/protobuf/types"
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||||
v10 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
v10 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
metadata "google.golang.org/grpc/metadata"
|
metadata "google.golang.org/grpc/metadata"
|
||||||
reflect "reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockBeaconServiceClient is a mock of BeaconServiceClient interface
|
// MockBeaconServiceClient is a mock of BeaconServiceClient interface
|
||||||
|
3
validator/internal/proposer_service_mock.go
generated
3
validator/internal/proposer_service_mock.go
generated
@ -6,11 +6,12 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||||
v10 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
v10 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
reflect "reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockProposerServiceClient is a mock of ProposerServiceClient interface
|
// MockProposerServiceClient is a mock of ProposerServiceClient interface
|
||||||
|
3
validator/internal/validator_service_mock.go
generated
3
validator/internal/validator_service_mock.go
generated
@ -6,10 +6,11 @@ package internal
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
reflect "reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MockValidatorServiceClient is a mock of ValidatorServiceClient interface
|
// MockValidatorServiceClient is a mock of ValidatorServiceClient interface
|
||||||
|
@ -9,24 +9,17 @@ go_test(
|
|||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
srcs = [
|
srcs = ["node.go"],
|
||||||
"node.go",
|
|
||||||
"p2p_config.go",
|
|
||||||
],
|
|
||||||
importpath = "github.com/prysmaticlabs/prysm/validator/node",
|
importpath = "github.com/prysmaticlabs/prysm/validator/node",
|
||||||
visibility = ["//validator:__subpackages__"],
|
visibility = ["//validator:__subpackages__"],
|
||||||
deps = [
|
deps = [
|
||||||
"//proto/beacon/p2p/v1:go_default_library",
|
|
||||||
"//shared:go_default_library",
|
"//shared:go_default_library",
|
||||||
"//shared/cmd:go_default_library",
|
"//shared/cmd:go_default_library",
|
||||||
"//shared/debug:go_default_library",
|
"//shared/debug:go_default_library",
|
||||||
"//shared/p2p:go_default_library",
|
|
||||||
"//shared/p2p/adapter/tracer:go_default_library",
|
|
||||||
"//shared/prometheus:go_default_library",
|
"//shared/prometheus:go_default_library",
|
||||||
"//shared/version:go_default_library",
|
"//shared/version:go_default_library",
|
||||||
"//validator/client:go_default_library",
|
"//validator/client:go_default_library",
|
||||||
"//validator/types:go_default_library",
|
"//validator/types:go_default_library",
|
||||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
|
||||||
"@com_github_sirupsen_logrus//:go_default_library",
|
"@com_github_sirupsen_logrus//:go_default_library",
|
||||||
"@com_github_urfave_cli//:go_default_library",
|
"@com_github_urfave_cli//:go_default_library",
|
||||||
],
|
],
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
package node
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/gogo/protobuf/proto"
|
|
||||||
beaconpb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
|
||||||
"github.com/prysmaticlabs/prysm/shared/cmd"
|
|
||||||
"github.com/prysmaticlabs/prysm/shared/p2p"
|
|
||||||
"github.com/prysmaticlabs/prysm/shared/p2p/adapter/tracer"
|
|
||||||
"github.com/urfave/cli"
|
|
||||||
)
|
|
||||||
|
|
||||||
var topicMappings = map[fmt.Stringer]proto.Message{
|
|
||||||
// Beacon chain topics
|
|
||||||
beaconpb.Topic_BEACON_BLOCK_ANNOUNCE: &beaconpb.BeaconBlockAnnounce{},
|
|
||||||
beaconpb.Topic_BEACON_BLOCK_REQUEST: &beaconpb.BeaconBlockRequest{},
|
|
||||||
beaconpb.Topic_BEACON_BLOCK_RESPONSE: &beaconpb.BeaconBlockResponse{},
|
|
||||||
beaconpb.Topic_ATTESTATION_ANNOUNCE: &beaconpb.AttestationAnnounce{},
|
|
||||||
beaconpb.Topic_ATTESTATION_REQUEST: &beaconpb.AttestationRequest{},
|
|
||||||
beaconpb.Topic_ATTESTATION_RESPONSE: &beaconpb.AttestationResponse{},
|
|
||||||
|
|
||||||
// Shard chain topics
|
|
||||||
}
|
|
||||||
|
|
||||||
func configureP2P(ctx *cli.Context) (*p2p.Server, error) {
|
|
||||||
s, err := p2p.NewServer(&p2p.ServerConfig{
|
|
||||||
BootstrapNodeAddr: ctx.GlobalString(cmd.BootstrapNode.Name),
|
|
||||||
RelayNodeAddr: ctx.GlobalString(cmd.RelayNode.Name),
|
|
||||||
Port: ctx.GlobalInt(cmd.P2PPort.Name),
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
traceAdapter, err := tracer.New("validator",
|
|
||||||
ctx.GlobalString(cmd.TracingEndpointFlag.Name),
|
|
||||||
ctx.GlobalFloat64(cmd.TraceSampleFractionFlag.Name),
|
|
||||||
ctx.GlobalBool(cmd.EnableTracingFlag.Name))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(437): Define default adapters for logging, monitoring, etc.
|
|
||||||
adapters := []p2p.Adapter{traceAdapter}
|
|
||||||
for k, v := range topicMappings {
|
|
||||||
s.RegisterTopic(k.String(), v, adapters...)
|
|
||||||
}
|
|
||||||
|
|
||||||
return s, nil
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user