Skip to content

Allow for multiple inputs/outputs in prepare_transaction and fulfill_transaction #249

Open
@TimDaub

Description

@TimDaub

Currently it is the following:

In [14]: cid = 0

In [15]: condition = creation_tx['transaction']['conditions'][cid]

In [16]: transfer_input = {
   ....:     'fulfillment': condition['condition']['details'],
   ....:     'input': {
   ....:          'cid': cid,
   ....:          'txid': creation_tx['id'],
   ....:      },
   ....:      'owners_before': condition['owners_after'],
   ....: }
   ....: 

In [17]: prepared_transfer_tx = bdb.transactions.prepare(
   ....:     operation='TRANSFER',
   ....:     asset=creation_tx['transaction']['asset'],
   ....:     inputs=transfer_input,
   ....:     owners_after=bob.verifying_key,
   ....: )
   ....: 

while it could be simply:
prepared_transfer_tx = bdb.transactions.prepare_transfer(input_tx, output_id, owners_after, metadata)
Notice that the operation, transfer_input, asset are all derived from the input_tx (full transaction, not only the tx_id). The complex transfer_input object is legacy of the common code, but can easily be abstracted away in the driver until the common code is fixed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions