Skip to content

Commit a3767dd

Browse files
committed
refactor: remove weight of selectors
1 parent e95b180 commit a3767dd

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

test/forge/InvariantTest.sol

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ contract InvariantTest is BaseTest {
4747
vm.stopPrank();
4848
}
4949

50-
function _weightSelector(bytes4 selector, uint256 weight) internal {
51-
for (uint256 i; i < weight; ++i) {
52-
selectors.push(selector);
53-
}
54-
}
55-
5650
/* HANDLERS */
5751

5852
function mine(uint256 blocks) external {

test/forge/invariant/BaseInvariantTest.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ contract BaseInvariantTest is InvariantTest {
1919
}
2020

2121
function setUp() public virtual override {
22-
_weightSelector(this.supplyAssetsOnBehalfNoRevert.selector, 15);
23-
_weightSelector(this.supplySharesOnBehalfNoRevert.selector, 5);
24-
_weightSelector(this.withdrawAssetsOnBehalfNoRevert.selector, 10);
25-
_weightSelector(this.borrowAssetsOnBehalfNoRevert.selector, 15);
26-
_weightSelector(this.repayAssetsOnBehalfNoRevert.selector, 10);
27-
_weightSelector(this.repaySharesOnBehalfNoRevert.selector, 10);
28-
_weightSelector(this.supplyCollateralOnBehalfNoRevert.selector, 15);
29-
_weightSelector(this.withdrawCollateralOnBehalfNoRevert.selector, 10);
22+
selectors.push(this.supplyAssetsOnBehalfNoRevert.selector);
23+
selectors.push(this.supplySharesOnBehalfNoRevert.selector);
24+
selectors.push(this.withdrawAssetsOnBehalfNoRevert.selector);
25+
selectors.push(this.borrowAssetsOnBehalfNoRevert.selector);
26+
selectors.push(this.repayAssetsOnBehalfNoRevert.selector);
27+
selectors.push(this.repaySharesOnBehalfNoRevert.selector);
28+
selectors.push(this.supplyCollateralOnBehalfNoRevert.selector);
29+
selectors.push(this.withdrawCollateralOnBehalfNoRevert.selector);
3030

3131
super.setUp();
3232

test/forge/invariant/DynamicInvariantTest.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ contract DynamicInvariantTest is BaseInvariantTest {
1111
uint256 internal immutable MAX_PRICE = ORACLE_PRICE_SCALE * 10;
1212

1313
function setUp() public virtual override {
14-
_weightSelector(this.liquidateSeizedAssetsNoRevert.selector, 2);
15-
_weightSelector(this.liquidateRepaidSharesNoRevert.selector, 2);
16-
_weightSelector(this.setFeeNoRevert.selector, 1);
17-
_weightSelector(this.setPrice.selector, 5);
18-
_weightSelector(this.mine.selector, 100);
14+
selectors.push(this.liquidateSeizedAssetsNoRevert.selector);
15+
selectors.push(this.liquidateRepaidSharesNoRevert.selector);
16+
selectors.push(this.setFeeNoRevert.selector);
17+
selectors.push(this.setPrice.selector);
18+
selectors.push(this.mine.selector);
1919

2020
super.setUp();
2121
}

0 commit comments

Comments
 (0)