From d06f76e2cf4864076f89f1f2eb9deef08e4b4286 Mon Sep 17 00:00:00 2001 From: huyhuynh3103 Date: Wed, 31 Jul 2024 14:58:28 +0700 Subject: [PATCH] feat: change visibility of callback to internal --- script/BaseMigration.s.sol | 6 +++--- script/libraries/LibDeploy.sol | 4 ++-- test/LibDeploy.t.sol | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/script/BaseMigration.s.sol b/script/BaseMigration.s.sol index fb57089..1cc70d5 100644 --- a/script/BaseMigration.s.sol +++ b/script/BaseMigration.s.sol @@ -30,13 +30,13 @@ abstract contract BaseMigration is ScriptExtended { _injectDependencies(); } - function upgradeCallback( + function _upgradeCallback( address, /* proxy */ address, /* logic */ uint256, /* callValue */ bytes memory, /* callData */ ProxyInterface /* proxyInterface */ - ) external virtual { } + ) internal virtual { } function _sharedArguments() internal virtual returns (bytes memory rawSharedArgs); @@ -271,7 +271,7 @@ abstract contract BaseMigration is ScriptExtended { callData: args, shouldPrompt: true, proxyInterface: ProxyInterface.Transparent, - upgradeCallback: this.upgradeCallback, + upgradeCallback: _upgradeCallback, shouldUseCallback: false }).upgrade(); } diff --git a/script/libraries/LibDeploy.sol b/script/libraries/LibDeploy.sol index b106640..13bf4d1 100644 --- a/script/libraries/LibDeploy.sol +++ b/script/libraries/LibDeploy.sol @@ -32,7 +32,7 @@ struct UpgradeInfo { uint256 callValue; bytes callData; ProxyInterface proxyInterface; - function(address,address,uint256,bytes memory,ProxyInterface) external upgradeCallback; + function(address,address,uint256,bytes memory,ProxyInterface) internal upgradeCallback; bool shouldUseCallback; bool shouldPrompt; } @@ -120,7 +120,7 @@ library LibDeploy { uint256 callValue, bytes memory callData, bool shouldPrompt, - function(address,address,uint256,bytes memory,ProxyInterface) external upgradeCallback, + function(address,address,uint256,bytes memory,ProxyInterface) internal upgradeCallback, bool shouldUseCallback ) internal validateUpgrade(proxy, logic, shouldPrompt) { if (shouldUseCallback) { diff --git a/test/LibDeploy.t.sol b/test/LibDeploy.t.sol index 9784d99..d0c6f0a 100644 --- a/test/LibDeploy.t.sol +++ b/test/LibDeploy.t.sol @@ -31,7 +31,7 @@ contract LibDeployTest is Test { callValue: 0, callData: abi.encodeCall(MockERC721.initialize, ("Name", "Symbol")), proxyInterface: ProxyInterface.Transparent, - upgradeCallback: this.emptyFn, + upgradeCallback: emptyFn, shouldPrompt: false, shouldUseCallback: false }); @@ -56,7 +56,7 @@ contract LibDeployTest is Test { callValue: 0, callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)), proxyInterface: ProxyInterface.Transparent, - upgradeCallback: this.emptyFn, + upgradeCallback: emptyFn, shouldPrompt: false, shouldUseCallback: false }); @@ -79,7 +79,7 @@ contract LibDeployTest is Test { callValue: 0, callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)), proxyInterface: ProxyInterface.Transparent, - upgradeCallback: this.emptyFn, + upgradeCallback: emptyFn, shouldPrompt: false, shouldUseCallback: false }); @@ -108,7 +108,7 @@ contract LibDeployTest is Test { callValue: 0, callData: abi.encodeCall(MockERC20.initialize, ("Name", "Symbol", 18)), proxyInterface: ProxyInterface.Transparent, - upgradeCallback: this.emptyFn, + upgradeCallback: emptyFn, shouldPrompt: false, shouldUseCallback: false }); @@ -122,5 +122,5 @@ contract LibDeployTest is Test { uint256, /* callValue */ bytes memory, /* callData */ ProxyInterface /* proxyInterface */ - ) external { } + ) internal { } }