[Storage] Move submitProof() to Proofs
This commit is contained in:
parent
31d109f0d3
commit
39da450c2a
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue