-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '__develop' into native-blocks-swap-usage
# Conflicts: # beacon-chain/rpc/prysm/v1alpha1/validator/BUILD.bazel # beacon-chain/rpc/prysm/v1alpha1/validator/proposer_bellatrix.go # beacon-chain/sync/rpc_beacon_blocks_by_range_test.go
- Loading branch information
Showing
13 changed files
with
630 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
load("@prysm//tools/go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
testonly = True, | ||
srcs = ["mock.go"], | ||
importpath = "github.com/prysmaticlabs/prysm/beacon-chain/builder/testing", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//consensus-types/primitives:go_default_library", | ||
"//proto/engine/v1:go_default_library", | ||
"//proto/prysm/v1alpha1:go_default_library", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package testing | ||
|
||
import ( | ||
"context" | ||
|
||
types "github.com/prysmaticlabs/prysm/consensus-types/primitives" | ||
v1 "github.com/prysmaticlabs/prysm/proto/engine/v1" | ||
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" | ||
) | ||
|
||
// MockBuilderService to mock builder. | ||
type MockBuilderService struct { | ||
HasConfigured bool | ||
Payload *v1.ExecutionPayload | ||
ErrSubmitBlindedBlock error | ||
Bid *ethpb.SignedBuilderBid | ||
ErrGetHeader error | ||
ErrStatus error | ||
ErrRegisterValidator error | ||
} | ||
|
||
// Configured for mocking. | ||
func (s *MockBuilderService) Configured() bool { | ||
return s.HasConfigured | ||
} | ||
|
||
// SubmitBlindedBlock for mocking. | ||
func (s *MockBuilderService) SubmitBlindedBlock(context.Context, *ethpb.SignedBlindedBeaconBlockBellatrix) (*v1.ExecutionPayload, error) { | ||
return s.Payload, s.ErrSubmitBlindedBlock | ||
} | ||
|
||
// GetHeader for mocking. | ||
func (s *MockBuilderService) GetHeader(context.Context, types.Slot, [32]byte, [48]byte) (*ethpb.SignedBuilderBid, error) { | ||
return s.Bid, s.ErrGetHeader | ||
} | ||
|
||
// Status for mocking. | ||
func (s *MockBuilderService) Status() error { | ||
return s.ErrStatus | ||
} | ||
|
||
// RegisterValidator for mocking. | ||
func (s *MockBuilderService) RegisterValidator(context.Context, []*ethpb.SignedValidatorRegistrationV1) error { | ||
return s.ErrRegisterValidator | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.