Skip to content

Add non-lazy load for Witness and Worker lists. - #99

Merged
xeroc merged 2 commits into
bitshares:developfrom
jhtitor:witness_worker_lazy_list
Jun 27, 2018
Merged

Add non-lazy load for Witness and Worker lists.#99
xeroc merged 2 commits into
bitshares:developfrom
jhtitor:witness_worker_lazy_list

Conversation

@jhtitor

@jhtitor jhtitor commented May 4, 2018

Copy link
Copy Markdown
Contributor

Little something I found useful.

(In my use case, I'm downloading/resolving stuff on a separate thread, no API calls should happen in the GUI thread. That's the reason you might see some PRs regarding lazy-load from me).

@codecov-io

codecov-io commented May 4, 2018

Copy link
Copy Markdown

Codecov Report

Merging #99 into develop will decrease coverage by 7.94%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop     #99      +/-   ##
==========================================
- Coverage    67.55%   59.6%   -7.95%     
==========================================
  Files           56      37      -19     
  Lines         4475    3533     -942     
==========================================
- Hits          3023    2106     -917     
+ Misses        1452    1427      -25
Impacted Files Coverage Δ
bitshares/worker.py 44% <100%> (ø) ⬆️
bitshares/witness.py 39.58% <100%> (+2.08%) ⬆️
bitshares/aes.py 91.17% <0%> (-8.83%) ⬇️
bitshares/bitshares.py 46.34% <0%> (-0.59%) ⬇️
bitshares/price.py 48.82% <0%> (ø) ⬆️
tests/test_transactions.py
tests/test_memo.py
tests/test_base_objects.py
tests/test_block.py
setup.py
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd96ce7...6aa4448. Read the comment docs.

@xeroc

xeroc commented May 28, 2018

Copy link
Copy Markdown
Member

In fact, the API call returns a list of the entire objects, so going "lazy" would be waste of transmitted data. Can we set the default behavior to lazy=False?

Comment thread bitshares/witness.py
def __init__(self, only_active=False, **kwargs):
def __init__(self, only_active=False, lazy=True, **kwargs):
BlockchainInstance.__init__(self, **kwargs)
self.schedule = self.blockchain.rpc.get_object(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where an RPC call will happen no maater what lazy is

@jhtitor

jhtitor commented Jun 22, 2018

Copy link
Copy Markdown
Contributor Author

(Hopefully you meant both witness and worker lists, and not just witness list.)

@xeroc
xeroc merged commit ec72929 into bitshares:develop Jun 27, 2018
@xeroc

xeroc commented Jun 27, 2018

Copy link
Copy Markdown
Member

Thank you for your contribution!

xeroc added a commit that referenced this pull request Jun 27, 2018
Release 0.1.17

1682c83 (HEAD -> master) Merge branch 'release/0.1.17'
045f38f (release/0.1.17) version bump
8706c06 (develop) fix expiration
8eec89e Merge branch 'cla-contributing' into develop
de6dcb4 (origin/cla-contributing, cla-contributing) fixing markdown
0996b7e Updates to contribution and code of conduct
4d8db16 github presentation
74dfb05 initial CLA
c4fdf86 (origin/develop) separate code of conduct and ocntributing
3d5dcff AUTHORS and CONTRIBUTING
ec72929 Merge pull request #99 from jhtitor/witness_worker_lazy_list
6aa4448 Set default lazy to False when fetching Worker and Witness lists.
efc63ba Order amount fix
c602cad Allow to set and unset proxy for an account
e9f4a26 Community link to telegram
677aefa Fix asset_fee declaration
f5b8beb Fix unit test
be51320 Merge remote-tracking branch 'origin/master' into develop
85cda76 Merge pull request #106 from jhtitor/acc_ext2
cd18153 Merge pull request #107 from jhtitor/test_message
c218e59 Merge pull request #108 from jhtitor/pycryptodome
5a13484 Merge pull request #109 from tianyekuo/develop
3ff9e76 fix test
f8e6f5f improve blockchainobject
7aa7d87 cache account name
fa877c0 Test against witness node
c50d500 cleanup setup.cfg
2a80da3 Remove limitation for maintenance collateral ratio
2bbcfc9 fix worker_create to require BTS - wouldn't work on testnet
6628144 updates to transactionbuilder
dbae335 Finish migration to PyCryptodome.
5a6bea9 Set init0 as default account in message tests.
c45981d Allow empty list as AccountCreateExtension(s) -- for real this time.
69dc9f3 fix #94
f0ca80d fix #86
1cea535 try to fix travis-ci
35ffe2b move configuration to setup.cfg and add flake8 strict pre-commit hook
eea5132 fix tox.ini
4c16ed4 fix tox.ini
9c293c5 testing new tox.ini coverage settings
1065657 Fix #100
59c307d Add non-lazy load for Witness and Worker lists.
bd96ce7 unit tests
26811ed Add required module
62bc46e Unified with pypeerplays and fix linting
f27b3b5 Merge tag '0.1.16' into develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants