Remove duplicate method.
This commit is contained in:
parent
8de05f3429
commit
68737dd1dd
|
@ -58,7 +58,7 @@ pub trait DBOps {
|
||||||
account: AccountId,
|
account: AccountId,
|
||||||
) -> Result<Option<PaymentAddress>, Self::Error>;
|
) -> Result<Option<PaymentAddress>, Self::Error>;
|
||||||
|
|
||||||
fn get_account_extfvks<P: consensus::Parameters>(
|
fn get_extended_full_viewing_keys<P: consensus::Parameters>(
|
||||||
&self,
|
&self,
|
||||||
params: &P,
|
params: &P,
|
||||||
) -> Result<Vec<ExtendedFullViewingKey>, Self::Error>;
|
) -> 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_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(
|
fn get_commitment_tree(
|
||||||
&self,
|
&self,
|
||||||
block_height: BlockHeight,
|
block_height: BlockHeight,
|
||||||
|
|
|
@ -23,7 +23,7 @@ where
|
||||||
&'db D: DBOps<Error = E>,
|
&'db D: DBOps<Error = E>,
|
||||||
{
|
{
|
||||||
// Fetch the ExtendedFullViewingKeys we are tracking
|
// 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)
|
// Height is block height for mined transactions, and the "mempool height" (chain height + 1)
|
||||||
// for mempool transactions.
|
// for mempool transactions.
|
||||||
|
|
|
@ -8,7 +8,6 @@ use zcash_primitives::{
|
||||||
transaction::TxId,
|
transaction::TxId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// A type-safe wrapper for account identifiers.
|
/// A type-safe wrapper for account identifiers.
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct AccountId(pub u32);
|
pub struct AccountId(pub u32);
|
||||||
|
|
|
@ -42,8 +42,8 @@ use zcash_primitives::{
|
||||||
};
|
};
|
||||||
|
|
||||||
use zcash_client_backend::{
|
use zcash_client_backend::{
|
||||||
data_api::{error::Error, CacheOps, DBOps, DBUpdate, ShieldedOutput},
|
data_api::{CacheOps, DBOps, DBUpdate, ShieldedOutput},
|
||||||
encoding::{decode_extended_full_viewing_key, encode_payment_address},
|
encoding::encode_payment_address,
|
||||||
proto::compact_formats::CompactBlock,
|
proto::compact_formats::CompactBlock,
|
||||||
wallet::{AccountId, WalletTx},
|
wallet::{AccountId, WalletTx},
|
||||||
DecryptedOutput,
|
DecryptedOutput,
|
||||||
|
@ -127,25 +127,6 @@ impl<'a> DBOps for &'a DataConnection {
|
||||||
wallet::get_address(self, params, account)
|
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> {
|
fn get_balance(&self, account: AccountId) -> Result<Amount, Self::Error> {
|
||||||
wallet::get_balance(self, account)
|
wallet::get_balance(self, account)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue