mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fix assignment timestamp in block (#627)
This commit is contained in:
parent
92981e003d
commit
9426c7f866
@ -42,6 +42,7 @@ class Block:
|
||||
|
||||
if tx['assignee'] == self.bigchain.me:
|
||||
tx.pop('assignee')
|
||||
tx.pop('assignment_timestamp')
|
||||
return tx
|
||||
|
||||
def delete_tx(self, tx):
|
||||
|
@ -14,9 +14,14 @@ def test_filter_by_assignee(b, user_vk):
|
||||
tx = b.create_transaction(b.me, user_vk, None, 'CREATE')
|
||||
tx = b.sign_transaction(tx, b.me_private)
|
||||
tx['assignee'] = b.me
|
||||
tx['assignment_timestamp'] = 111
|
||||
|
||||
# filter_tx has side effects on the `tx` instance by popping 'assignee'
|
||||
assert block_maker.filter_tx(tx) == tx
|
||||
# and 'assignment_timestamp'
|
||||
filtered_tx = block_maker.filter_tx(tx)
|
||||
assert filtered_tx == tx
|
||||
assert 'assignee' not in filtered_tx
|
||||
assert 'assignment_timestamp' not in filtered_tx
|
||||
|
||||
tx = b.create_transaction(b.me, user_vk, None, 'CREATE')
|
||||
tx = b.sign_transaction(tx, b.me_private)
|
||||
@ -116,6 +121,7 @@ def test_full_pipeline(b, user_vk):
|
||||
tx = b.sign_transaction(tx, b.me_private)
|
||||
assignee = random.choice([b.me, 'aaa', 'bbb', 'ccc'])
|
||||
tx['assignee'] = assignee
|
||||
tx['assignment_timestamp'] = time.time()
|
||||
if assignee == b.me:
|
||||
count_assigned_to_me += 1
|
||||
r.table('backlog').insert(tx, durability='hard').run(b.conn)
|
||||
|
Loading…
x
Reference in New Issue
Block a user