prysm-pulse/scripts/update-mockgen.sh
terence tsao 06bfda24d5 Revert "Remove Redundant Committee Assignment Getters in Validator RPC Service (#1655)" (#1664)
This reverts commit 15f8b6a10da28a1983bbd1c1ea78dc5ad92ea487.
2019-02-20 14:46:30 -06:00

16 lines
812 B
Bash

#!/bin/bash
# Script to update mock files after proto/beacon/rpc/v1/services.proto changes.
# Use a space to separate mock destination from its interfaces.
mocks=("./validator/internal/attester_service_mock.go AttesterServiceClient"
"./validator/internal/beacon_service_mock.go BeaconServiceClient,BeaconService_LatestAttestationClient,BeaconService_WaitForChainStartClient"
"./validator/internal/proposer_service_mock.go ProposerServiceClient"
"./validator/internal/validator_service_mock.go ValidatorServiceClient")
for ((i = 0; i < ${#mocks[@]}; i++)); do
file=${mocks[i]% *};
interfaces=${mocks[i]#* };
echo "generating $file for interfaces: $interfaces";
mockgen -package=internal -destination=$file github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1 $interfaces
done