all files / contracts/mocks/ MockSCPRetainer.sol

100% Statements 2/2
100% Branches 0/0
100% Functions 2/2
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                        21×                 30×      
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
 
import "../interfaces/payment/ISCPRetainer.sol";
 
/**
 * @title Mock Solace Cover Points Retainer
 * @author solace.fi
 * @notice An implementation of SCPRetainer built for testing.
 */
contract MockSCPRetainer is ISCPRetainer {
 
    mapping(address => uint256) private _req;
 
    /**
     * @notice Sets the minimum amount of Solace Cover Points required by this contract for the account to hold.
     * @param account Account to query.
     * @param amount The amount of SCP the account must hold.
     */
    function setMinScpRequired(address account, uint256 amount) external {
        _req[account] = amount;
    }
 
    /**
     * @notice Calculates the minimum amount of Solace Cover Points required by this contract for the account to hold.
     * @param account Account to query.
     * @return amount The amount of SCP the account must hold.
     */
    function minScpRequired(address account) external view override returns (uint256 amount) {
        return _req[account];
    }
}