Struct ckb_script::TxVerifyEnv
source · [−]pub struct TxVerifyEnv { /* private fields */ }
Expand description
The environment that transactions are in.
Implementations
sourceimpl TxVerifyEnv
impl TxVerifyEnv
sourcepub fn new_submit(header: &HeaderView) -> Self
pub fn new_submit(header: &HeaderView) -> Self
The transaction has just been submitted.
The input is current tip header.
sourcepub fn new_proposed(header: &HeaderView, n_blocks: BlockNumber) -> Self
pub fn new_proposed(header: &HeaderView, n_blocks: BlockNumber) -> Self
The transaction has already been proposed before several blocks.
The input is current tip header and how many blocks have been passed since the transaction was proposed.
sourcepub fn new_commit(header: &HeaderView) -> Self
pub fn new_commit(header: &HeaderView) -> Self
The transaction will committed in current block.
The input is current tip header.
sourcepub fn block_number(&self, proposal_window: ProposalWindow) -> BlockNumber
pub fn block_number(&self, proposal_window: ProposalWindow) -> BlockNumber
The block number of the earliest block which the transaction will committed in.
sourcepub fn epoch_number(&self, proposal_window: ProposalWindow) -> EpochNumber
pub fn epoch_number(&self, proposal_window: ProposalWindow) -> EpochNumber
The epoch number of the earliest epoch which the transaction will committed in.
sourcepub fn parent_hash(&self) -> Byte32
pub fn parent_hash(&self) -> Byte32
The parent block hash of the earliest block which the transaction will committed in.
sourcepub fn epoch(&self) -> EpochNumberWithFraction
pub fn epoch(&self) -> EpochNumberWithFraction
The earliest epoch which the transaction will committed in.
sourcepub fn epoch_number_without_proposal_window(&self) -> EpochNumber
pub fn epoch_number_without_proposal_window(&self) -> EpochNumber
The epoch number of the earliest epoch which the transaction will committed in without consider about the proposal window.
Trait Implementations
sourceimpl Clone for TxVerifyEnv
impl Clone for TxVerifyEnv
sourcefn clone(&self) -> TxVerifyEnv
fn clone(&self) -> TxVerifyEnv
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for TxVerifyEnv
impl Send for TxVerifyEnv
impl Sync for TxVerifyEnv
impl Unpin for TxVerifyEnv
impl UnwindSafe for TxVerifyEnv
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more