Skip to content

Commit

Permalink
upgradeProxy => startProxyUpgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Ihor Barenblat committed Mar 23, 2020
1 parent 8057d6e commit 0c2425b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions contracts/contracts/UpgradeGatekeeper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions contracts/test/unit_tests/upgradeGatekeeper_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
});
Expand All @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 0c2425b

Please sign in to comment.