Skip to content

Commit

Permalink
Problem: Block height in event stream is string. (#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
kansi authored and vrde committed Apr 3, 2018
1 parent e4e528e commit 25043bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bigchaindb/tendermint/event_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def process_event(event_queue, event, stream_id):
# Only push non empty blocks
if block_txs:
block_txs = [decode_transaction_base64(txn) for txn in block_txs]
new_block = {'id': str(block_id), 'transactions': block_txs}
new_block = {'height': block_id, 'transactions': block_txs}
event = Event(EventTypes.BLOCK_VALID, new_block)
event_queue.put(event)

Expand Down
2 changes: 2 additions & 0 deletions tests/tendermint/test_event_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def test_process_event_new_block():
event_queue = Queue()
process_event(event_queue, event, 'test_stream_id')
assert not event_queue.empty()
block = event_queue.get()
assert isinstance(block.data['height'], int)


def test_process_event_empty_block():
Expand Down

0 comments on commit 25043bc

Please sign in to comment.