Project Information
- Repository: https://github.com/holgern/beem
- Project Name: beem
A GitHub issue was created and a PR with a fix was merged by the PO.
Expected behavior
blockchain.stream(start, stop, only_ops=True)
should return all operations, including virtual ops, contained in the block range from start
to stop
. The same should be possible via Block(blocknum, only_ops=True)
for individual blocks. If a block does not contain operations, the calls should return an empty list. While this situation is rare for current blocks, it is present frequently on early Steem blocks, testnets and Steem forks.
Actual behavior
blockchain.stream(start, stop, only_ops=True)
and Block(blocknum, only_ops=True)
fail with a BlockDoesNotExistsException
if the block contains no operations.
How to reproduce
from beem.blockchain import Blockchain
b = Blockchain()
for op in b.stream(start=1000, stop=1001, only_ops=True):
print(op)
or
from beem.block import Block
b = Block(1000, only_ops=True)
Output:
Traceback (most recent call last):
File "bug_get_ops_in_block.py", line 8, in <module>
b = Block(1000, only_ops=True)
File "/usr/local/lib/python3.6/site-packages/beem/block.py", line 76, in __init__
steem_instance=steem_instance
File "/usr/local/lib/python3.6/site-packages/beem/blockchainobject.py", line 134, in __init__
self.refresh()
File "/usr/local/lib/python3.6/site-packages/beem/block.py", line 156, in refresh
raise BlockDoesNotExistsException("output: %s of identifier %s" % (str(block), str(self.identifier)))
beem.exceptions.BlockDoesNotExistsException: output: {} of identifier 1000
Environment
# beempy --version
beempy, version 0.20.17
# python --version
Python 3.6.6