Skip to content

Commit dc4c2bd

Browse files
authored
For Consistency: Rename 'upgrade' Function to 'upgradeTo' (#80)
* Rename 'upgrade' function to 'upgradeTo' * Updated versions
1 parent 07cb309 commit dc4c2bd

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

contracts/contracts-registry/pools/AbstractPoolContractsRegistry.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ abstract contract AbstractPoolContractsRegistry is Initializable, AbstractDepend
125125
}
126126

127127
if (_beacons[names_[i]].implementation() != newImplementations_[i]) {
128-
_beacons[names_[i]].upgrade(newImplementations_[i]);
128+
_beacons[names_[i]].upgradeTo(newImplementations_[i]);
129129
}
130130
}
131131
}

contracts/contracts-registry/pools/proxy/ProxyBeacon.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ contract ProxyBeacon is IBeacon {
2727
_OWNER = msg.sender;
2828
}
2929

30-
function upgrade(address newImplementation_) external onlyOwner {
30+
function upgradeTo(address newImplementation_) external onlyOwner {
3131
require(newImplementation_.isContract(), "ProxyBeacon: not a contract");
3232

3333
_implementation = newImplementation_;

contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solarity/solidity-lib",
3-
"version": "2.6.10",
3+
"version": "2.6.11",
44
"license": "MIT",
55
"author": "Distributed Lab",
66
"readme": "README.md",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solarity/solidity-lib",
3-
"version": "2.6.10",
3+
"version": "2.6.11",
44
"license": "MIT",
55
"author": "Distributed Lab",
66
"description": "Solidity Library by Distributed Lab",

test/contracts-registry/pools/ProxyBeacon.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ describe("ProxyBeacon", () => {
3333
it("should upgrade", async () => {
3434
expect(await proxyBeacon.implementation()).to.equal(ZERO_ADDR);
3535

36-
await proxyBeacon.upgrade(await token.getAddress());
36+
await proxyBeacon.upgradeTo(await token.getAddress());
3737

3838
expect(await proxyBeacon.implementation()).to.equal(await token.getAddress());
3939
});
4040

4141
it("should not upgrade to non-contract", async () => {
42-
await expect(proxyBeacon.upgrade(SECOND)).to.be.revertedWith("ProxyBeacon: not a contract");
42+
await expect(proxyBeacon.upgradeTo(SECOND)).to.be.revertedWith("ProxyBeacon: not a contract");
4343
});
4444

4545
it("only owner should upgrade", async () => {
46-
await expect(proxyBeacon.connect(SECOND).upgrade(await token.getAddress())).to.be.revertedWith(
46+
await expect(proxyBeacon.connect(SECOND).upgradeTo(await token.getAddress())).to.be.revertedWith(
4747
"ProxyBeacon: not an owner",
4848
);
4949
});

0 commit comments

Comments
 (0)