Skip to content

Support potential inputs in txbuilder #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2023

Conversation

cffls
Copy link
Collaborator

@cffls cffls commented Apr 22, 2023

This feature will allow users to define a list of potential utxo, which could be returned by a wallet, for UTxO selector to select inputs from.
Addresses #204

This feature will allow users to define a list of potential utxo, which could be returned by a wallet, for
UTxO selector to select inputs from.
@cffls cffls requested a review from nielstron April 22, 2023 21:38
@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2023

Codecov Report

Merging #223 (7d9a6af) into main (a1c840b) will increase coverage by 0.18%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   85.52%   85.71%   +0.18%     
==========================================
  Files          26       26              
  Lines        2909     2919      +10     
  Branches      698      701       +3     
==========================================
+ Hits         2488     2502      +14     
+ Misses        310      307       -3     
+ Partials      111      110       -1     
Impacted Files Coverage Δ
pycardano/txbuilder.py 90.33% <100.00%> (+0.18%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@nielstron nielstron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, this is exactly what I imagined. Ideally the test should also check the desired property of not generally adding all UTxOs.


utxos = chain_context.utxos(sender)

tx_builder.potential_inputs.append(utxos[1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we test here that not all inputs are chosen? This is the crucial property of potential inputs. I.e. maybe add two inputs such that the algorithm will never choose one of either because it does not contain the desired coin? Or choose a deterministic UTxO selection algo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good point! Let me tweak this test a bit.

@cffls cffls merged commit 432a619 into Python-Cardano:main Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants