refactor(bdk)!: rename LocalUtxo to LocalOutput

This commit is contained in:
志宇
2023-11-01 12:33:57 +08:00
parent 46d39beb2c
commit 82632897aa
5 changed files with 18 additions and 18 deletions

View File

@@ -737,7 +737,7 @@ impl<D> Wallet<D> {
}
/// Return the list of unspent outputs of this wallet
pub fn list_unspent(&self) -> impl Iterator<Item = LocalUtxo> + '_ {
pub fn list_unspent(&self) -> impl Iterator<Item = LocalOutput> + '_ {
self.indexed_graph
.graph()
.filter_chain_unspents(
@@ -786,7 +786,7 @@ impl<D> Wallet<D> {
/// Returns the utxo owned by this wallet corresponding to `outpoint` if it exists in the
/// wallet's database.
pub fn get_utxo(&self, op: OutPoint) -> Option<LocalUtxo> {
pub fn get_utxo(&self, op: OutPoint) -> Option<LocalOutput> {
let (&spk_i, _) = self.indexed_graph.index.txout(op)?;
self.indexed_graph
.graph()
@@ -1617,7 +1617,7 @@ impl<D> Wallet<D> {
.max_satisfaction_weight()
.unwrap();
WeightedUtxo {
utxo: Utxo::Local(LocalUtxo {
utxo: Utxo::Local(LocalOutput {
outpoint: txin.previous_output,
txout: txout.clone(),
keychain,
@@ -1944,7 +1944,7 @@ impl<D> Wallet<D> {
descriptor.at_derivation_index(child).ok()
}
fn get_available_utxos(&self) -> Vec<(LocalUtxo, usize)> {
fn get_available_utxos(&self) -> Vec<(LocalOutput, usize)> {
self.list_unspent()
.map(|utxo| {
let keychain = utxo.keychain;
@@ -2141,7 +2141,7 @@ impl<D> Wallet<D> {
/// get the corresponding PSBT Input for a LocalUtxo
pub fn get_psbt_input(
&self,
utxo: LocalUtxo,
utxo: LocalOutput,
sighash_type: Option<psbt::PsbtSighashType>,
only_witness_utxo: bool,
) -> Result<psbt::Input, CreateTxError<D::WriteError>>
@@ -2352,8 +2352,8 @@ fn new_local_utxo(
keychain: KeychainKind,
derivation_index: u32,
full_txo: FullTxOut<ConfirmationTimeHeightAnchor>,
) -> LocalUtxo {
LocalUtxo {
) -> LocalOutput {
LocalOutput {
outpoint: full_txo.outpoint,
txout: full_txo.txout,
is_spent: full_txo.spent_by.is_some(),