Remove duplicate method.

This commit is contained in:
Kris Nuttycombe 2020-08-25 15:51:11 -06:00
parent 8de05f3429
commit 68737dd1dd
4 changed files with 4 additions and 29 deletions

View File

@ -58,7 +58,7 @@ pub trait DBOps {
account: AccountId,
) -> Result<Option<PaymentAddress>, Self::Error>;
fn get_account_extfvks<P: consensus::Parameters>(
fn get_extended_full_viewing_keys<P: consensus::Parameters>(
&self,
params: &P,
) -> Result<Vec<ExtendedFullViewingKey>, Self::Error>;
@ -74,11 +74,6 @@ pub trait DBOps {
fn get_sent_memo_as_utf8(&self, id_note: Self::NoteRef) -> Result<Option<String>, Self::Error>;
fn get_extended_full_viewing_keys<P: consensus::Parameters>(
&self,
params: &P,
) -> Result<Vec<ExtendedFullViewingKey>, Self::Error>;
fn get_commitment_tree(
&self,
block_height: BlockHeight,

View File

@ -23,7 +23,7 @@ where
&'db D: DBOps<Error = E>,
{
// Fetch the ExtendedFullViewingKeys we are tracking
let extfvks = data.get_account_extfvks(params)?;
let extfvks = data.get_extended_full_viewing_keys(params)?;
// Height is block height for mined transactions, and the "mempool height" (chain height + 1)
// for mempool transactions.

View File

@ -8,7 +8,6 @@ use zcash_primitives::{
transaction::TxId,
};
/// A type-safe wrapper for account identifiers.
#[derive(Debug, Copy, Clone)]
pub struct AccountId(pub u32);

View File

@ -42,8 +42,8 @@ use zcash_primitives::{
};
use zcash_client_backend::{
data_api::{error::Error, CacheOps, DBOps, DBUpdate, ShieldedOutput},
encoding::{decode_extended_full_viewing_key, encode_payment_address},
data_api::{CacheOps, DBOps, DBUpdate, ShieldedOutput},
encoding::encode_payment_address,
proto::compact_formats::CompactBlock,
wallet::{AccountId, WalletTx},
DecryptedOutput,
@ -127,25 +127,6 @@ impl<'a> DBOps for &'a DataConnection {
wallet::get_address(self, params, account)
}
fn get_account_extfvks<P: consensus::Parameters>(
&self,
params: &P,
) -> Result<Vec<ExtendedFullViewingKey>, Self::Error> {
self.0
.prepare("SELECT extfvk FROM accounts ORDER BY account ASC")?
.query_map(NO_PARAMS, |row| {
row.get(0).map(|extfvk: String| {
decode_extended_full_viewing_key(
params.hrp_sapling_extended_full_viewing_key(),
&extfvk,
)
})
})?
// Raise SQL errors from the query, IO errors from parsing, and incorrect HRP errors.
.collect::<Result<Result<Option<_>, _>, _>>()??
.ok_or(SqliteClientError(Error::IncorrectHRPExtFVK))
}
fn get_balance(&self, account: AccountId) -> Result<Amount, Self::Error> {
wallet::get_balance(self, account)
}