예제 #1
0
def test_prepare_create_transaction_default(alice_pubkey):
    from bigchaindb_driver.offchain import prepare_create_transaction
    create_transaction = prepare_create_transaction(signers=alice_pubkey)
    assert 'id' in create_transaction
    assert 'version' in create_transaction
    assert 'asset' in create_transaction
    assert create_transaction['asset'] == {'data': None}
    assert 'outputs' in create_transaction
    assert 'inputs' in create_transaction
    assert 'metadata' in create_transaction
    assert 'operation' in create_transaction
    assert create_transaction['operation'] == 'CREATE'
예제 #2
0
def test_prepare_create_transaction(asset, signers, recipients):
    from bigchaindb_driver.offchain import prepare_create_transaction
    create_transaction = prepare_create_transaction(
        signers=signers, recipients=recipients, asset=asset)
    assert 'id' in create_transaction
    assert 'version' in create_transaction
    assert 'asset' in create_transaction
    assert create_transaction['asset'] == asset or {'data': None}
    assert 'outputs' in create_transaction
    assert 'inputs' in create_transaction
    assert 'metadata' in create_transaction
    assert 'operation' in create_transaction
    assert create_transaction['operation'] == 'CREATE'