mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Update to V4 🚀 (#12134)
* Update V3 from V4 * Fix build v3 -> v4 * Update ssz * Update beacon_chain.pb.go * Fix formatter import * Update update-mockgen.sh comment to v4 * Fix conflicts. Pass build and tests * Fix test
This commit is contained in:
@@ -12,7 +12,7 @@ while IFS= read -d $'\0' -r file; do
|
||||
done < <($findutil -L "$(bazel info bazel-bin)"/proto -type f -regextype sed -regex ".*pb\.\(gw\.\)\?go$" -print0)
|
||||
|
||||
arraylength=${#file_list[@]}
|
||||
searchstring="prysmaticlabs/prysm/v3/"
|
||||
searchstring="prysmaticlabs/prysm/v4/"
|
||||
|
||||
# Copy pb.go files from bazel-bin to original folder where .proto is.
|
||||
for ((i = 0; i < arraylength; i++)); do
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
mock_path="testing/mock"
|
||||
|
||||
# github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1
|
||||
# github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1
|
||||
# ------------------------------------------------------
|
||||
proto_mocks_v1alpha1=(
|
||||
"$mock_path/beacon_service_mock.go BeaconChainClient,BeaconChain_StreamChainHeadClient,BeaconChain_StreamAttestationsClient,BeaconChain_StreamBlocksClient,BeaconChain_StreamValidatorsInfoClient,BeaconChain_StreamIndexedAttestationsClient"
|
||||
@@ -21,10 +21,10 @@ for ((i = 0; i < ${#proto_mocks_v1alpha1[@]}; i++)); do
|
||||
interfaces=${proto_mocks_v1alpha1[i]#* };
|
||||
echo "generating $file for interfaces: $interfaces";
|
||||
echo
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1 "$interfaces"
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1 "$interfaces"
|
||||
done
|
||||
|
||||
# github.com/prysmaticlabs/prysm/v3/proto/eth/service
|
||||
# github.com/prysmaticlabs/prysm/v4/proto/eth/service
|
||||
# ---------------------------------------------------
|
||||
proto_mocks_service=(
|
||||
"$mock_path/event_service_mock.go EventsClient,Events_StreamEventsClient,Events_StreamEventsServer"
|
||||
@@ -35,10 +35,10 @@ for ((i = 0; i < ${#proto_mocks_service[@]}; i++)); do
|
||||
interfaces=${proto_mocks_service[i]#* };
|
||||
echo "generating $file for interfaces: $interfaces";
|
||||
echo
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v3/proto/eth/service "$interfaces"
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v4/proto/eth/service "$interfaces"
|
||||
done
|
||||
|
||||
# github.com/prysmaticlabs/prysm/proto/v3/prysm/v1alpha1/validator-client
|
||||
# github.com/prysmaticlabs/prysm/proto/v4/prysm/v1alpha1/validator-client
|
||||
# -----------------------------------------------------------------------
|
||||
proto_mocks_v1alpha1_validator_clients=(
|
||||
"$mock_path/keymanager_mock.go RemoteSignerClient"
|
||||
@@ -49,10 +49,10 @@ for ((i = 0; i < ${#proto_mocks_v1alpha1_validator_clients[@]}; i++)); do
|
||||
interfaces=${proto_mocks_v1alpha1_validator_clients[i]#* };
|
||||
echo "generating $file for interfaces: $interfaces";
|
||||
echo
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1/validator-client "$interfaces"
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1/validator-client "$interfaces"
|
||||
done
|
||||
|
||||
# github.com/prysmaticlabs/prysm/v3/validator/client/iface
|
||||
# github.com/prysmaticlabs/prysm/v4/validator/client/iface
|
||||
# --------------------------------------------------------
|
||||
iface_mocks=(
|
||||
"$mock_path/validator_client_mock.go ValidatorClient"
|
||||
@@ -62,13 +62,13 @@ for ((i = 0; i < ${#iface_mocks[@]}; i++)); do
|
||||
file=${iface_mocks[i]% *};
|
||||
interfaces=${iface_mocks[i]#* };
|
||||
echo "generating $file for interfaces: $interfaces";
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v3/validator/client/iface "$interfaces"
|
||||
GO11MODULE=on mockgen -package=mock -destination="$file" github.com/prysmaticlabs/prysm/v4/validator/client/iface "$interfaces"
|
||||
done
|
||||
|
||||
goimports -w "$mock_path/."
|
||||
gofmt -s -w "$mock_path/."
|
||||
|
||||
# github.com/prysmaticlabs/prysm/v3/validator/client/beacon-api
|
||||
# github.com/prysmaticlabs/prysm/v4/validator/client/beacon-api
|
||||
# -------------------------------------------------------------
|
||||
beacon_api_mock_path="validator/client/beacon-api/mock"
|
||||
beacon_api_mocks=(
|
||||
@@ -89,7 +89,7 @@ done
|
||||
goimports -w "$beacon_api_mock_path/."
|
||||
gofmt -s -w "$beacon_api_mock_path/."
|
||||
|
||||
# github.com/prysmaticlabs/prysm/v3/crypto/bls
|
||||
# github.com/prysmaticlabs/prysm/v4/crypto/bls
|
||||
# --------------------------------------------
|
||||
crypto_bls_common_mock_path="crypto/bls/common/mock"
|
||||
crypto_bls_common_mocks=(
|
||||
|
||||
Reference in New Issue
Block a user