mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-05 17:22:18 +00:00
190d862552
* Return status.Errorf instead of plain errors from gRPC functions * return plain errors from helper functions * change errors to lowercase in node * correct test expectations * extracted StateFetcher * StateFetcher tests * extract beacon state creation option and fix state tests * add comment to StateFetcher * register the server * implement grpc function * test ToProto * gRPC function test with mock state fetcher * reduce visibility of packages * add missing error assertion * removed unused code * overwrite config name * gzl * Fix service fields * rename StateFetcher to Provider * Update beacon-chain/state/stateV0/state_trie.go Co-authored-by: Raul Jordan <raul@prysmaticlabs.com> * adjust code to new v0 interfaces * interface/struct naming changes Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
28 lines
718 B
Go
28 lines
718 B
Go
package debugv1
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1"
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/testutil"
|
|
sharedtestutil "github.com/prysmaticlabs/prysm/shared/testutil"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
|
)
|
|
|
|
func TestGetBeaconState(t *testing.T) {
|
|
fakeState, err := sharedtestutil.NewBeaconState()
|
|
require.NoError(t, err)
|
|
server := &Server{
|
|
StateFetcher: &testutil.MockFetcher{
|
|
BeaconState: fakeState,
|
|
},
|
|
}
|
|
resp, err := server.GetBeaconState(context.Background(), ðpb.StateRequest{
|
|
StateId: make([]byte, 0),
|
|
})
|
|
require.NoError(t, err)
|
|
assert.NotNil(t, resp)
|
|
}
|