Skip to content

Commit

Permalink
Fix N-17
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestognw committed Aug 2, 2023
1 parent 94a3d2a commit a60707d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/proxy/beacon/UpgradeableBeacon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ contract UpgradeableBeacon is IBeacon, Ownable {
*/
function upgradeTo(address newImplementation) public virtual onlyOwner {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}

/**
Expand All @@ -66,5 +65,6 @@ contract UpgradeableBeacon is IBeacon, Ownable {
revert BeaconInvalidImplementation(newImplementation);
}
_implementation = newImplementation;
emit Upgraded(newImplementation);
}
}
7 changes: 7 additions & 0 deletions test/proxy/beacon/UpgradeableBeacon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ contract('UpgradeableBeacon', function (accounts) {
this.beacon = await UpgradeableBeacon.new(this.v1.address, owner);
});

it('emits Upgraded event to the first implementation', async function () {
const beacon = await UpgradeableBeacon.new(this.v1.address, owner);
await expectEvent.inTransaction(beacon.contract.transactionHash, beacon, 'Upgraded', {
implementation: this.v1.address,
});
});

it('returns implementation', async function () {
expect(await this.beacon.implementation()).to.equal(this.v1.address);
});
Expand Down

0 comments on commit a60707d

Please sign in to comment.