mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Snakecaseify keys
This commit is contained in:
parent
303e12ee28
commit
414d915033
@ -109,9 +109,9 @@ class Dispatcher:
|
|||||||
|
|
||||||
for tx in block['block']['transactions']:
|
for tx in block['block']['transactions']:
|
||||||
asset_id = tx['id'] if tx['operation'] == 'CREATE' else tx['asset']['id']
|
asset_id = tx['id'] if tx['operation'] == 'CREATE' else tx['asset']['id']
|
||||||
data = {'blockid': block['id'],
|
data = {'block_id': block['id'],
|
||||||
'assetid': asset_id,
|
'asset_id': asset_id,
|
||||||
'txid': tx['id']}
|
'tx_id': tx['id']}
|
||||||
str_buffer.append(json.dumps(data))
|
str_buffer.append(json.dumps(data))
|
||||||
|
|
||||||
for _, websocket in self.subscribers.items():
|
for _, websocket in self.subscribers.items():
|
||||||
|
@ -82,9 +82,9 @@ the transaction's ID, associated asset ID, and containing block's ID.
|
|||||||
Example message::
|
Example message::
|
||||||
|
|
||||||
{
|
{
|
||||||
"txid": "<sha3-256 hash>",
|
"tx_id": "<sha3-256 hash>",
|
||||||
"assetid": "<sha3-256 hash>",
|
"asset_id": "<sha3-256 hash>",
|
||||||
"blockid": "<sha3-256 hash>"
|
"block_id": "<sha3-256 hash>"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,10 +183,10 @@ def test_websocket_block_event(b, _block, test_client, loop):
|
|||||||
for tx in block['block']['transactions']:
|
for tx in block['block']['transactions']:
|
||||||
result = yield from ws.receive()
|
result = yield from ws.receive()
|
||||||
json_result = json.loads(result.data)
|
json_result = json.loads(result.data)
|
||||||
assert json_result['txid'] == tx['id']
|
assert json_result['tx_id'] == tx['id']
|
||||||
# Since the transactions are all CREATEs, asset id == transaction id
|
# Since the transactions are all CREATEs, asset id == transaction id
|
||||||
assert json_result['assetid'] == tx['id']
|
assert json_result['asset_id'] == tx['id']
|
||||||
assert json_result['blockid'] == block['id']
|
assert json_result['block_id'] == block['id']
|
||||||
|
|
||||||
yield from event_source.put(POISON_PILL)
|
yield from event_source.put(POISON_PILL)
|
||||||
|
|
||||||
@ -235,4 +235,4 @@ def test_integration_from_webapi_to_websocket(monkeypatch, client, loop):
|
|||||||
|
|
||||||
result = loop.run_until_complete(ws.receive())
|
result = loop.run_until_complete(ws.receive())
|
||||||
json_result = json.loads(result.data)
|
json_result = json.loads(result.data)
|
||||||
assert json_result['txid'] == tx.id
|
assert json_result['tx_id'] == tx.id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user