Skip to content

Commit 9cc32ab

Browse files
committed
chore: renaming fixes
1 parent 8c3ba7c commit 9cc32ab

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

test/invariant/DiscoveryInvariant.t.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ contract DiscoveryInvariantTest is DiscoveryTestBase {
2929

3030
// ============ Invariant Tests ============
3131

32-
/// @notice Discovery contract should never hold ETH — all forwarded to CollateralManagement
33-
function invariant_DiscoveryHoldsNoETH() public view {
32+
/// @notice Discovery contract should never hold RBTC — all forwarded to CollateralManagement
33+
function invariant_DiscoveryHoldsNoRBTC() public view {
3434
assertEq(
3535
address(discovery).balance,
3636
0,
37-
"INVARIANT VIOLATED: Discovery holds ETH"
37+
"INVARIANT VIOLATED: Discovery holds RBTC"
3838
);
3939
}
4040

test/invariant/SystemInvariant.t.sol

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ contract SystemInvariantTest is Test {
131131
);
132132
}
133133

134-
/// @notice Discovery contract should never hold ETH
135-
function invariant_DiscoveryHoldsNoETH() public view {
134+
/// @notice Discovery contract should never hold RBTC
135+
function invariant_DiscoveryHoldsNoRBTC() public view {
136136
assertEq(
137137
address(discovery).balance,
138138
0,
139-
"INVARIANT VIOLATED: Discovery holds ETH"
139+
"INVARIANT VIOLATED: Discovery holds RBTC"
140140
);
141141
}
142142

@@ -200,54 +200,54 @@ contract SystemInvariantTest is Test {
200200
}
201201
}
202202

203-
/// @notice No individual value should exceed the total ETH injected into the system
203+
/// @notice No individual value should exceed the total RBTC injected into the system
204204
function invariant_NoUnderflowAnywhere() public view {
205-
uint256 totalETHIn = handler.ghost_totalETHIn();
205+
uint256 totalRBTCIn = handler.ghost_totalRBTCIn();
206206
uint256 count = handler.getProviderCount();
207207
for (uint256 i = 0; i < count; i++) {
208208
address addr = handler.getProviderAddr(i);
209209
assertLe(
210210
collateralManagement.getPegInCollateral(addr),
211-
totalETHIn,
212-
"PegIn collateral exceeds total ETH in"
211+
totalRBTCIn,
212+
"PegIn collateral exceeds total RBTC in"
213213
);
214214
assertLe(
215215
collateralManagement.getPegOutCollateral(addr),
216-
totalETHIn,
217-
"PegOut collateral exceeds total ETH in"
216+
totalRBTCIn,
217+
"PegOut collateral exceeds total RBTC in"
218218
);
219219
assertLe(
220220
pegInContract.getBalance(addr),
221-
totalETHIn,
222-
"PegIn balance exceeds total ETH in"
221+
totalRBTCIn,
222+
"PegIn balance exceeds total RBTC in"
223223
);
224224
assertLe(
225225
pegOutContract.getBalance(addr),
226-
totalETHIn,
227-
"PegOut balance exceeds total ETH in"
226+
totalRBTCIn,
227+
"PegOut balance exceeds total RBTC in"
228228
);
229229
}
230230
assertLe(
231231
address(collateralManagement).balance,
232-
totalETHIn,
233-
"CM balance exceeds total ETH in"
232+
totalRBTCIn,
233+
"CM balance exceeds total RBTC in"
234234
);
235235
assertLe(
236236
address(pegInContract).balance,
237-
totalETHIn,
238-
"PegIn contract balance exceeds total ETH in"
237+
totalRBTCIn,
238+
"PegIn contract balance exceeds total RBTC in"
239239
);
240240
assertLe(
241241
address(pegOutContract).balance,
242-
totalETHIn,
243-
"PegOut contract balance exceeds total ETH in"
242+
totalRBTCIn,
243+
"PegOut contract balance exceeds total RBTC in"
244244
);
245245
}
246246

247-
/// @notice Total ETH across all contracts should not exceed total ETH injected
247+
/// @notice Total RBTC across all contracts should not exceed total RBTC injected
248248
function invariant_GlobalConservation() public view {
249-
uint256 totalETHIn = handler.ghost_totalETHIn();
250-
if (totalETHIn == 0) return;
249+
uint256 totalRBTCIn = handler.ghost_totalRBTCIn();
250+
if (totalRBTCIn == 0) return;
251251

252252
uint256 systemBalance = address(collateralManagement).balance +
253253
address(pegInContract).balance +
@@ -256,8 +256,8 @@ contract SystemInvariantTest is Test {
256256

257257
assertLe(
258258
systemBalance,
259-
totalETHIn,
260-
"INVARIANT VIOLATED: System has more ETH than was injected"
259+
totalRBTCIn,
260+
"INVARIANT VIOLATED: System has more RBTC than was injected"
261261
);
262262
}
263263

@@ -295,7 +295,7 @@ contract SystemInvariantTest is Test {
295295
"Collateral withdrawn:",
296296
handler.ghost_totalCollateralWithdrawn()
297297
);
298-
console.log("Total ETH in:", handler.ghost_totalETHIn());
298+
console.log("Total RBTC in:", handler.ghost_totalRBTCIn());
299299
console.log("CM balance:", address(collateralManagement).balance);
300300
console.log("PegIn balance:", address(pegInContract).balance);
301301
console.log("PegOut balance:", address(pegOutContract).balance);

test/invariant/handlers/SystemHandler.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ contract SystemHandler is HandlerBase {
3939
uint256 public ghost_totalPegOutRefunded;
4040
uint256 public ghost_totalPegOutWithdrawn;
4141
uint256 public ghost_totalRewardsWithdrawn;
42-
uint256 public ghost_totalETHIn;
42+
uint256 public ghost_totalRBTCIn;
4343

4444
uint256 private _nonce;
4545

@@ -119,7 +119,7 @@ contract SystemHandler is HandlerBase {
119119
})
120120
);
121121
ghost_totalCollateralAdded += collateral;
122-
ghost_totalETHIn += collateral;
122+
ghost_totalRBTCIn += collateral;
123123
} catch {}
124124
}
125125

@@ -145,7 +145,7 @@ contract SystemHandler is HandlerBase {
145145
)
146146
{
147147
ghost_totalCollateralAdded += amount;
148-
ghost_totalETHIn += amount;
148+
ghost_totalRBTCIn += amount;
149149
} catch {}
150150
} else {
151151
try
@@ -154,7 +154,7 @@ contract SystemHandler is HandlerBase {
154154
)
155155
{
156156
ghost_totalCollateralAdded += amount;
157-
ghost_totalETHIn += amount;
157+
ghost_totalRBTCIn += amount;
158158
} catch {}
159159
}
160160
}
@@ -169,7 +169,7 @@ contract SystemHandler is HandlerBase {
169169
vm.prank(info.addr);
170170
try pegInContract.deposit{value: amount}() {
171171
ghost_totalPegInDeposited += amount;
172-
ghost_totalETHIn += amount;
172+
ghost_totalRBTCIn += amount;
173173
} catch {}
174174
}
175175

@@ -229,7 +229,7 @@ contract SystemHandler is HandlerBase {
229229
);
230230

231231
ghost_totalPegOutDeposited += totalValue;
232-
ghost_totalETHIn += totalValue;
232+
ghost_totalRBTCIn += totalValue;
233233

234234
bytes32 quoteHash = pegOutContract.hashPegOutQuote(_staged);
235235
_pruneCompletedQuotes(8);

0 commit comments

Comments
 (0)