+ account.get_*_count() methods

This commit is contained in:
Lex Berezhny 2018-10-09 19:29:20 -04:00
parent 6a97f96745
commit 4aea68ecd1

View file

@ -338,6 +338,9 @@ class BaseAccount:
def get_address_records(self, **constraints) -> defer.Deferred: def get_address_records(self, **constraints) -> defer.Deferred:
return self.ledger.db.get_addresses(account=self, **constraints) return self.ledger.db.get_addresses(account=self, **constraints)
def get_address_count(self, **constraints) -> defer.Deferred:
return self.ledger.db.get_address_count(account=self, **constraints)
def get_private_key(self, chain: int, index: int) -> PrivateKey: def get_private_key(self, chain: int, index: int) -> PrivateKey:
assert not self.encrypted, "Cannot get private key on encrypted wallet account." assert not self.encrypted, "Cannot get private key on encrypted wallet account."
address_manager = {0: self.receiving, 1: self.change}[chain] address_manager = {0: self.receiving, 1: self.change}[chain]
@ -361,9 +364,15 @@ class BaseAccount:
def get_utxos(self, **constraints): def get_utxos(self, **constraints):
return self.ledger.db.get_utxos(account=self, **constraints) return self.ledger.db.get_utxos(account=self, **constraints)
def get_utxo_count(self, **constraints):
return self.ledger.db.get_utxo_count(account=self, **constraints)
def get_transactions(self, **constraints) -> List['basetransaction.BaseTransaction']: def get_transactions(self, **constraints) -> List['basetransaction.BaseTransaction']:
return self.ledger.db.get_transactions(account=self, **constraints) return self.ledger.db.get_transactions(account=self, **constraints)
def get_transaction_count(self, **constraints):
return self.ledger.db.get_transaction_count(account=self, **constraints)
@defer.inlineCallbacks @defer.inlineCallbacks
def fund(self, to_account, amount=None, everything=False, def fund(self, to_account, amount=None, everything=False,
outputs=1, broadcast=False, **constraints): outputs=1, broadcast=False, **constraints):