Skip to content

Commit 684c758

Browse files
committed
upgrade storage test
1 parent 5b95c0e commit 684c758

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
pragma solidity ^0.8.27;
3+
4+
import "src/test/integration/UpgradeTest.t.sol";
5+
6+
/**
7+
* @title AllocationManagerUpgrade
8+
* @notice Upgrade test for AllocationManager that verifies state consistency across upgrades
9+
*/
10+
contract Integration_Upgrade_AllocationManager is UpgradeTest {
11+
using ArrayLib for *;
12+
using StdStyle for *;
13+
14+
function test_AllocationManagerUpgrade_StateConsistency() public {
15+
console.log("Testing AllocationManager upgrade...".green());
16+
17+
// Test basic AllocationManager functionality before upgrade
18+
console.log("Pre-upgrade: Testing basic functionality...".green());
19+
20+
// Just test that we can read basic AllocationManager state
21+
uint32 deallocationDelay = allocationManager.DEALLOCATION_DELAY();
22+
uint32 allocationConfigDelay = allocationManager.ALLOCATION_CONFIGURATION_DELAY();
23+
24+
console.log("Pre-upgrade: DEALLOCATION_DELAY = %d", deallocationDelay);
25+
console.log("Pre-upgrade: ALLOCATION_CONFIGURATION_DELAY = %d", allocationConfigDelay);
26+
27+
// Perform upgrade
28+
console.log("Performing upgrade...".green());
29+
_upgradeEigenLayerContracts();
30+
console.log("Upgrade completed".green());
31+
32+
// Test basic functionality after upgrade
33+
console.log("Post-upgrade: Testing basic functionality...".green());
34+
35+
// Verify the same values are still there
36+
uint32 deallocationDelayAfter = allocationManager.DEALLOCATION_DELAY();
37+
uint32 allocationConfigDelayAfter = allocationManager.ALLOCATION_CONFIGURATION_DELAY();
38+
39+
console.log("Post-upgrade: DEALLOCATION_DELAY = %d", deallocationDelayAfter);
40+
console.log("Post-upgrade: ALLOCATION_CONFIGURATION_DELAY = %d", allocationConfigDelayAfter);
41+
42+
// Verify they're the same
43+
assertEq(deallocationDelay, deallocationDelayAfter, "DEALLOCATION_DELAY should be the same after upgrade");
44+
assertEq(allocationConfigDelay, allocationConfigDelayAfter, "ALLOCATION_CONFIGURATION_DELAY should be the same after upgrade");
45+
46+
console.log("AllocationManager upgrade test passed!".green().bold());
47+
}
48+
}

0 commit comments

Comments
 (0)