mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-02-16 08:37:13 +00:00
[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");
|
require(balanceOf(msg.sender) >= collateral, "Insufficient collateral");
|
||||||
|
|
||||||
_expectProofs(slotId, requestId, request.ask.proofProbability);
|
_expectProofs(slotId, requestId, request.ask.proofProbability);
|
||||||
_submitProof(slotId, proof);
|
submitProof(slotId, proof);
|
||||||
|
|
||||||
slot.host = msg.sender;
|
slot.host = msg.sender;
|
||||||
slot.requestId = requestId;
|
slot.requestId = requestId;
|
||||||
|
@ -161,7 +161,7 @@ contract Proofs {
|
|||||||
return isRequired && pointer < downtime;
|
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(proof.length > 0, "Invalid proof"); // TODO: replace by actual check
|
||||||
require(!received[id][currentPeriod()], "Proof already submitted");
|
require(!received[id][currentPeriod()], "Proof already submitted");
|
||||||
received[id][currentPeriod()] = true;
|
received[id][currentPeriod()] = true;
|
||||||
|
@ -35,10 +35,6 @@ contract Storage is Marketplace {
|
|||||||
minCollateralThreshold = _minCollateralThreshold;
|
minCollateralThreshold = _minCollateralThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitProof(SlotId slotId, bytes calldata proof) public {
|
|
||||||
_submitProof(slotId, proof);
|
|
||||||
}
|
|
||||||
|
|
||||||
function markProofAsMissing(SlotId slotId, uint256 period)
|
function markProofAsMissing(SlotId slotId, uint256 period)
|
||||||
public
|
public
|
||||||
slotMustAcceptProofs(slotId)
|
slotMustAcceptProofs(slotId)
|
||||||
|
@ -56,10 +56,6 @@ contract TestProofs is Proofs {
|
|||||||
return _getPointer(id);
|
return _getPointer(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitProof(SlotId id, bytes calldata proof) public {
|
|
||||||
_submitProof(id, proof);
|
|
||||||
}
|
|
||||||
|
|
||||||
function markProofAsMissing(SlotId id, uint256 _period) public {
|
function markProofAsMissing(SlotId id, uint256 _period) public {
|
||||||
_markProofAsMissing(id, _period);
|
_markProofAsMissing(id, _period);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user