Struct miniscript::RelLockTime
source · pub struct RelLockTime(/* private fields */);
Expand description
A relative locktime which implements Ord
.
Implementations§
source§impl RelLockTime
impl RelLockTime
sourcepub fn from_consensus(n: u32) -> Result<Self, RelLockTimeError>
pub fn from_consensus(n: u32) -> Result<Self, RelLockTimeError>
Constructs an RelLockTime
from an nLockTime value or the argument to CHEKCLOCKTIMEVERIFY
.
sourcepub fn to_consensus_u32(self) -> u32
pub fn to_consensus_u32(self) -> u32
Returns the inner u32
value. This is the value used when creating this LockTime
i.e., n OP_CHECKSEQUENCEVERIFY
or nSequence
.
sourcepub fn from_height(height: u16) -> Self
pub fn from_height(height: u16) -> Self
Takes a 16-bit number of blocks and produces a relative locktime from it.
sourcepub fn from_512_second_intervals(time: u16) -> Self
pub fn from_512_second_intervals(time: u16) -> Self
Takes a 16-bit number of 512-second time intervals and produces a relative locktime from it.
sourcepub fn is_height_locked(&self) -> bool
pub fn is_height_locked(&self) -> bool
Whether this timelock is blockheight-based.
sourcepub fn is_time_locked(&self) -> bool
pub fn is_time_locked(&self) -> bool
Whether this timelock is time-based.
Trait Implementations§
source§impl Clone for RelLockTime
impl Clone for RelLockTime
source§fn clone(&self) -> RelLockTime
fn clone(&self) -> RelLockTime
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 RelLockTime
impl Debug for RelLockTime
source§impl Display for RelLockTime
impl Display for RelLockTime
source§impl From<RelLockTime> for LockTime
impl From<RelLockTime> for LockTime
source§fn from(lock_time: RelLockTime) -> LockTime
fn from(lock_time: RelLockTime) -> LockTime
Converts to this type from the input type.
source§impl From<RelLockTime> for Sequence
impl From<RelLockTime> for Sequence
source§fn from(lock_time: RelLockTime) -> Sequence
fn from(lock_time: RelLockTime) -> Sequence
Converts to this type from the input type.
source§impl Hash for RelLockTime
impl Hash for RelLockTime
source§impl Ord for RelLockTime
impl Ord for RelLockTime
source§impl PartialEq<RelLockTime> for RelLockTime
impl PartialEq<RelLockTime> for RelLockTime
source§fn eq(&self, other: &RelLockTime) -> bool
fn eq(&self, other: &RelLockTime) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<RelLockTime> for RelLockTime
impl PartialOrd<RelLockTime> for RelLockTime
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for RelLockTime
impl<Pk: MiniscriptKey + ToPublicKey> Satisfier<Pk> for RelLockTime
source§fn check_older(&self, n: LockTime) -> bool
fn check_older(&self, n: LockTime) -> bool
Assert whether an relative locktime is satisfied Read more
source§fn lookup_ecdsa_sig(&self, _: &Pk) -> Option<Signature>
fn lookup_ecdsa_sig(&self, _: &Pk) -> Option<Signature>
Given a public key, look up an ECDSA signature with that key
source§fn lookup_tap_key_spend_sig(&self) -> Option<Signature>
fn lookup_tap_key_spend_sig(&self) -> Option<Signature>
Lookup the tap key spend sig
source§fn lookup_tap_leaf_script_sig(
&self,
_: &Pk,
_: &TapLeafHash
) -> Option<Signature>
fn lookup_tap_leaf_script_sig( &self, _: &Pk, _: &TapLeafHash ) -> Option<Signature>
Given a public key and a associated leaf hash, look up an schnorr signature with that key
source§fn lookup_tap_control_block_map(
&self
) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>>
fn lookup_tap_control_block_map( &self ) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>>
Obtain a reference to the control block for a ver and script
source§fn lookup_raw_pkh_pk(&self, _: &Hash) -> Option<PublicKey>
fn lookup_raw_pkh_pk(&self, _: &Hash) -> Option<PublicKey>
Given a raw
Pkh
, lookup corresponding bitcoin::PublicKey
source§fn lookup_raw_pkh_x_only_pk(&self, _: &Hash) -> Option<XOnlyPublicKey>
fn lookup_raw_pkh_x_only_pk(&self, _: &Hash) -> Option<XOnlyPublicKey>
Given a raw
Pkh
, lookup corresponding bitcoin::secp256k1::XOnlyPublicKey
source§fn lookup_raw_pkh_ecdsa_sig(&self, _: &Hash) -> Option<(PublicKey, Signature)>
fn lookup_raw_pkh_ecdsa_sig(&self, _: &Hash) -> Option<(PublicKey, Signature)>
Given a keyhash, look up the EC signature and the associated key
Even if signatures for public key Hashes are not available, the users
can use this map to provide pkh -> pk mapping which can be useful
for dissatisfying pkh.
source§fn lookup_raw_pkh_tap_leaf_script_sig(
&self,
_: &(Hash, TapLeafHash)
) -> Option<(XOnlyPublicKey, Signature)>
fn lookup_raw_pkh_tap_leaf_script_sig( &self, _: &(Hash, TapLeafHash) ) -> Option<(XOnlyPublicKey, Signature)>
Given a keyhash, look up the schnorr signature and the associated key
Even if signatures for public key Hashes are not available, the users
can use this map to provide pkh -> pk mapping which can be useful
for dissatisfying pkh.
source§fn lookup_sha256(&self, _: &Pk::Sha256) -> Option<Preimage32>
fn lookup_sha256(&self, _: &Pk::Sha256) -> Option<Preimage32>
Given a SHA256 hash, look up its preimage
source§fn lookup_hash256(&self, _: &Pk::Hash256) -> Option<Preimage32>
fn lookup_hash256(&self, _: &Pk::Hash256) -> Option<Preimage32>
Given a HASH256 hash, look up its preimage
source§fn lookup_ripemd160(&self, _: &Pk::Ripemd160) -> Option<Preimage32>
fn lookup_ripemd160(&self, _: &Pk::Ripemd160) -> Option<Preimage32>
Given a RIPEMD160 hash, look up its preimage
source§fn lookup_hash160(&self, _: &Pk::Hash160) -> Option<Preimage32>
fn lookup_hash160(&self, _: &Pk::Hash160) -> Option<Preimage32>
Given a HASH160 hash, look up its preimage
source§impl TryFrom<Sequence> for RelLockTime
impl TryFrom<Sequence> for RelLockTime
§type Error = RelLockTimeError
type Error = RelLockTimeError
The type returned in the event of a conversion error.
impl Copy for RelLockTime
impl Eq for RelLockTime
impl StructuralEq for RelLockTime
impl StructuralPartialEq for RelLockTime
Auto Trait Implementations§
impl RefUnwindSafe for RelLockTime
impl Send for RelLockTime
impl Sync for RelLockTime
impl Unpin for RelLockTime
impl UnwindSafe for RelLockTime
Blanket Implementations§
source§impl<T, Pk> AssetProvider<Pk> for Twhere
T: Satisfier<Pk>,
Pk: MiniscriptKey + ToPublicKey,
impl<T, Pk> AssetProvider<Pk> for Twhere T: Satisfier<Pk>, Pk: MiniscriptKey + ToPublicKey,
source§fn provider_lookup_ecdsa_sig(&self, pk: &Pk) -> bool
fn provider_lookup_ecdsa_sig(&self, pk: &Pk) -> bool
Given a public key, look up an ECDSA signature with that key, return whether we found it
source§fn provider_lookup_tap_key_spend_sig(&self, _: &Pk) -> Option<usize>
fn provider_lookup_tap_key_spend_sig(&self, _: &Pk) -> Option<usize>
Lookup the tap key spend sig and return its size
source§fn provider_lookup_tap_leaf_script_sig(
&self,
pk: &Pk,
leaf_hash: &TapLeafHash
) -> Option<usize>
fn provider_lookup_tap_leaf_script_sig( &self, pk: &Pk, leaf_hash: &TapLeafHash ) -> Option<usize>
Given a public key and a associated leaf hash, look up a schnorr signature with that key
and return its size
source§fn provider_lookup_tap_control_block_map(
&self
) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion), Global>>
fn provider_lookup_tap_control_block_map( &self ) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion), Global>>
Obtain a reference to the control block for a ver and script
source§fn provider_lookup_raw_pkh_pk(&self, hash: &Hash) -> Option<PublicKey>
fn provider_lookup_raw_pkh_pk(&self, hash: &Hash) -> Option<PublicKey>
Given a raw
Pkh
, lookup corresponding bitcoin::PublicKey
source§fn provider_lookup_raw_pkh_x_only_pk(
&self,
hash: &Hash
) -> Option<XOnlyPublicKey>
fn provider_lookup_raw_pkh_x_only_pk( &self, hash: &Hash ) -> Option<XOnlyPublicKey>
Given a raw
Pkh
, lookup corresponding bitcoin::secp256k1::XOnlyPublicKey
source§fn provider_lookup_raw_pkh_ecdsa_sig(&self, hash: &Hash) -> Option<PublicKey>
fn provider_lookup_raw_pkh_ecdsa_sig(&self, hash: &Hash) -> Option<PublicKey>
Given a keyhash, look up the EC signature and the associated key.
Returns the key if a signature is found.
Even if signatures for public key Hashes are not available, the users
can use this map to provide pkh -> pk mapping which can be useful
for dissatisfying pkh.
source§fn provider_lookup_raw_pkh_tap_leaf_script_sig(
&self,
hash: &(Hash, TapLeafHash)
) -> Option<(XOnlyPublicKey, usize)>
fn provider_lookup_raw_pkh_tap_leaf_script_sig( &self, hash: &(Hash, TapLeafHash) ) -> Option<(XOnlyPublicKey, usize)>
Given a keyhash, look up the schnorr signature and the associated key.
Returns the key and sig len if a signature is found.
Even if signatures for public key Hashes are not available, the users
can use this map to provide pkh -> pk mapping which can be useful
for dissatisfying pkh.
source§fn provider_lookup_sha256(&self, hash: &<Pk as MiniscriptKey>::Sha256) -> bool
fn provider_lookup_sha256(&self, hash: &<Pk as MiniscriptKey>::Sha256) -> bool
Given a SHA256 hash, look up its preimage, return whether we found it
source§fn provider_lookup_hash256(&self, hash: &<Pk as MiniscriptKey>::Hash256) -> bool
fn provider_lookup_hash256(&self, hash: &<Pk as MiniscriptKey>::Hash256) -> bool
Given a HASH256 hash, look up its preimage, return whether we found it
source§fn provider_lookup_ripemd160(
&self,
hash: &<Pk as MiniscriptKey>::Ripemd160
) -> bool
fn provider_lookup_ripemd160( &self, hash: &<Pk as MiniscriptKey>::Ripemd160 ) -> bool
Given a RIPEMD160 hash, look up its preimage, return whether we found it
source§fn provider_lookup_hash160(&self, hash: &<Pk as MiniscriptKey>::Hash160) -> bool
fn provider_lookup_hash160(&self, hash: &<Pk as MiniscriptKey>::Hash160) -> bool
Given a HASH160 hash, look up its preimage, return whether we found it
source§fn check_older(&self, s: LockTime) -> bool
fn check_older(&self, s: LockTime) -> bool
Assert whether a relative locktime is satisfied
source§fn check_after(&self, l: LockTime) -> bool
fn check_after(&self, l: LockTime) -> bool
Assert whether an absolute locktime is satisfied
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