2022-09-08 17:56:01 +10:00
|
|
|
// SPDX-License-Identifier: MIT
|
2025-01-13 11:24:26 +01:00
|
|
|
pragma solidity ^0.8.28;
|
2022-09-08 17:56:01 +10:00
|
|
|
|
|
|
|
|
import "./Marketplace.sol";
|
|
|
|
|
|
|
|
|
|
// exposes internal functions of Marketplace for testing
|
|
|
|
|
contract TestMarketplace is Marketplace {
|
2025-02-27 08:23:56 +01:00
|
|
|
using VaultHelpers for RequestId;
|
|
|
|
|
using VaultHelpers for Vault;
|
|
|
|
|
|
2022-09-08 17:56:01 +10:00
|
|
|
constructor(
|
2024-01-05 12:27:53 +01:00
|
|
|
MarketplaceConfig memory config,
|
2025-02-24 17:11:00 +01:00
|
|
|
Vault vault,
|
2024-01-23 13:28:53 +01:00
|
|
|
IGroth16Verifier verifier
|
2025-02-25 11:03:06 +01:00
|
|
|
) Marketplace(config, vault, verifier) {}
|
2022-09-08 17:56:01 +10:00
|
|
|
|
2022-11-23 15:10:58 +01:00
|
|
|
function forciblyFreeSlot(SlotId slotId) public {
|
|
|
|
|
_forciblyFreeSlot(slotId);
|
2022-09-13 17:18:55 +10:00
|
|
|
}
|
2023-03-08 12:02:34 +01:00
|
|
|
|
2025-02-27 08:23:56 +01:00
|
|
|
function getSlotBalance(SlotId slotId) public view returns (uint256) {
|
|
|
|
|
Slot storage slot = _slots[slotId];
|
|
|
|
|
FundId fund = slot.requestId.asFundId();
|
|
|
|
|
AccountId account = vault().hostAccount(slot.host, slot.slotIndex);
|
|
|
|
|
return vault().getBalance(fund, account);
|
2023-03-08 12:02:34 +01:00
|
|
|
}
|
2024-01-22 16:43:03 +01:00
|
|
|
|
|
|
|
|
function challengeToFieldElement(
|
|
|
|
|
bytes32 challenge
|
|
|
|
|
) public pure returns (uint256) {
|
|
|
|
|
return _challengeToFieldElement(challenge);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function merkleRootToFieldElement(
|
|
|
|
|
bytes32 merkleRoot
|
|
|
|
|
) public pure returns (uint256) {
|
|
|
|
|
return _merkleRootToFieldElement(merkleRoot);
|
|
|
|
|
}
|
2022-09-21 19:13:12 +10:00
|
|
|
}
|