Skip to content

Commit

Permalink
fix: updated echidna test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohsen-T committed Mar 18, 2024
1 parent 8dfb5d7 commit 8e632ba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .echidna.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function getBrewPrefixPath() {
console.log(`Homebrew prefix path: ${stdout.trim()}`);
fuzzTestByEchidna(stdout.trim());
} catch (error) {
console.error(`Error: ${error}`);
console.error(`Please install brew and echidna.`);
}
}

Expand Down
40 changes: 20 additions & 20 deletions contracts/echidna/Clusters.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,26 @@ contract Clusters is SSVClusters {
}
}

// function check_bulkRegisterValidator(uint256 amount) public {
// bytes[] memory publicKey = new bytes[](4);
// bytes[] memory sharesData = new bytes[](4);
// for (uint256 i; i < publicKey.length; i++) {
// publicKey[i] = EchidnaLib.generatePublicKey(sault++);
// }
// Cluster memory cluster;
// cluster.active = true;

// uint256 minLiquidationCollateral = SSVStorageProtocol.load().minimumLiquidationCollateral.expand();
// require(amount > minLiquidationCollateral, "InsufficientBalance");

// try this.bulkRegisterValidator(publicKey, opIds, sharesData, amount, cluster) {
// for (uint256 i; i < publicKey.length; i++) {
// publicKeys.push(publicKey[i]);
// }
// } catch {
// assert(false);
// }
// }
function check_bulkRegisterValidator(uint256 amount) public {

Check warning on line 97 in contracts/echidna/Clusters.sol

View workflow job for this annotation

GitHub Actions / ci

Function name must be in mixedCase
bytes[] memory publicKey = new bytes[](4);
bytes[] memory sharesData = new bytes[](4);
for (uint256 i; i < publicKey.length; i++) {
publicKey[i] = EchidnaLib.generatePublicKey(sault++);
}
Cluster memory cluster;
cluster.active = true;

uint256 minLiquidationCollateral = SSVStorageProtocol.load().minimumLiquidationCollateral.expand();
require(amount > minLiquidationCollateral, "InsufficientBalance");

try this.bulkRegisterValidator(publicKey, opIds, sharesData, amount, cluster) {
for (uint256 i; i < publicKey.length; i++) {
publicKeys.push(publicKey[i]);
}
} catch {
assert(false);
}
}

function check_validRegisteredOperators() public {

Check warning on line 118 in contracts/echidna/Clusters.sol

View workflow job for this annotation

GitHub Actions / ci

Function name must be in mixedCase
assert(opIds.length == MAX_OPERATORS_LENGTH);
Expand Down

0 comments on commit 8e632ba

Please sign in to comment.