Skip to content

Commit 206953c

Browse files
h4x3rotabclaude
andcommitted
fix: add view modifier to pure assertion test functions
- Add view modifier to test_Initialize() in DstackApp.t.sol - Add view modifier to test_SupportsInterface() in DstackApp.t.sol - Add view modifier to test_Initialize() in DstackKms.t.sol - Add view modifier to test_SupportsInterface() in DstackKms.t.sol This resolves Solidity compiler warnings about function state mutability and makes the code more explicit about which test functions only read state. 🤖 Generated with [Claude Code](https://claude.ai/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 7dcdf7c commit 206953c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

kms/auth-eth/test/DstackApp.t.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ contract DstackAppTest is Test {
3838
vm.stopPrank();
3939
}
4040

41-
function test_Initialize() public {
41+
function test_Initialize() public view {
4242
assertEq(app.owner(), owner);
4343
assertFalse(app.allowAnyDevice());
4444
}
@@ -225,10 +225,10 @@ contract DstackAppTest is Test {
225225
}
226226

227227

228-
function test_SupportsInterface() public {
228+
function test_SupportsInterface() public view {
229229
// Test IAppAuth interface
230230
assertTrue(app.supportsInterface(0x1e079198));
231-
231+
232232
// Test IAppAuthBasicManagement interface
233233
assertTrue(app.supportsInterface(0x8fd37527));
234234

kms/auth-eth/test/DstackKms.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ contract DstackKmsTest is Test {
4141
vm.stopPrank();
4242
}
4343

44-
function test_Initialize() public {
44+
function test_Initialize() public view {
4545
assertEq(kms.owner(), owner);
4646
assertEq(kms.appImplementation(), address(appImpl));
4747
}
@@ -293,13 +293,13 @@ contract DstackKmsTest is Test {
293293
assertEq(kms.appImplementation(), address(newImpl));
294294
}
295295

296-
function test_SupportsInterface() public {
296+
function test_SupportsInterface() public view {
297297
// Test IAppAuth interface
298298
assertTrue(kms.supportsInterface(0x1e079198));
299-
299+
300300
// Test IERC165 interface
301301
assertTrue(kms.supportsInterface(0x01ffc9a7));
302-
302+
303303
// Test invalid interface
304304
assertFalse(kms.supportsInterface(0x12345678));
305305
}

0 commit comments

Comments
 (0)