-
Notifications
You must be signed in to change notification settings - Fork 69
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
Allow TransactionBuilder to accept null
for fee
#523
Comments
Is someone working on this issue? I would like to work on it if no one is taking a look. This is my first time working on the code base. Please let me know the things I should be keeping in mind. |
No one is working on it, but it seems like a nice convenience. Go for it! |
I have a few questions to ask before I raise the PR
If above approach in (1) looks fine to you, I will raise PR soon. Also, please let me know if you have any feedbacks. |
This looks like the right approach to me. I don't know much about the Java sdk tests, but I'll try to look later. For me, as long as you have a test that sets the fee to null with an Integer and a Long argument, I think you're fine. Separately, I wonder if another thing we should do is null out |
Thanks @jannotti for the pointers. Please let me know if I should make flatfee related change in this PR. Or I can create a separate PR for that. |
Also, I see got flatfee, we have null issue for Long and Integer. Should we apply same changes for flatfee as well? I am not sure if similar check is required firstValid or lastValid, but I see similar usage as well. |
@jannotti yes this makes sense to me, since the values are mutually exclusive.
@subhakundu yes I think
In my opinion it wouldn't be harmful to allow nulls for |
Thanks for the information. Then I am making following changes
I will try to keep same PR with the two changes. If it takes time, I might raise separate PRs. |
…. Also, adding unit test for testing behaviour of transaction builder if fee and flatfee is null. (algorand#523)
…. Also, adding unit test for testing behaviour of transaction builder if fee and flatfee is null. (algorand#523)
I have added a PR addressing the changes discussed. Fee and flatfee is already being set to null as per the current code. I have added a unit test for better documentation of different scenarios. Please let me know your feedback and concerns. |
Problem
I'd like to rely on suggested params to populate most of the fields but when overriding the
fee
on the transaction with aflatFee
the builder errors since bothfee
andflatFee
are set.If I try to pass
null
to thefee
method, it only works in the case ofBigInteger
which may be changed at some point.Solution
Allow
fee
method in builder to acceptnull
for Integer or Long so we can properly unset the fee parameter while still allowingsuggestedParameters
to be passed instead of individual arguments.The text was updated successfully, but these errors were encountered: