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

View File

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

View File

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

View File

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