RequestLockLibrary
State Variables
PROVER_PAID_DURING_LOCK_FLAG
uint8 internal constant PROVER_PAID_DURING_LOCK_FLAG = 1 << 0;
PROVER_PAID_AFTER_LOCK_FLAG
uint8 internal constant PROVER_PAID_AFTER_LOCK_FLAG = 1 << 1;
SLASHED_FLAG
uint8 internal constant SLASHED_FLAG = 1 << 2;
Functions
deadline
Calculates the deadline for the locked request.
function deadline(RequestLock memory requestLock) internal pure returns (uint64);
Name | Type | Description |
---|---|---|
requestLock | RequestLock | The request lock to calculate the deadline for. |
Name | Type | Description |
---|---|---|
<none> | uint64 | The deadline for the request. |
setProverPaidBeforeLockDeadline
function setProverPaidBeforeLockDeadline(RequestLock storage requestLock) internal;
setProverPaidAfterLockDeadline
function setProverPaidAfterLockDeadline(RequestLock storage requestLock, address prover) internal;
setSlashed
function setSlashed(RequestLock storage requestLock) internal;
isProverPaidBeforeLockDeadline
Returns true if the request was fulfilled by the locker before the lock deadline and they have been paid.
function isProverPaidBeforeLockDeadline(RequestLock memory requestLock) internal pure returns (bool);
Name | Type | Description |
---|---|---|
requestLock | RequestLock | The request lock to check. |
Name | Type | Description |
---|---|---|
<none> | bool | True if the request was fulfilled before the lock deadline and the prover was paid, false otherwise. |
isProverPaidAfterLockDeadline
Checks if the request was fulfilled by any prover after the lock deadline.
function isProverPaidAfterLockDeadline(RequestLock memory requestLock) internal pure returns (bool);
Name | Type | Description |
---|---|---|
requestLock | RequestLock | The request lock to check. |
Name | Type | Description |
---|---|---|
<none> | bool | True if the request is fulfilled after the lock deadline and the prover was paid, false otherwise. |
isProverPaid
Checks if the locked request was fulfilled and a prover was paid. The prover paid could be the prover that locked, or a prover that filled after the lock deadline.
function isProverPaid(RequestLock memory requestLock) internal pure returns (bool);
Name | Type | Description |
---|---|---|
requestLock | RequestLock | The request lock to check. |
Name | Type | Description |
---|---|---|
<none> | bool | True if the request is fulfilled after the lock deadline, false otherwise. |
isSlashed
Checks if the request was slashed.
Whether a request resulted in a slash does not indicate whether the request was fulfilled since it is possible for a request to be fulfilled after a request lock has expired.
function isSlashed(RequestLock memory requestLock) internal pure returns (bool);
Name | Type | Description |
---|---|---|
requestLock | RequestLock | The request lock to check. |
Name | Type | Description |
---|---|---|
<none> | bool | True if the request is slashed, false otherwise. |
clearSlot2
function clearSlot2(RequestLock storage requestLock) private;
clearSlot1And2
function clearSlot1And2(RequestLock storage requestLock) private;