mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
test get_transaction on invalid block
This commit is contained in:
parent
814d8a1663
commit
635a416305
@ -107,6 +107,25 @@ class TestBigchainApi(object):
|
||||
response = b.get_transaction(tx_signed["id"])
|
||||
assert util.serialize(tx_signed) == util.serialize(response)
|
||||
|
||||
@pytest.mark.usefixtures('inputs')
|
||||
def test_read_transaction_invalid_block(self, b, user_vk, user_sk):
|
||||
input_tx = b.get_owned_ids(user_vk).pop()
|
||||
tx = b.create_transaction(user_vk, user_vk, input_tx, 'TRANSFER')
|
||||
tx_signed = b.sign_transaction(tx, user_sk)
|
||||
b.write_transaction(tx_signed)
|
||||
|
||||
# create block
|
||||
block = b.create_block([tx_signed])
|
||||
b.write_block(block, durability='hard')
|
||||
|
||||
# vote the block invalid
|
||||
vote = b.vote(block, b.get_last_voted_block()['id'], False)
|
||||
b.write_vote(block, vote, 2)
|
||||
response = b.get_transaction(tx_signed["id"])
|
||||
|
||||
# should be None, because invalid blocks are ignored
|
||||
assert response is None
|
||||
|
||||
@pytest.mark.usefixtures('inputs')
|
||||
def test_assign_transaction_one_node(self, b, user_vk, user_sk):
|
||||
input_tx = b.get_owned_ids(user_vk).pop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user