Add expiry to storage requests

This commit is contained in:
Mark Spanbroek 2022-02-17 12:24:27 +01:00 committed by markspanbroek
parent 18e667bf19
commit 980e2343ed
3 changed files with 4 additions and 0 deletions

@ -51,6 +51,7 @@ contract Marketplace is Collateral {
uint256 proofPeriod; uint256 proofPeriod;
uint256 proofTimeout; uint256 proofTimeout;
uint256 maxPrice; uint256 maxPrice;
uint256 expiry;
bytes32 nonce; bytes32 nonce;
} }

@ -141,6 +141,7 @@ function requestId(request) {
"uint256", "uint256",
"uint256", "uint256",
"uint256", "uint256",
"uint256",
"bytes32", "bytes32",
], ],
requestToArray(request) requestToArray(request)
@ -166,6 +167,7 @@ function requestToArray(request) {
request.proofPeriod, request.proofPeriod,
request.proofTimeout, request.proofTimeout,
request.maxPrice, request.maxPrice,
request.expiry,
request.nonce, request.nonce,
] ]
} }

@ -10,6 +10,7 @@ const exampleRequest = () => ({
proofPeriod: 8, // 8 blocks ≈ 2 minutes proofPeriod: 8, // 8 blocks ≈ 2 minutes
proofTimeout: 4, // 4 blocks ≈ 1 minute proofTimeout: 4, // 4 blocks ≈ 1 minute
maxPrice: 42, maxPrice: 42,
expiry: now() + hours(1),
nonce: hexlify(randomBytes(32)), nonce: hexlify(randomBytes(32)),
}) })