Skip to content

Commit

Permalink
Removed versions for UsingRegistry and patch tooling (#9866)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvol committed Sep 20, 2022
1 parent d90181f commit 4bf959b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
8 changes: 0 additions & 8 deletions packages/protocol/contracts/common/UsingRegistryV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ contract UsingRegistryV2 {
_;
}

/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 1, 0);
}

function getAccounts() internal view returns (IAccounts) {
return IAccounts(registryContract.getAddressForOrDie(ACCOUNTS_REGISTRY_ID));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,4 @@ contract UsingRegistryV2BackwardsCompatible is UsingRegistryV2 {
// without breaking release tooling.
// Use `registryContract` (in UsingRegistryV2) for the actual registry address.
IRegistry public registry;
/**
* @notice Returns the storage, major, minor, and patch version of the contract.
* @return The storage, major, minor, and patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 0, 0);
}
}
4 changes: 1 addition & 3 deletions packages/protocol/scripts/bash/check-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ done
[ -z "$OLD_BRANCH" ] && echo "Need to set the old branch via the -a flag" && exit 1;
[ -z "$NEW_BRANCH" ] && echo "Need to set the new branch via the -b flag" && exit 1;

# Exclude test contracts, mock contracts, contract interfaces, Proxy contracts, inlined libraries,
# MultiSig contracts, and the ReleaseGold contract.
CONTRACT_EXCLUSION_REGEX=".*Test|Mock.*|I[A-Z].*|.*Proxy|MultiSig.*|ReleaseGold|SlasherUtil|UsingPrecompiles"
source scripts/bash/contract-exclusion-regex.sh

REPORT_FLAG=""
if [ ! -z "$REPORT" ]; then
Expand Down
11 changes: 11 additions & 0 deletions packages/protocol/scripts/bash/contract-exclusion-regex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Exclude test contracts, mock contracts, contract interfaces, Proxy contracts, inlined libraries,
# MultiSig contracts, and the ReleaseGold contract.
CONTRACT_EXCLUSION_REGEX=".*Test|Mock.*|I[A-Z].*|.*Proxy|MultiSig.*|ReleaseGold|SlasherUtil|UsingPrecompiles"

# Before CR7, UsingRegistry and UsingRegistryV2 had been deployed, they need to keep getting deployed to keep the release reports without changes.
VERSION_NUMBER=$(echo "$OLD_BRANCH" | tr -dc '0-9')

if [ $VERSION_NUMBER -gt 6 ]
then
CONTRACT_EXCLUSION_REGEX="$CONTRACT_EXCLUSION_REGEX|^UsingRegistry"
fi
3 changes: 2 additions & 1 deletion packages/protocol/scripts/bash/release-on-devchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ yarn run truffle exec ./scripts/truffle/verify-bytecode.js --network development

echo "- Check versions of current branch"
# From check-versions.sh
CONTRACT_EXCLUSION_REGEX=".*Test|Mock.*|I[A-Z].*|.*Proxy|MultiSig.*|ReleaseGold|SlasherUtil|UsingPrecompiles"
OLD_BRANCH=$BUILD_DIR
source scripts/bash/contract-exclusion-regex.sh
yarn ts-node scripts/check-backward.ts sem_check --old_contracts $BUILD_DIR/contracts --new_contracts build/contracts --exclude $CONTRACT_EXCLUSION_REGEX --output_file report.json

# From make-release.sh
Expand Down

0 comments on commit 4bf959b

Please sign in to comment.