contract SkipStressTestStorage is DeployHelper, SigningUtils
This contract inherits from DeployHelper
and SigningUtils
, indicating it uses helper functions for deployment and signing operations.
function setUp() public {
deployAllContractsStressTest(500000);
}
This function sets up the testing environment by deploying all necessary contracts with a parameter of 500000.
function testAddSubSafe() public
Purpose: Verifies the basic functionality of adding a subSafe to an existing Safe.
Steps:
- Sets up a root organization and one Safe.
- Creates a new Safe.
- Adds the new Safe as a subSafe to the existing Safe.
- Verifies the hierarchical relationships using
isTreeMember
andisSuperSafe
functions.
function testAddSubSafeLinealSecuenceMaxLevel() public
Purpose: Stress tests the addition of subSafes in a linear sequence up to the maximum depth limit.
Steps:
- Sets up a root organization and one Safe.
- Creates arrays to store 8100 subSafe addresses and IDs.
- Updates the depth tree limit to 8102.
- Iteratively creates and adds subSafes, each being a child of the previous one.
- Verifies the hierarchical relationships for each new Safe.
function testAddThreeSubSafeLinealSecuenceMaxLevel() public
Purpose: Tests adding three subSafes at each level in a hierarchical structure.
Steps:
- Creates a new organization Safe.
- Calls
createTreeStressTest
to build a tree with 3 subSafes per level, up to 30000 Safes. - Removes the entire tree structure.
function testAddFourthSubSafeLinealSecuenceMaxLevel() public
Purpose: Similar to the previous test, but with four subSafes at each level.
Steps:
- Creates a new organization Safe.
- Calls
createTreeStressTest
to build a tree with 4 subSafes per level, up to 22000 Safes.
function testAddFifthSubSafeLinealSecuenceMaxLevel() public
Purpose: Tests adding five subSafes at each level in the hierarchy.
Steps:
- Creates a new organization Safe.
- Calls
createTreeStressTest
to build a tree with 5 subSafes per level, up to 20000 Safes.
function testSeveralsSmallOrgsSafeSecuenceMaxLevel() public
Purpose: Tests creating multiple small organizations with different structures.
Steps:
- Creates three separate organization Safes.
- Builds three different tree structures:
- One with 3 subSafes per level, up to 1100 Safes.
- One with 4 subSafes per level, up to 1400 Safes.
- One with 5 subSafes per level, up to 4000 Safes.
function testSeveralsBigOrgsSafeSecuenceMaxLevel() public
Purpose: Tests creating multiple large organizations with different structures.
Steps:
- Creates three separate organization Safes.
- Builds three different large tree structures:
- One with 3 subSafes per level, up to 30000 Safes.
- One with 4 subSafes per level, up to 22000 Safes.
- One with 5 subSafes per level, up to 20000 Safes.
function testFullOrgSafeSecuenceMaxLevel() public
Purpose: Tests creating a full organization with multiple root Safes and different structures.
Steps:
- Creates one organization Safe and two root Safes.
- Builds three different tree structures within the same organization:
- One with 3 subSafes per level, up to 30000 Safes.
- One with 4 subSafes per level, up to 22000 Safes.
- One with 5 subSafes per level, up to 20000 Safes.
This function is used by several test cases to create complex tree structures of Safes. It takes parameters for organization name, root Safe name, organization Safe address, root Safe address, number of members per Safe, and total number of Safe wallets to create.
These are utility functions used in calculations for the tree structure creation.
These stress tests thoroughly examine the Palmera Module's ability to handle complex hierarchical structures of Safes. They test the system's limits in terms of depth and breadth of the Safe hierarchy, as well as its performance under various organizational structures. The tests ensure that the module can correctly manage and verify relationships between Safes in large, complex organizations.