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,8 +8,7 @@ matrix:
|
||||
env:
|
||||
- lint
|
||||
script:
|
||||
-
|
||||
go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./...
|
||||
- go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./...
|
||||
email: false
|
||||
after_success:
|
||||
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
|
||||
|
@ -2,10 +2,11 @@ package db
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
||||
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||
|
@ -2,10 +2,11 @@ package dbcleanup
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
||||
|
||||
|
@ -2,13 +2,14 @@ package sync
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/blocks"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/validators"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/db"
|
||||
"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
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockBroadcaster is a mock of Broadcaster interface
|
||||
|
@ -204,13 +204,10 @@ func TestProposeBlock_ComputeStateFailure(t *testing.T) {
|
||||
gomock.Eq(&ptypes.Empty{}),
|
||||
).Return(&pb.Eth1DataResponse{}, nil /*err*/)
|
||||
|
||||
var broadcastedBlock *pbp2p.BeaconBlock
|
||||
m.proposerClient.EXPECT().ProposeBlock(
|
||||
gomock.Any(), // ctx
|
||||
gomock.AssignableToTypeOf(&pbp2p.BeaconBlock{}),
|
||||
).Do(func(_ context.Context, blk *pbp2p.BeaconBlock) {
|
||||
broadcastedBlock = blk
|
||||
}).Return(&pb.ProposeResponse{}, nil /*error*/)
|
||||
).Return(&pb.ProposeResponse{}, nil /*error*/)
|
||||
|
||||
m.proposerClient.EXPECT().ComputeStateRoot(
|
||||
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 (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||
grpc "google.golang.org/grpc"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// 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 (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
types "github.com/gogo/protobuf/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||
v10 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||
grpc "google.golang.org/grpc"
|
||||
metadata "google.golang.org/grpc/metadata"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// 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 (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||||
v10 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||
grpc "google.golang.org/grpc"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// 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 (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
v1 "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||
grpc "google.golang.org/grpc"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockValidatorServiceClient is a mock of ValidatorServiceClient interface
|
||||
|
@ -9,24 +9,17 @@ go_test(
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"node.go",
|
||||
"p2p_config.go",
|
||||
],
|
||||
srcs = ["node.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/validator/node",
|
||||
visibility = ["//validator:__subpackages__"],
|
||||
deps = [
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
"//shared:go_default_library",
|
||||
"//shared/cmd: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/version:go_default_library",
|
||||
"//validator/client: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_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