Skip to content
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

added min ADA calculation for more precise max value #290

Merged
merged 2 commits into from
Jan 23, 2022

Conversation

alessandrokonrad
Copy link
Contributor

I had a few cases, where the max value size was exceeded by a few bytes, because the add_change_if_needed function doesn't take ADA into consideration when it splits the utxos, so I added the minADA to make the calculation more precise.

Copy link
Contributor

@rooooooooob rooooooooob left a comment

Choose a reason for hiding this comment

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

LGTM, nice catch

@@ -878,7 +882,7 @@ impl TransactionBuilder {
let asset_name = asset_names.get(n);
let value = assets.get(&asset_name).unwrap();

if will_adding_asset_make_output_overflow(&output, &rebuilt_assets, (policy.clone(), asset_name.clone(), value), max_value_size) {
if will_adding_asset_make_output_overflow(&output, &rebuilt_assets, (policy.clone(), asset_name.clone(), value), max_value_size, coins_per_utxo_word) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: #304 updates this so you might need to fix that before we can merge this depending on which one gets merged first

Copy link
Contributor

@vsubhuman vsubhuman left a comment

Choose a reason for hiding this comment

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

Thank you, @alessandrokonrad !

@vsubhuman vsubhuman added this to the 10.0.0 milestone Jan 23, 2022
Copy link
Contributor

@vsubhuman vsubhuman left a comment

Choose a reason for hiding this comment

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

/check

@vsubhuman vsubhuman merged commit 224e7c6 into Emurgo:master Jan 23, 2022
@vsubhuman vsubhuman mentioned this pull request Feb 6, 2022
40 tasks
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