Add proof probability to Request

This commit is contained in:
Mark Spanbroek 2022-03-03 08:11:20 +01:00 committed by markspanbroek
parent 036a214427
commit ee4683e50c
3 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,7 @@ contract Marketplace is Collateral {
uint256 duration;
uint256 size;
bytes32 contentHash;
uint256 proofProbability;
uint256 maxPrice;
uint256 expiry;
bytes32 nonce;

View File

@ -7,6 +7,7 @@ const exampleRequest = () => ({
duration: 150, // 150 blocks ≈ half an hour
size: 1 * 1024 * 1024 * 1024, // 1 Gigabyte
contentHash: sha256("0xdeadbeef"),
proofProbability: 5, // require a proof roughly once every 5^2 periods
maxPrice: 84,
expiry: now() + hours(1),
nonce: hexlify(randomBytes(32)),

View File

@ -11,6 +11,7 @@ function requestId(request) {
"bytes32",
"uint256",
"uint256",
"uint256",
"bytes32",
],
requestToArray(request)
@ -33,6 +34,7 @@ function requestToArray(request) {
request.duration,
request.size,
request.contentHash,
request.proofProbability,
request.maxPrice,
request.expiry,
request.nonce,