REST VC: Subscribe to Beacon API events (#13453)

* Revert "Revert "REST VC: Subscribe to Beacon API events  (#13354)" (#13428)"

This reverts commit 8d092a1113.

* change logic

* review

* test fix

* fix critical error

* merge flag check

* change error msg

* return on errors

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
Radosław Kapka
2024-01-18 15:27:41 +01:00
committed by GitHub
parent f3ef1b64d6
commit 204de13c86
32 changed files with 503 additions and 84 deletions

View File

@@ -394,7 +394,7 @@ func TestWaitSync_ContextCanceled(t *testing.T) {
n := validatormock.NewMockNodeClient(ctrl)
v := validator{
node: n,
nodeClient: n,
}
ctx, cancel := context.WithCancel(context.Background())
@@ -414,7 +414,7 @@ func TestWaitSync_NotSyncing(t *testing.T) {
n := validatormock.NewMockNodeClient(ctrl)
v := validator{
node: n,
nodeClient: n,
}
n.EXPECT().GetSyncStatus(
@@ -431,7 +431,7 @@ func TestWaitSync_Syncing(t *testing.T) {
n := validatormock.NewMockNodeClient(ctrl)
v := validator{
node: n,
nodeClient: n,
}
n.EXPECT().GetSyncStatus(
@@ -1304,7 +1304,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
v := validator{
validatorClient: client,
node: nodeClient,
nodeClient: nodeClient,
db: db,
pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex),
signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1),
@@ -1386,7 +1386,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
v := validator{
validatorClient: client,
node: nodeClient,
nodeClient: nodeClient,
db: db,
pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex),
signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1),
@@ -1464,7 +1464,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
v := validator{
validatorClient: client,
node: nodeClient,
nodeClient: nodeClient,
db: db,
pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex),
signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1),
@@ -1525,7 +1525,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
v := validator{
validatorClient: client,
node: nodeClient,
nodeClient: nodeClient,
db: db,
pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex),
signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1),
@@ -1593,7 +1593,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
v := validator{
validatorClient: client,
node: nodeClient,
nodeClient: nodeClient,
db: db,
pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex),
signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1),
@@ -1657,7 +1657,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
v := validator{
validatorClient: client,
node: nodeClient,
nodeClient: nodeClient,
db: db,
pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex),
signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1),
@@ -1752,7 +1752,7 @@ func TestValidator_PushProposerSettings(t *testing.T) {
validatorSetter: func(t *testing.T) *validator {
v := validator{
validatorClient: client,
node: nodeClient,
nodeClient: nodeClient,
db: db,
pubkeyToValidatorIndex: make(map[[fieldparams.BLSPubkeyLength]byte]primitives.ValidatorIndex),
signedValidatorRegistrations: make(map[[fieldparams.BLSPubkeyLength]byte]*ethpb.SignedValidatorRegistrationV1),