[Storage] Move submitProof() to Proofs

This commit is contained in:
Mark Spanbroek 2023-01-09 15:19:00 +01:00 committed by markspanbroek
parent 31d109f0d3
commit 39da450c2a
4 changed files with 2 additions and 10 deletions

View File

@ -89,7 +89,7 @@ contract Marketplace is Collateral, Proofs {
require(balanceOf(msg.sender) >= collateral, "Insufficient collateral");
_expectProofs(slotId, requestId, request.ask.proofProbability);
_submitProof(slotId, proof);
submitProof(slotId, proof);
slot.host = msg.sender;
slot.requestId = requestId;

View File

@ -161,7 +161,7 @@ contract Proofs {
return isRequired && pointer < downtime;
}
function _submitProof(SlotId id, bytes calldata proof) internal {
function submitProof(SlotId id, bytes calldata proof) public {
require(proof.length > 0, "Invalid proof"); // TODO: replace by actual check
require(!received[id][currentPeriod()], "Proof already submitted");
received[id][currentPeriod()] = true;

View File

@ -35,10 +35,6 @@ contract Storage is Marketplace {
minCollateralThreshold = _minCollateralThreshold;
}
function submitProof(SlotId slotId, bytes calldata proof) public {
_submitProof(slotId, proof);
}
function markProofAsMissing(SlotId slotId, uint256 period)
public
slotMustAcceptProofs(slotId)

View File

@ -56,10 +56,6 @@ contract TestProofs is Proofs {
return _getPointer(id);
}
function submitProof(SlotId id, bytes calldata proof) public {
_submitProof(id, proof);
}
function markProofAsMissing(SlotId id, uint256 _period) public {
_markProofAsMissing(id, _period);
}