@gooddollar/goodprotocol 1.0.6-beta.0 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -17,14 +17,8 @@ describe("ClaimersDistribution", () => {
|
|
|
17
17
|
cd: ClaimersDistribution;
|
|
18
18
|
|
|
19
19
|
before(async () => {
|
|
20
|
-
[
|
|
21
|
-
|
|
22
|
-
acct,
|
|
23
|
-
claimer1,
|
|
24
|
-
claimer2,
|
|
25
|
-
claimer3,
|
|
26
|
-
...signers
|
|
27
|
-
] = await ethers.getSigners();
|
|
20
|
+
[root, acct, claimer1, claimer2, claimer3, ...signers] =
|
|
21
|
+
await ethers.getSigners();
|
|
28
22
|
|
|
29
23
|
const deployedDAO = await createDAO();
|
|
30
24
|
let {
|
|
@@ -202,4 +196,15 @@ describe("ClaimersDistribution", () => {
|
|
|
202
196
|
|
|
203
197
|
expect(endCount).to.be.equal(startCount.add(2));
|
|
204
198
|
});
|
|
199
|
+
|
|
200
|
+
it("should not cost alot of gas to claim with reputation distribution", async () => {
|
|
201
|
+
let totalGas = 0;
|
|
202
|
+
for (let i = 0; i < 31; i++) {
|
|
203
|
+
await increaseTime(60 * 60 * 24);
|
|
204
|
+
const tx = await (await ubiScheme.connect(claimer3).claim()).wait();
|
|
205
|
+
totalGas += tx.gasUsed.toNumber();
|
|
206
|
+
console.log({ totalGas }, tx.gasUsed.toNumber());
|
|
207
|
+
}
|
|
208
|
+
expect(totalGas / 30).lt(300000);
|
|
209
|
+
});
|
|
205
210
|
});
|