chore(chain): Standardise KeychainTxOutIndex return types
The previous commit b9c5b9d08b040faf6c6b2d9b3745918031555b72 added IndexSpk. This goes further and adds `Indexed` and `KeychainIndexed` type alises (IndexSpk is Indexed<ScriptBuf>) and attempts to standardize the structure of return types more generally.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#[cfg(feature = "miniscript")]
|
||||
mod txout_index;
|
||||
use bitcoin::Amount;
|
||||
use bitcoin::{Amount, ScriptBuf};
|
||||
#[cfg(feature = "miniscript")]
|
||||
pub use txout_index::*;
|
||||
|
||||
@@ -49,6 +49,11 @@ impl Balance {
|
||||
}
|
||||
}
|
||||
|
||||
/// A tuple of keychain index and corresponding [`ScriptBuf`].
|
||||
pub type Indexed<T> = (u32, T);
|
||||
/// A tuple of keychain, index and the [`ScriptBuf`] derived at that location.
|
||||
pub type KeychainIndexed<K, T> = ((K, u32), T);
|
||||
|
||||
impl core::fmt::Display for Balance {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
write!(
|
||||
|
||||
Reference in New Issue
Block a user