2024-10-03 11:01:21 +10:00
|
|
|
// SPDX-License-Identifier: MIT
|
2025-01-13 11:24:26 +01:00
|
|
|
pragma solidity ^0.8.28;
|
2024-10-03 11:01:21 +10:00
|
|
|
|
|
|
|
|
import "./SlotReservations.sol";
|
|
|
|
|
|
|
|
|
|
contract TestSlotReservations is SlotReservations {
|
|
|
|
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
|
|
|
|
2024-10-30 15:48:37 +11:00
|
|
|
mapping(SlotId => SlotState) private _states;
|
|
|
|
|
|
2025-06-19 13:04:24 +02:00
|
|
|
function initialize (
|
|
|
|
|
SlotReservationsConfig memory config
|
|
|
|
|
) public initializer {
|
|
|
|
|
_initializeSlotReservations(config);
|
|
|
|
|
}
|
2024-10-03 11:01:21 +10:00
|
|
|
function contains(SlotId slotId, address host) public view returns (bool) {
|
|
|
|
|
return _reservations[slotId].contains(host);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function length(SlotId slotId) public view returns (uint256) {
|
|
|
|
|
return _reservations[slotId].length();
|
|
|
|
|
}
|
2024-10-30 15:48:37 +11:00
|
|
|
|
2025-05-15 11:37:50 +10:00
|
|
|
function slotState(SlotId slotId) public view override returns (SlotState) {
|
|
|
|
|
return _states[slotId];
|
2024-10-30 15:48:37 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setSlotState(SlotId id, SlotState state) public {
|
|
|
|
|
_states[id] = state;
|
|
|
|
|
}
|
2024-10-03 11:01:21 +10:00
|
|
|
}
|