Skip to content

Commit

Permalink
test(contracts): restore some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mempirate committed Oct 15, 2024
1 parent a10a15d commit 104b1e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
7 changes: 7 additions & 0 deletions bolt-contracts/src/contracts/BoltManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ contract BoltManager is IBoltManager, OwnableUpgradeable, UUPSUpgradeable {
return status;
}

/// @notice Get the amount staked by an operator for a given collateral asset.
function getOperatorStake(address operator, address collateral) public view returns (uint256) {
Operator memory operatorData = operators.get(operator);

return IBoltMiddleware(operatorData.middleware).getOperatorStake(operator, collateral);
}

/// @notice Get the total amount staked of a given collateral asset.
function getTotalStake(
address collateral
Expand Down
18 changes: 8 additions & 10 deletions bolt-contracts/test/BoltManager.EigenLayer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,14 @@ contract BoltManagerEigenLayerTest is Test {
manager.isOperatorEnabled(operator);
}

// TODO:
// function test_getEigenLayerOperatorStake() public {
// _eigenLayerOptInRoutine();

// uint256 amount = middleware.getOperatorStake(operator, address(eigenLayerDeployer.weth()));
// // TODO:
// uint256 totalStake = middleware.getTotalStake(2, address(eigenLayerDeployer.weth()));
// assertEq(amount, 1 ether);
// assertEq(totalStake, 1 ether);
// }
function testGetOperatorStake() public {
_eigenLayerOptInRoutine();

uint256 amount = middleware.getOperatorStake(operator, address(eigenLayerDeployer.weth()));
uint256 totalStake = manager.getTotalStake(address(eigenLayerDeployer.weth()));
assertEq(amount, 1 ether);
assertEq(totalStake, 1 ether);
}

function testProposerStatus() public {
_eigenLayerOptInRoutine();
Expand Down
5 changes: 0 additions & 5 deletions bolt-contracts/test/BoltManager.Symbiotic.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,6 @@ contract BoltManagerSymbioticTest is Test {
assertEq(vault.currentEpoch(), 2);

// it takes 2 epochs to activate the stake
// TODO:
// assertEq(middleware.getTotalStake(0, address(collateral)), 0);
// assertEq(middleware.getTotalStake(1, address(collateral)), 0);
// assertEq(middleware.getTotalStake(2, address(collateral)), 1 ether);

stakeFromDelegator = networkRestakeDelegator.stake(subnetwork, operator);
stakeFromMiddleware = middleware.getOperatorStake(operator, address(collateral));
assertEq(stakeFromDelegator, stakeFromMiddleware);
Expand Down

0 comments on commit 104b1e6

Please sign in to comment.