Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marked MockTBTCVault functions virtual #785

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion solidity/contracts/integrator/AbstractTBTCDepositor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ abstract contract AbstractTBTCDepositor {
}

/// @notice Finalizes a deposit by calculating the amount of TBTC minted
/// for the deposit
/// for the deposit.
/// @param depositKey Deposit key identifying the deposit.
/// @return initialDepositAmount Amount of funding transaction deposit. In
/// TBTC token decimals precision.
Expand Down
15 changes: 13 additions & 2 deletions solidity/contracts/test/TestTBTCDepositor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import "../integrator/AbstractTBTCDepositor.sol";
import "../integrator/IBridge.sol";
import "../integrator/ITBTCVault.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract TestTBTCDepositor is AbstractTBTCDepositor {
event InitializeDepositReturned(uint256 depositKey);

Expand Down Expand Up @@ -168,7 +170,10 @@ contract MockTBTCVault is ITBTCVault {
return (request.requestedAt, request.finalizedAt);
}

function createOptimisticMintingRequest(uint256 depositKey) external {
/// @dev The function is virtual to allow other projects using this mock
/// for AbtractTBTCDepositor-based contract tests to add any custom
/// logic needed.
function createOptimisticMintingRequest(uint256 depositKey) public virtual {
require(
_requests[depositKey].requestedAt == 0,
"Request already exists"
Expand All @@ -177,7 +182,13 @@ contract MockTBTCVault is ITBTCVault {
_requests[depositKey].requestedAt = uint64(block.timestamp);
}

function finalizeOptimisticMintingRequest(uint256 depositKey) public {
/// @dev The function is virtual to allow other projects using this mock
/// for AbtractTBTCDepositor-based contract tests to add any custom
/// logic needed.
function finalizeOptimisticMintingRequest(uint256 depositKey)
public
virtual
{
require(
_requests[depositKey].requestedAt != 0,
"Request does not exist"
Expand Down
Loading