2019-02-03 05:13:16 +00:00
|
|
|
#!/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.
|
|
|
|
|
2019-03-24 00:46:25 +00:00
|
|
|
mocks=(
|
2019-09-18 13:34:50 +00:00
|
|
|
"./beacon-chain/internal/validator_service_mock.go ValidatorServiceServer,ValidatorService_WaitForActivationServer,ValidatorService_WaitForChainStartServer"
|
2019-03-24 00:46:25 +00:00
|
|
|
"./validator/internal/attester_service_mock.go AttesterServiceClient"
|
2019-02-03 05:13:16 +00:00
|
|
|
"./validator/internal/proposer_service_mock.go ProposerServiceClient"
|
2019-11-22 05:11:38 +00:00
|
|
|
"./validator/internal/aggregator_service_mock.go AggregatorServiceClient"
|
2019-09-18 13:34:50 +00:00
|
|
|
"./validator/internal/validator_service_mock.go ValidatorServiceClient,ValidatorService_WaitForActivationClient,ValidatorService_WaitForChainStartClient")
|
2019-02-03 05:13:16 +00:00
|
|
|
|
|
|
|
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
|
2019-03-24 00:46:25 +00:00
|
|
|
done
|