mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
update-mockgen.sh script (#1451)
* create update-mockgen.sh * update-mockgen.sh: use for loop * update-mockgen.sh access array through indices
This commit is contained in:
committed by
Preston Van Loon
parent
453abae3f0
commit
9943e87d76
16
scripts/update-mockgen.sh
Normal file
16
scripts/update-mockgen.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user