Struct bdk_wallet::keys::SortedMultiVec
pub struct SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,{ /* private fields */ }
Expand description
Contents of a “sortedmulti” descriptor
Implementations§
§impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
pub fn new(k: usize, pks: Vec<Pk>) -> Result<SortedMultiVec<Pk, Ctx>, Error>
pub fn new(k: usize, pks: Vec<Pk>) -> Result<SortedMultiVec<Pk, Ctx>, Error>
Create a new instance of SortedMultiVec
given a list of keys and the threshold
Internally checks all the applicable size limits and pubkey types limitations according to the current Ctx
.
pub fn from_tree(tree: &Tree<'_>) -> Result<SortedMultiVec<Pk, Ctx>, Error>
pub fn from_tree(tree: &Tree<'_>) -> Result<SortedMultiVec<Pk, Ctx>, Error>
Parse an expression tree into a SortedMultiVec
pub fn translate_pk<T, Q, FuncError>(
&self,
t: &mut T
) -> Result<SortedMultiVec<Q, Ctx>, TranslateErr<FuncError>>where
T: Translator<Pk, Q, FuncError>,
Q: MiniscriptKey,
pub fn translate_pk<T, Q, FuncError>(
&self,
t: &mut T
) -> Result<SortedMultiVec<Q, Ctx>, TranslateErr<FuncError>>where
T: Translator<Pk, Q, FuncError>,
Q: MiniscriptKey,
This will panic if fpk returns an uncompressed key when converting to a Segwit descriptor. To prevent this panic, ensure fpk returns an error in this case instead.
§impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
pub fn sanity_check(&self) -> Result<(), Error>
pub fn sanity_check(&self) -> Result<(), Error>
utility function to sanity a sorted multi vec
§impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
pub fn sorted_node(&self) -> Terminal<Pk, Ctx>where
Pk: ToPublicKey,
pub fn sorted_node(&self) -> Terminal<Pk, Ctx>where
Pk: ToPublicKey,
Create Terminal::Multi containing sorted pubkeys
pub fn encode(&self) -> ScriptBufwhere
Pk: ToPublicKey,
pub fn encode(&self) -> ScriptBufwhere
Pk: ToPublicKey,
Encode as a Bitcoin script
pub fn satisfy<S>(&self, satisfier: S) -> Result<Vec<Vec<u8>>, Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
pub fn satisfy<S>(&self, satisfier: S) -> Result<Vec<Vec<u8>>, Error>where
Pk: ToPublicKey,
S: Satisfier<Pk>,
Attempt to produce a satisfying witness for the witness script represented by the parse tree
pub fn build_template<P>(&self, provider: &P) -> Satisfaction<Placeholder<Pk>>where
Pk: ToPublicKey,
P: AssetProvider<Pk>,
pub fn build_template<P>(&self, provider: &P) -> Satisfaction<Placeholder<Pk>>where
Pk: ToPublicKey,
P: AssetProvider<Pk>,
Attempt to produce a witness template given the assets available
pub fn script_size(&self) -> usize
pub fn script_size(&self) -> usize
Size, in bytes of the script-pubkey. If this Miniscript is used outside of segwit (e.g. in a bare or P2SH descriptor), this quantity should be multiplied by 4 to compute the weight.
In general, it is not recommended to use this function directly, but
to instead call the corresponding function on a Descriptor
, which
will handle the segwit/non-segwit technicalities for you.
pub fn max_satisfaction_witness_elements(&self) -> usize
pub fn max_satisfaction_witness_elements(&self) -> usize
Maximum number of witness elements used to satisfy the Miniscript
fragment, including the witness script itself. Used to estimate
the weight of the VarInt
that specifies this number in a serialized
transaction.
This function may panic on malformed Miniscript
objects which do
not correspond to semantically sane Scripts. (Such scripts should be
rejected at parse time. Any exceptions are bugs.)
pub fn max_satisfaction_size(&self) -> usize
pub fn max_satisfaction_size(&self) -> usize
Maximum size, in bytes, of a satisfying witness.
In general, it is not recommended to use this function directly, but
to instead call the corresponding function on a Descriptor
, which
will handle the segwit/non-segwit technicalities for you.
All signatures are assumed to be 73 bytes in size, including the length prefix (segwit) or push opcode (pre-segwit) and sighash postfix.
Trait Implementations§
§impl<Pk, Ctx> Clone for SortedMultiVec<Pk, Ctx>
impl<Pk, Ctx> Clone for SortedMultiVec<Pk, Ctx>
§fn clone(&self) -> SortedMultiVec<Pk, Ctx>
fn clone(&self) -> SortedMultiVec<Pk, Ctx>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<Pk, Ctx> Debug for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Debug for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
§impl<Pk, Ctx> Display for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Display for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
§impl<Pk, Ctx> ForEachKey<Pk> for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> ForEachKey<Pk> for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
§fn for_each_key<'a, F>(&'a self, pred: F) -> bool
fn for_each_key<'a, F>(&'a self, pred: F) -> bool
§impl<Pk, Ctx> Hash for SortedMultiVec<Pk, Ctx>
impl<Pk, Ctx> Hash for SortedMultiVec<Pk, Ctx>
§impl<Pk, Ctx> Liftable<Pk> for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
impl<Pk, Ctx> Liftable<Pk> for SortedMultiVec<Pk, Ctx>where
Pk: MiniscriptKey,
Ctx: ScriptContext,
§impl<Pk, Ctx> Ord for SortedMultiVec<Pk, Ctx>
impl<Pk, Ctx> Ord for SortedMultiVec<Pk, Ctx>
§fn cmp(&self, other: &SortedMultiVec<Pk, Ctx>) -> Ordering
fn cmp(&self, other: &SortedMultiVec<Pk, Ctx>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl<Pk, Ctx> PartialEq for SortedMultiVec<Pk, Ctx>
impl<Pk, Ctx> PartialEq for SortedMultiVec<Pk, Ctx>
§fn eq(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
fn eq(&self, other: &SortedMultiVec<Pk, Ctx>) -> bool
self
and other
values to be equal, and is used
by ==
.§impl<Pk, Ctx> PartialOrd for SortedMultiVec<Pk, Ctx>
impl<Pk, Ctx> PartialOrd for SortedMultiVec<Pk, Ctx>
§fn partial_cmp(&self, other: &SortedMultiVec<Pk, Ctx>) -> Option<Ordering>
fn partial_cmp(&self, other: &SortedMultiVec<Pk, Ctx>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more