Skip to content

Commit

Permalink
test: add missing functions in MockStETH
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Jun 17, 2024
1 parent bba62c2 commit df86c86
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions test/mocks/MockStETH.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol";
import {IStETH} from "pendle/interfaces/IStETH.sol";

contract MockStETH is MockERC20, IStETH {
uint256 public total;

constructor() MockERC20("stETH", "stETH", 18) {}

function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256) {
Expand All @@ -15,13 +17,25 @@ contract MockStETH is MockERC20, IStETH {
return _sharesAmount;
}

function submit(address referral) external payable returns (uint256 amount) {}
function submit(address referral) external payable returns (uint256 amount) {
mint(msg.sender, msg.value);
total += msg.value;
return msg.value;
}

function burnShares(address _account, uint256 _sharesAmount) external returns (uint256 newTotalShares) {}
function burnShares(address _account, uint256 _sharesAmount) external returns (uint256 newTotalShares) {
revert("not implemented");
}

function sharesOf(address account) external view returns (uint256) {}
function sharesOf(address account) external view returns (uint256) {
revert("not implemented");
}

function getTotalShares() external view returns (uint256) {}
function getTotalShares() external view returns (uint256) {
return total;
}

function getTotalPooledEther() external view returns (uint256) {}
function getTotalPooledEther() external view returns (uint256) {
return total;
}
}

0 comments on commit df86c86

Please sign in to comment.