steemit / steem-python

The official Python (3) library for the Steem Blockchain.
https://steem.io
MIT License
153 stars 98 forks source link

Blockchain.stream_from expects get_config to have "STEEM_BLOCK_INTERVAL" but it is None #235

Open cyon1c opened 6 years ago

cyon1c commented 6 years ago

Version of Python you are running

2.7

Version of steem-python you are running

1.0.0 (master once PR #234 is merged).

Expected Behavior

"STEEM_BLOCK_INTERVAL" should return some value.

Actual Behavior

"STEEM_BLOCK_INTERVAL" is None

Steps to reproduce

This script will repro the error

from steem.blockchain import Blockchain
from steem.steem import Steem

s = Steem(nodes='https://api.steemit.com')

b = Blockchain(s)

for post in b.stream():
    print(post)

Stack Trace

Traceback (most recent call last):
  File "/Users/jw/Desktop/stream_nodes.py", line 8, in <module>
    for post in b.stream():
  File "/Users/jw/Documents/repos/steem-python/steem/blockchain.py", line 234, in stream
    for ops in self.stream_from(*args, **kwargs):
  File "/Users/jw/Documents/repos/steem-python/steem/blockchain.py", line 105, in stream_from
    time.sleep(block_interval)
TypeError: a float is required