mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #2 from eladve/feat/341/move-version-inside-tx
moved version to be inside the transaction
This commit is contained in:
commit
461196bc3a
@ -479,7 +479,7 @@ def get_fulfillment_message(transaction, fulfillment, serialized=False):
|
||||
'operation': transaction['transaction']['operation'],
|
||||
'timestamp': transaction['transaction']['timestamp'],
|
||||
'data': transaction['transaction']['data'],
|
||||
'version': transaction['version'],
|
||||
'version': transaction['transaction']['version'],
|
||||
'id': transaction['id']
|
||||
}
|
||||
# and the condition which needs to be retrieved from the output of a previous transaction
|
||||
|
@ -38,8 +38,8 @@ class TestBigchainApi(object):
|
||||
def test_create_transaction_create(self, b, user_sk):
|
||||
tx = b.create_transaction(b.me, user_sk, None, 'CREATE')
|
||||
|
||||
assert sorted(tx) == ['id', 'transaction', 'version']
|
||||
assert sorted(tx['transaction']) == ['conditions', 'data', 'fulfillments', 'operation', 'timestamp']
|
||||
assert sorted(tx) == ['id', 'transaction']
|
||||
assert sorted(tx['transaction']) == ['conditions', 'data', 'fulfillments', 'operation', 'timestamp', 'version']
|
||||
|
||||
def test_create_transaction_with_unsupported_payload_raises(self, b):
|
||||
with pytest.raises(TypeError):
|
||||
@ -79,8 +79,8 @@ class TestBigchainApi(object):
|
||||
|
||||
tx = b.create_transaction(user_vk, b.me, input_tx, 'TRANSFER')
|
||||
|
||||
assert sorted(tx) == ['id', 'transaction', 'version']
|
||||
assert sorted(tx['transaction']) == ['conditions', 'data', 'fulfillments', 'operation', 'timestamp']
|
||||
assert sorted(tx) == ['id', 'transaction']
|
||||
assert sorted(tx['transaction']) == ['conditions', 'data', 'fulfillments', 'operation', 'timestamp', 'version']
|
||||
|
||||
tx_signed = b.sign_transaction(tx, user_sk)
|
||||
|
||||
@ -1169,7 +1169,7 @@ class TestFulfillmentMessage(object):
|
||||
assert fulfillment_message['fulfillment']['input'] == original_fulfillment['input']
|
||||
assert fulfillment_message['operation'] == tx['transaction']['operation']
|
||||
assert fulfillment_message['timestamp'] == tx['transaction']['timestamp']
|
||||
assert fulfillment_message['version'] == tx['version']
|
||||
assert fulfillment_message['version'] == tx['transaction']['version']
|
||||
|
||||
@pytest.mark.usefixtures('inputs')
|
||||
def test_fulfillment_message_transfer(self, b, user_vk):
|
||||
@ -1192,7 +1192,7 @@ class TestFulfillmentMessage(object):
|
||||
assert fulfillment_message['fulfillment']['input'] == original_fulfillment['input']
|
||||
assert fulfillment_message['operation'] == tx['transaction']['operation']
|
||||
assert fulfillment_message['timestamp'] == tx['transaction']['timestamp']
|
||||
assert fulfillment_message['version'] == tx['version']
|
||||
assert fulfillment_message['version'] == tx['transaction']['version']
|
||||
|
||||
def test_fulfillment_message_multiple_current_owners_multiple_new_owners_multiple_inputs(self, b, user_vk):
|
||||
# create a new users
|
||||
@ -1230,7 +1230,7 @@ class TestFulfillmentMessage(object):
|
||||
assert fulfillment_message['fulfillment']['input'] == original_fulfillment['input']
|
||||
assert fulfillment_message['operation'] == tx['transaction']['operation']
|
||||
assert fulfillment_message['timestamp'] == tx['transaction']['timestamp']
|
||||
assert fulfillment_message['version'] == tx['version']
|
||||
assert fulfillment_message['version'] == tx['transaction']['version']
|
||||
|
||||
|
||||
class TestTransactionMalleability(object):
|
||||
|
@ -151,7 +151,7 @@ def test_create_tx_with_empty_inputs():
|
||||
tx = create_tx(None, None, [], None)
|
||||
assert 'id' in tx
|
||||
assert 'transaction' in tx
|
||||
assert 'version' in tx
|
||||
assert 'version' in tx['transaction']
|
||||
assert 'fulfillments' in tx['transaction']
|
||||
assert 'conditions' in tx['transaction']
|
||||
assert 'operation' in tx['transaction']
|
||||
|
Loading…
x
Reference in New Issue
Block a user