Skip to content

Commit 56a002d

Browse files
committed
updated unit tests
1 parent 45c2855 commit 56a002d

12 files changed

+1201
-1790
lines changed

spot-vaults/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"ethers": "^6.6.0",
6363
"ethers-v5": "npm:ethers@^5.7.0",
6464
"ganache-cli": "latest",
65-
"hardhat": "^2.22.8",
65+
"hardhat": "^2.22.10",
6666
"hardhat-gas-reporter": "latest",
6767
"lodash": "^4.17.21",
6868
"prettier": "^2.7.1",

spot-vaults/tasks/upgrade.ts

+46-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,20 @@ import { TaskArguments } from "hardhat/types";
44
import { sleep } from "./tools";
55

66
task("validate_upgrade")
7-
.addPositionalParam("factory", "the name of the factory", undefined, types.string, false)
8-
.addPositionalParam("address", "the address of the deployed proxy contract", undefined, types.string, false)
7+
.addPositionalParam(
8+
"factory",
9+
"the name of the factory",
10+
undefined,
11+
types.string,
12+
false,
13+
)
14+
.addPositionalParam(
15+
"address",
16+
"the address of the deployed proxy contract",
17+
undefined,
18+
types.string,
19+
false,
20+
)
921
.setAction(async function (args: TaskArguments, hre) {
1022
const { factory, address } = args;
1123
const Factory = await hre.ethers.getContractFactory(factory);
@@ -23,8 +35,20 @@ task("validate_upgrade")
2335
});
2436

2537
task("prepare_upgrade")
26-
.addPositionalParam("factory", "the name of the factory", undefined, types.string, false)
27-
.addPositionalParam("address", "the address of the deployed proxy contract", undefined, types.string, false)
38+
.addPositionalParam(
39+
"factory",
40+
"the name of the factory",
41+
undefined,
42+
types.string,
43+
false,
44+
)
45+
.addPositionalParam(
46+
"address",
47+
"the address of the deployed proxy contract",
48+
undefined,
49+
types.string,
50+
false,
51+
)
2852
.addParam("fromIdx", "the index of sender", 0, types.int)
2953
.setAction(async function (args: TaskArguments, hre) {
3054
const { factory, address } = args;
@@ -52,8 +76,20 @@ task("prepare_upgrade")
5276
});
5377

5478
task("upgrade:testnet")
55-
.addPositionalParam("factory", "the name of the factory", undefined, types.string, false)
56-
.addPositionalParam("address", "the address of the deployed proxy contract", undefined, types.string, false)
79+
.addPositionalParam(
80+
"factory",
81+
"the name of the factory",
82+
undefined,
83+
types.string,
84+
false,
85+
)
86+
.addPositionalParam(
87+
"address",
88+
"the address of the deployed proxy contract",
89+
undefined,
90+
types.string,
91+
false,
92+
)
5793
.addParam("fromIdx", "the index of sender", 0, types.int)
5894
.setAction(async function (args: TaskArguments, hre) {
5995
const signer = (await hre.ethers.getSigners())[args.fromIdx];
@@ -64,7 +100,10 @@ task("upgrade:testnet")
64100
const Factory = await hre.ethers.getContractFactory(factory);
65101

66102
console.log("Proxy", address);
67-
console.log("Current implementation", await getImplementationAddress(hre.ethers.provider, address));
103+
console.log(
104+
"Current implementation",
105+
await getImplementationAddress(hre.ethers.provider, address),
106+
);
68107

69108
const impl = await hre.upgrades.upgradeProxy(address, Factory, {
70109
unsafeAllowRenames: true,

0 commit comments

Comments
 (0)