Skip to content

Commit

Permalink
refactor: make VERSION a string
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRBerg committed Mar 3, 2023
1 parent aedc5c9 commit 699f76b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/PRBProxyHelpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract PRBProxyHelpers is
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc IPRBProxyHelpers
uint256 public constant override VERSION = 4;
string public constant override VERSION = "4.0.0";

/*//////////////////////////////////////////////////////////////////////////
NON-CONSTANT FUNCTIONS
Expand Down
2 changes: 1 addition & 1 deletion src/PRBProxyRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract PRBProxyRegistry is IPRBProxyRegistry {
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc IPRBProxyRegistry
uint256 public constant override VERSION = 4;
string public constant override VERSION = "4.0.0";

/*//////////////////////////////////////////////////////////////////////////
PUBLIC STORAGE
Expand Down
6 changes: 3 additions & 3 deletions src/interfaces/IPRBProxyHelpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ interface IPRBProxyHelpers {
PUBLIC CONSTANT FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/

/// @notice The release version of the {PRBProxy} protocol.
/// @dev This version is mirrored here to serve as a link to the proxy registry.
function VERSION() external view returns (uint256);
/// @notice The semantic version of the {PRBProxy} release.
/// @dev This is mirrored here to serve as a link to the proxy registry.
function VERSION() external view returns (string memory);

/*//////////////////////////////////////////////////////////////////////////
PUBLIC NON-CONSTANT FUNCTIONS
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/IPRBProxyRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ interface IPRBProxyRegistry {
PUBLIC CONSTANT FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/

/// @notice The release version of the {PRBProxy} system.
/// @notice The semantic version of the {PRBProxy} release.
/// @dev This is stored in the registry rather than the proxy to save gas for end users.
function VERSION() external view returns (uint256);
function VERSION() external view returns (string memory);

/// @notice Returns the next seed that will be used to deploy the proxy.
/// @param origin The externally owned account (EOA) that is part of the CREATE2 salt.
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/version/version.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Helpers_Test } from "../Helpers.t.sol";

contract Version_Test is Helpers_Test {
function test_Versions() external {
uint256 registryVersion = registry.VERSION();
uint256 helpersVersion = helpers.VERSION();
string memory registryVersion = registry.VERSION();
string memory helpersVersion = helpers.VERSION();
assertEq(registryVersion, helpersVersion, "Registry version does not match helpers version");
}
}
6 changes: 3 additions & 3 deletions test/registry/version/version.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ pragma solidity >=0.8.19 <=0.9.0;
import { Registry_Test } from "../Registry.t.sol";

contract Version_Test is Registry_Test {
/// @dev it should return the release version.
/// @dev it should return the correct version.
function test_Version() external {
uint256 actualVersion = registry.VERSION();
uint256 expectedVersion = 4;
string memory actualVersion = registry.VERSION();
string memory expectedVersion = "4.0.0";
assertEq(actualVersion, expectedVersion, "VERSION");
}
}
2 changes: 1 addition & 1 deletion test/registry/version/version.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version.t.sol
└── it should return the release version
└── it should return the correct version

0 comments on commit 699f76b

Please sign in to comment.