Fix doc comment fallout from s/script type/keychain

This commit is contained in:
LLFourn 2020-12-15 08:39:19 +11:00
parent 1713d621d4
commit 9b31ae9153
No known key found for this signature in database
GPG Key ID: A27093B54DA11F65
2 changed files with 12 additions and 12 deletions

View File

@ -57,7 +57,7 @@ pub use memory::MemoryDatabase;
/// This trait defines the list of operations that must be implemented on the [`Database`] type and /// This trait defines the list of operations that must be implemented on the [`Database`] type and
/// the [`BatchDatabase::Batch`] type. /// the [`BatchDatabase::Batch`] type.
pub trait BatchOperations { pub trait BatchOperations {
/// Store a script_pubkey along with its script type and child number /// Store a script_pubkey along with its keychain and child number.
fn set_script_pubkey( fn set_script_pubkey(
&mut self, &mut self,
script: &Script, script: &Script,
@ -70,17 +70,17 @@ pub trait BatchOperations {
fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>; fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>;
/// Store the metadata of a transaction /// Store the metadata of a transaction
fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>; fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>;
/// Store the last derivation index for a given script type /// Store the last derivation index for a given keychain.
fn set_last_index(&mut self, keychain: KeychainKind, value: u32) -> Result<(), Error>; fn set_last_index(&mut self, keychain: KeychainKind, value: u32) -> Result<(), Error>;
/// Delete a script_pubkey given the script type and its child number /// Delete a script_pubkey given the keychain and its child number.
fn del_script_pubkey_from_path( fn del_script_pubkey_from_path(
&mut self, &mut self,
keychain: KeychainKind, keychain: KeychainKind,
child: u32, child: u32,
) -> Result<Option<Script>, Error>; ) -> Result<Option<Script>, Error>;
/// Delete the data related to a specific script_pubkey, meaning the script type and the child /// Delete the data related to a specific script_pubkey, meaning the keychain and the child
/// number /// number.
fn del_path_from_script_pubkey( fn del_path_from_script_pubkey(
&mut self, &mut self,
script: &Script, script: &Script,
@ -95,7 +95,7 @@ pub trait BatchOperations {
txid: &Txid, txid: &Txid,
include_raw: bool, include_raw: bool,
) -> Result<Option<TransactionDetails>, Error>; ) -> Result<Option<TransactionDetails>, Error>;
/// Delete the last derivation index for a script type /// Delete the last derivation index for a keychain.
fn del_last_index(&mut self, keychain: KeychainKind) -> Result<Option<u32>, Error>; fn del_last_index(&mut self, keychain: KeychainKind) -> Result<Option<u32>, Error>;
} }
@ -103,7 +103,7 @@ pub trait BatchOperations {
/// ///
/// This traits defines the operations that can be used to read data out of a database /// This traits defines the operations that can be used to read data out of a database
pub trait Database: BatchOperations { pub trait Database: BatchOperations {
/// Read and checks the descriptor checksum for a given script type /// Read and checks the descriptor checksum for a given keychain.
/// ///
/// Should return [`Error::ChecksumMismatch`](crate::error::Error::ChecksumMismatch) if the /// Should return [`Error::ChecksumMismatch`](crate::error::Error::ChecksumMismatch) if the
/// checksum doesn't match. If there's no checksum in the database, simply store it for the /// checksum doesn't match. If there's no checksum in the database, simply store it for the
@ -123,13 +123,13 @@ pub trait Database: BatchOperations {
/// Return the list of transactions metadata /// Return the list of transactions metadata
fn iter_txs(&self, include_raw: bool) -> Result<Vec<TransactionDetails>, Error>; fn iter_txs(&self, include_raw: bool) -> Result<Vec<TransactionDetails>, Error>;
/// Fetch a script_pubkey given the script type and child number /// Fetch a script_pubkey given the child number of a keychain.
fn get_script_pubkey_from_path( fn get_script_pubkey_from_path(
&self, &self,
keychain: KeychainKind, keychain: KeychainKind,
child: u32, child: u32,
) -> Result<Option<Script>, Error>; ) -> Result<Option<Script>, Error>;
/// Fetch the script type and child number of a given script_pubkey /// Fetch the keychain and child number of a given script_pubkey
fn get_path_from_script_pubkey( fn get_path_from_script_pubkey(
&self, &self,
script: &Script, script: &Script,
@ -140,10 +140,10 @@ pub trait Database: BatchOperations {
fn get_raw_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error>; fn get_raw_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error>;
/// Fetch the transaction metadata and optionally also the raw transaction /// Fetch the transaction metadata and optionally also the raw transaction
fn get_tx(&self, txid: &Txid, include_raw: bool) -> Result<Option<TransactionDetails>, Error>; fn get_tx(&self, txid: &Txid, include_raw: bool) -> Result<Option<TransactionDetails>, Error>;
/// Return the last defivation index for a script type /// Return the last defivation index for a keychain.
fn get_last_index(&self, keychain: KeychainKind) -> Result<Option<u32>, Error>; fn get_last_index(&self, keychain: KeychainKind) -> Result<Option<u32>, Error>;
/// Increment the last derivation index for a script type and returns it /// Increment the last derivation index for a keychain and return it
/// ///
/// It should insert and return `0` if not present in the database /// It should insert and return `0` if not present in the database
fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error>; fn increment_last_index(&mut self, keychain: KeychainKind) -> Result<u32, Error>;

View File

@ -163,7 +163,7 @@ impl<D: Database, Cs: CoinSelectionAlgorithm<D>, Ctx: TxBuilderContext> TxBuilde
self self
} }
/// Set the policy path to use while creating the transaction for a given script type /// Set the policy path to use while creating the transaction for a given keychain.
/// ///
/// This method accepts a map where the key is the policy node id (see /// This method accepts a map where the key is the policy node id (see
/// [`Policy::id`](crate::descriptor::Policy::id)) and the value is the list of the indexes of /// [`Policy::id`](crate::descriptor::Policy::id)) and the value is the list of the indexes of