mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-12 20:50:05 +00:00
Skip empty criteria for public key instead of fail (#3130)
This commit is contained in:
parent
7e819990f6
commit
d59800210a
@ -222,6 +222,11 @@ func (bs *BeaconChainServer) ListValidatorBalances(
|
||||
}
|
||||
|
||||
for _, pubKey := range req.PublicKeys {
|
||||
// Skip empty public key
|
||||
if len(pubKey) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
index, err := bs.beaconDB.ValidatorIndex(pubKey)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "could not retrieve validator index: %v", err)
|
||||
|
@ -326,6 +326,11 @@ func TestBeaconChainServer_ListValidatorBalances(t *testing.T) {
|
||||
{Index: 3, PublicKey: []byte{3}, Balance: 3},
|
||||
{Index: 4, PublicKey: []byte{4}, Balance: 4}},
|
||||
}},
|
||||
{req: ðpb.GetValidatorBalancesRequest{PublicKeys: [][]byte{{}}, Indices: []uint64{3, 4}}, // Public key has a blank value
|
||||
res: ðpb.ValidatorBalances{Balances: []*ethpb.ValidatorBalances_Balance{
|
||||
{Index: 3, PublicKey: []byte{3}, Balance: 3},
|
||||
{Index: 4, PublicKey: []byte{4}, Balance: 4}},
|
||||
}},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user