Skip to content

Commit

Permalink
Include Latest Ethereum APIs Definitions in Prysm (prysmaticlabs#4759)
Browse files Browse the repository at this point in the history
* include latest ethereumapis and implement streams
* add comments and error unimpl
* Merge branch 'master' into blocks-stream
* add strm
* Merge refs/heads/master into blocks-stream
* Merge refs/heads/master into blocks-stream
* Merge refs/heads/master into blocks-stream
* add in mocks
* Merge branch 'blocks-stream' of github.com:prysmaticlabs/prysm into blocks-stream
* use right mock
* gaz
* ptypes
* gaz
* gomock dep
* Merge refs/heads/master into blocks-stream
  • Loading branch information
rauljordan authored and cryptomental committed Feb 28, 2020
1 parent b2ded8b commit 6530d39
Show file tree
Hide file tree
Showing 7 changed files with 845 additions and 48 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE
Expand Up @@ -1297,7 +1297,7 @@ go_repository(
go_repository(
name = "com_github_prysmaticlabs_ethereumapis",
commit = "c2c488463094ba91ed5d8f147a0abbabb1220d10",
commit = "a90fbe4a333e538a897fb6008b35271ef6b7b124",
importpath = "github.com/prysmaticlabs/ethereumapis",
patch_args = ["-p1"],
patches = [
Expand Down
5 changes: 5 additions & 0 deletions beacon-chain/rpc/beacon/blocks.go
Expand Up @@ -176,6 +176,11 @@ func (bs *Server) GetChainHead(ctx context.Context, _ *ptypes.Empty) (*ethpb.Cha
return bs.chainHeadRetrieval(ctx)
}

// StreamBlocks to clients every single time a block is received by the beacon node.
func (bs *Server) StreamBlocks(_ *ptypes.Empty, stream ethpb.BeaconChain_StreamBlocksServer) error {
return status.Error(codes.Unimplemented, "Unimplemented")
}

// StreamChainHead to clients every single time the head block and state of the chain change.
func (bs *Server) StreamChainHead(_ *ptypes.Empty, stream ethpb.BeaconChain_StreamChainHeadServer) error {
stateChannel := make(chan *feed.Event, 1)
Expand Down
6 changes: 6 additions & 0 deletions beacon-chain/rpc/beacon/validators.go
Expand Up @@ -629,6 +629,12 @@ func (bs *Server) GetValidatorPerformance(
}, nil
}

// StreamValidatorsInfo streams out important validator information and metadata
// each epoch.
func (bs *Server) StreamValidatorsInfo(stream ethpb.BeaconChain_StreamValidatorsInfoServer) error {
return status.Error(codes.Unimplemented, "Unimplemented")
}

// Determines whether a validator has already exited.
func validatorHasExited(validator *ethpb.Validator, currentEpoch uint64) bool {
farFutureEpoch := params.BeaconConfig().FarFutureEpoch
Expand Down
258 changes: 255 additions & 3 deletions beacon-chain/rpc/testing/beacon_chain_service_mock.go

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

1 change: 1 addition & 0 deletions shared/mock/BUILD.bazel
Expand Up @@ -12,5 +12,6 @@ go_library(
"@com_github_golang_mock//gomock:go_default_library",
"@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
],
)

0 comments on commit 6530d39

Please sign in to comment.