Skip to content

Coin selection fails under certain condition #424

Closed
@cffls

Description

@cffls

Describe the bug
Coin selection fails under certain condition.

To Reproduce
Failing test added to this branch https://github.com/Python-Cardano/pycardano/tree/coin_selection_fix

Logs

FAILED test/pycardano/test_txbuilder.py::test_token_transfer_with_change - pycardano.exception.UTxOSelectionException: All UTxO selectors failed.
Requested output:
 {
  'coin': 1492152,
  'multi_asset': {ScriptHash(hex='1f847bb9ac60e869780037c0510dbd89f745316db7ec4fee81ff1e97'): {AssetName(b'dux_1'): 382}},
}
Pre-selected inputs:
 {'coin': 4000000, 'multi_asset': {}}
Additional UTxO pool:
 [{'input': {
  'index': 0,
  'transaction_id': TransactionId(hex='e11efc26f94a3cbf724dc052c43abf36f7a631a831acc6d783f1c9c8c52725c5'),
},
 'output': {
  'address': addr_test1vrs324jltsc0ssuptpa5ngpfk89cps92xa99a2t6vlg6kdqtm5qnv,
  'amount': {
    'coin': 1038710,
    'multi_asset': {ScriptHash(hex='1f847bb9ac60e869780037c0510dbd89f745316db7ec4fee81ff1e97'): {AssetName(b'dux_1'): 1876083}},
  },
  'datum': None,
  'datum_hash': None,
  'post_alonzo': False,
  'script': None,
}}]
Unfulfilled amount:
 {'coin': -3546558, 'multi_asset': {}}

Expected behavior
Coin selection should succeed with provided inputs from the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions