FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add non-lazy load for Witness and Worker lists. by jhtitor · Pull Request #99 · bitshares/python-bitshares · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions bitshares/witness.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ class Witnesses(list):
:param bitshares blockchain_instance: BitShares() instance to use when
accesing a RPC
"""
def __init__(self, only_active=False, **kwargs):
def __init__(self, only_active=False, lazy=False, **kwargs):
BlockchainInstance.__init__(self, **kwargs)
self.schedule = self.blockchain.rpc.get_object(
"2.12.0").get("current_shuffled_witnesses", [])

witnesses = [
Witness(x, blockchain_instance=self.blockchain)
Witness(x, lazy=lazy, blockchain_instance=self.blockchain)
for x in self.schedule
]

Expand Down
4 changes: 2 additions & 2 deletions bitshares/worker.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Workers(list):
:param bitshares blockchain_instance: BitShares() instance to use when
accesing a RPC
"""
def __init__(self, account_name=None, **kwargs):
def __init__(self, account_name=None, lazy=False, **kwargs):
BlockchainInstance.__init__(self, **kwargs)
if account_name:
account = Account(account_name, blockchain_instance=self.blockchain)
Expand All @@ -48,7 +48,7 @@ def __init__(self, account_name=None, **kwargs):

super(Workers, self).__init__(
[
Worker(x, lazy=True, blockchain_instance=self.blockchain)
Worker(x, lazy=lazy, blockchain_instance=self.blockchain)
for x in self.workers
]
)

Back | FazBrowse Home | New Git URL