Skip to content

Commit 6a94cfb

Browse files
authoredFeb 14, 2023
Remove check for beacon in proposeUpgrade (#745)

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed
 

‎packages/plugin-defender-hardhat/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Remove check for beacon in `proposeUpgrade`. ([#745](https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/745))
6+
37
## 1.8.1 (2022-09-27)
48

59
- Silence warning about missing Defender configuration unless it is required. ([#663](https://github.com/OpenZeppelin/openzeppelin-upgrades/pull/663))

‎packages/plugin-defender-hardhat/src/propose-upgrade.ts

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { UpgradeOptions } from '@openzeppelin/hardhat-upgrades';
22
import '@openzeppelin/hardhat-upgrades/dist/type-extensions';
33
import {
44
getImplementationAddress,
5-
isBeacon,
65
isBeaconProxy,
76
isTransparentOrUUPSProxy,
87
isTransparentProxy,
@@ -43,8 +42,6 @@ export function makeProposeUpgrade(hre: HardhatRuntimeEnvironment): ProposeUpgra
4342

4443
if (await isBeaconProxy(hre.network.provider, proxyAddress)) {
4544
throw new Error(`Beacon proxy is not currently supported with defender.proposeUpgrade()`);
46-
} else if (await isBeacon(hre.network.provider, proxyAddress)) {
47-
throw new Error(`Beacon is not currently supported with defender.proposeUpgrade()`);
4845
} else if (
4946
!multisig &&
5047
(await isTransparentOrUUPSProxy(hre.network.provider, proxyAddress)) &&

‎packages/plugin-defender-hardhat/test/propose-upgrade-beacon.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ test('block proposing an upgrade on beacon', async t => {
4848
const title = 'My upgrade';
4949
const description = 'My contract upgrade';
5050
await t.throwsAsync(() => proposeUpgrade(greeterBeacon.address, GreeterV2, { title, description }), {
51-
message: 'Beacon is not currently supported with defender.proposeUpgrade()',
51+
message: /Contract at \S+ doesn't look like an ERC 1967 proxy with a logic contract address/,
5252
});
5353
});
5454

@@ -81,6 +81,6 @@ test('block proposing an upgrade reusing prepared implementation on beacon', asy
8181

8282
await upgrades.prepareUpgrade(greeterBeacon.address, GreeterV2);
8383
await t.throwsAsync(() => proposeUpgrade(greeterBeacon.address, GreeterV2), {
84-
message: 'Beacon is not currently supported with defender.proposeUpgrade()',
84+
message: /Contract at \S+ doesn't look like an ERC 1967 proxy with a logic contract address/,
8585
});
8686
});

0 commit comments

Comments
 (0)
Please sign in to comment.