Skip to content

Commit

Permalink
🚚 paymaster: rename VERSION() to version()
Browse files Browse the repository at this point in the history
  • Loading branch information
qd-qd committed Apr 1, 2024
1 parent 4bd2dc6 commit 57a6b85
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion script/Paymaster/01_PaymasterDeploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contract PaymasterDeploy is BaseScript {
Paymaster paymaster = new Paymaster(entryPointAddress, owner, operator);

// 4. Check the version of the paymaster is the expected one
require(Metadata.VERSION == paymaster.VERSION(), "Version mismatch");
require(Metadata.VERSION == paymaster.version(), "Version mismatch");

return paymaster;
}
Expand Down
12 changes: 6 additions & 6 deletions src/v1/Paymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ import { Metadata } from "src/v1/Metadata.sol";
/// - The signature includes the sender, nonce, chainId, the address of this contract and the callData to prevent
/// replay attacks
contract Paymaster is BasePaymaster {
// ==============================
// ========= METADATA ===========
// ==============================

uint256 public constant VERSION = Metadata.VERSION;

// ==============================
// =========== STATE ============
// ==============================
Expand Down Expand Up @@ -79,6 +73,12 @@ contract Paymaster is BasePaymaster {
// ======== FUNCTIONS ===========
// ==============================

/// @notice This function returns the version of the contract
/// @return * The version of the contract
function version() external pure virtual returns (uint256) {
return Metadata.VERSION;
}

/// @notice Change the operator of the paymaster
/// @param newOperator The new operator address
/// @dev Only the owner or the operator can call this function
Expand Down
2 changes: 1 addition & 1 deletion test/unit/v1/Paymaster/constructor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ contract Paymaster__Constructor is BaseTest {
vm.record();

// fetch the owner of the paymaster
uint256 versionStored = paymaster.VERSION();
uint256 versionStored = paymaster.version();

(bytes32[] memory reads,) = vm.accesses(address(paymaster));

Expand Down
2 changes: 1 addition & 1 deletion test/unit/v1/Paymaster/versionning.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ contract Paymaster__Versionning is BaseTest {
function test_AllowVersionFetching() external {
// it allow version fetching

assertEq(paymaster.VERSION(), Metadata.VERSION);
assertEq(paymaster.version(), Metadata.VERSION);
}
}

0 comments on commit 57a6b85

Please sign in to comment.