pub struct ProposalWindow(pub BlockNumber, pub BlockNumber);
Expand description
The struct represent CKB two-step-transaction-confirmation params
two-step-transaction-confirmation params
The ProposalWindow
consists of two fields:
self.0, aka w_close, self.1, aka w_far
w_close and w_far define the closest and farthest on-chain distance between a transaction’s proposal and commitment.
Tuple Fields§
§0: BlockNumber
§1: BlockNumber
Implementations§
Source§impl ProposalWindow
impl ProposalWindow
Two protocol parameters w_close and w_far define the closest and farthest on-chain distance between a transaction’s proposal and commitment.
A non-cellbase transaction is committed at height h_c if all of the following conditions are met:
- it is proposed at height h_p of the same chain, where w_close <= h_c − h_p <= w_far ;
- it is in the commitment zone of the main chain block with height h_c ;
ProposalWindow (2, 10)
propose
\
\
13 14 [15 16 17 18 19 20 21 22 23]
\_______________________/
\
commit
Sourcepub fn closest(&self) -> BlockNumber
pub fn closest(&self) -> BlockNumber
The w_close parameter
Sourcepub fn farthest(&self) -> BlockNumber
pub fn farthest(&self) -> BlockNumber
The w_far parameter
Sourcepub fn length(&self) -> BlockNumber
pub fn length(&self) -> BlockNumber
The proposal window length
Trait Implementations§
Source§impl Clone for ProposalWindow
impl Clone for ProposalWindow
Source§fn clone(&self) -> ProposalWindow
fn clone(&self) -> ProposalWindow
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ProposalWindow
impl Debug for ProposalWindow
Source§impl PartialEq for ProposalWindow
impl PartialEq for ProposalWindow
impl Copy for ProposalWindow
impl Eq for ProposalWindow
impl StructuralPartialEq for ProposalWindow
Auto Trait Implementations§
impl Freeze for ProposalWindow
impl RefUnwindSafe for ProposalWindow
impl Send for ProposalWindow
impl Sync for ProposalWindow
impl Unpin for ProposalWindow
impl UnwindSafe for ProposalWindow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more