pub struct TimeoutPolicy { /* private fields */ }Expand description
Timeout policy. Safety rule: the EVM lock (the maker’s money) must expire well before the Zcash refund height (the taker’s money), so whoever learns the secret always has time to use it on the other chain.
The fields are private: a policy comes from MAINNET_POLICY, DEVNET_POLICY or TimeoutPolicy::new, which
validates it (assertValidPolicy), so every TimeoutPolicy is coherent and the window rule can’t be weakened by
a zero, negative, NaN or below-1 safety factor.
Implementations§
Source§impl TimeoutPolicy
impl TimeoutPolicy
Sourcepub fn new(params: TimeoutPolicyParams) -> Result<Self, ParalockError>
pub fn new(params: TimeoutPolicyParams) -> Result<Self, ParalockError>
A validated policy (assertValidPolicy): the four integers must be positive safe integers, safety_factor ≥ 1
(not NaN), and the policy’s own windows must pass the window rule. Fails with unsafe_timeouts and the
reference’s messages.
Sourcepub const fn zcash_lock_blocks(&self) -> u64
pub const fn zcash_lock_blocks(&self) -> u64
Blocks between funding and the taker’s Zcash refund height.
Sourcepub const fn evm_lock_seconds(&self) -> u64
pub const fn evm_lock_seconds(&self) -> u64
Seconds the maker’s EVM lock stays claimable by the taker.
Sourcepub const fn zcash_block_seconds(&self) -> u64
pub const fn zcash_block_seconds(&self) -> u64
Expected Zcash block interval, in seconds.
Sourcepub const fn min_zcash_confirmations(&self) -> u64
pub const fn min_zcash_confirmations(&self) -> u64
Confirmations the maker waits for on the Zcash funding transaction (and on its own claim).
Sourcepub const fn safety_factor(&self) -> f64
pub const fn safety_factor(&self) -> f64
The required ratio of remaining Zcash time to EVM lock time (≥ 1).
Sourcepub const fn params(&self) -> TimeoutPolicyParams
pub const fn params(&self) -> TimeoutPolicyParams
The policy’s values.