From 0c2425bcdee83bc6c4d6207f2708e78bcc82c606 Mon Sep 17 00:00:00 2001 From: Ihor Barenblat Date: Mon, 23 Mar 2020 09:58:00 +0200 Subject: [PATCH] upgradeProxy => startProxyUpgrade --- contracts/contracts/UpgradeGatekeeper.sol | 4 ++-- contracts/test/unit_tests/upgradeGatekeeper_test.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/contracts/UpgradeGatekeeper.sol b/contracts/contracts/UpgradeGatekeeper.sol index 1c0f6284c9..ec0e5e312b 100644 --- a/contracts/contracts/UpgradeGatekeeper.sol +++ b/contracts/contracts/UpgradeGatekeeper.sol @@ -51,10 +51,10 @@ contract UpgradeGatekeeper is UpgradeEvents, Ownable { mainContractAddress = _mainContractAddress; } - /// @notice Activates notice period + /// @notice Starts upgrade (activates notice period) /// @param proxyAddress Address of proxy to process /// @param newTarget New target - function upgradeProxy(address proxyAddress, address newTarget) external { + function startProxyUpgrade(address proxyAddress, address newTarget) external { requireMaster(msg.sender); require(upgradeInfo[proxyAddress].upgradeStatus == UpgradeGatekeeper.UpgradeStatus.Idle, "upa11"); // upa11 - unable to activate active upgrade mode diff --git a/contracts/test/unit_tests/upgradeGatekeeper_test.ts b/contracts/test/unit_tests/upgradeGatekeeper_test.ts index 55f8c4228c..919ae66a51 100644 --- a/contracts/test/unit_tests/upgradeGatekeeper_test.ts +++ b/contracts/test/unit_tests/upgradeGatekeeper_test.ts @@ -43,7 +43,7 @@ describe("UpgradeGatekeeper unit tests", function () { it("checking that requireMaster calls present", async () => { let UpgradeGatekeeperContract_with_wallet2_signer = await UpgradeGatekeeperContract.connect(wallet2); - expect((await getCallRevertReason( () => UpgradeGatekeeperContract_with_wallet2_signer.upgradeProxy(AddressZero, AddressZero) )).revertReason).equal("oro11") + expect((await getCallRevertReason( () => UpgradeGatekeeperContract_with_wallet2_signer.startProxyUpgrade(AddressZero, AddressZero) )).revertReason).equal("oro11") expect((await getCallRevertReason( () => UpgradeGatekeeperContract_with_wallet2_signer.cancelProxyUpgrade(AddressZero) )).revertReason).equal("oro11") expect((await getCallRevertReason( () => UpgradeGatekeeperContract_with_wallet2_signer.finishProxyUpgrade(AddressZero, []) )).revertReason).equal("oro11") }); @@ -53,10 +53,10 @@ describe("UpgradeGatekeeper unit tests", function () { expect((await getCallRevertReason( () => UpgradeGatekeeperContract.activateCleaningUpStatusOfUpgrade(proxyTestContract.address) )).revertReason).equal("uaf11") expect((await getCallRevertReason( () => UpgradeGatekeeperContract.finishProxyUpgrade(proxyTestContract.address, []) )).revertReason).equal("umf11") - await expect(UpgradeGatekeeperContract.upgradeProxy(proxyTestContract.address, DummySecond.address)) + await expect(UpgradeGatekeeperContract.startProxyUpgrade(proxyTestContract.address, DummySecond.address)) .to.emit(UpgradeGatekeeperContract, 'UpgradeModeActivated') .withArgs(proxyTestContract.address, 0) - expect((await getCallRevertReason( () => UpgradeGatekeeperContract.upgradeProxy(proxyTestContract.address, DummySecond.address) )).revertReason).equal("upa11") + expect((await getCallRevertReason( () => UpgradeGatekeeperContract.startProxyUpgrade(proxyTestContract.address, DummySecond.address) )).revertReason).equal("upa11") await expect(UpgradeGatekeeperContract.cancelProxyUpgrade(proxyTestContract.address)) .to.emit(UpgradeGatekeeperContract, 'UpgradeCanceled') .withArgs(proxyTestContract.address, 0) @@ -66,7 +66,7 @@ describe("UpgradeGatekeeper unit tests", function () { let start_time = performance.now(); // activate - await expect(UpgradeGatekeeperContract.upgradeProxy(proxyTestContract.address, DummySecond.address)) + await expect(UpgradeGatekeeperContract.startProxyUpgrade(proxyTestContract.address, DummySecond.address)) .to.emit(UpgradeGatekeeperContract, 'UpgradeModeActivated') .withArgs(proxyTestContract.address, 0) @@ -117,7 +117,7 @@ describe("UpgradeGatekeeper unit tests", function () { .to.equal(bytes[3]); // one more activate and cancel with version equal to 1 - await expect(UpgradeGatekeeperContract.upgradeProxy(proxyTestContract.address, DummyFirst.address)) + await expect(UpgradeGatekeeperContract.startProxyUpgrade(proxyTestContract.address, DummyFirst.address)) .to.emit(UpgradeGatekeeperContract, 'UpgradeModeActivated') .withArgs(proxyTestContract.address, 1); await expect(UpgradeGatekeeperContract.cancelProxyUpgrade(proxyTestContract.address))