-
Notifications
You must be signed in to change notification settings - Fork 104
feat: support hbar transfer #942
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
Conversation
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
|
@tech0priyanshu if you are available for a review |
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @prajeeta15 this branch I think was a branch from your workflow check? or a non-updated main?
You are submitting https://github.com/hiero-ledger/hiero-sdk-python/pull/942/files
two PRs: one for PR check and one for hbar
Please make sure to pull latest changes to main, ensure your origin is matching the upstream main, and then rebase your branch with that -- you may want to make a new branch
|
i switched branches (just before push) to push the latest changes so I think the last PR commit (from old branch) got here too (git push oldbranch: new branch) .. but that was already merged and I had taken latest upstream from main. |
|
Over the weekend we had to apply a hot fix, and pulled split the workflow in two |
|
Hello, this is the Office Hour Bot. This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC). This session provides an opportunity to ask questions regarding this Pull Request or receive assistance from a maintainer. Details:
Disclaimer: This is an automated reminder. Please verify the schedule here to be notified of any changes. |
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. To assist you, please read: Thank you for contributing! From the Hiero Python SDK Team |
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
|
Hi, this is WorkflowBot.
|
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta <96904203+prajeeta15@users.noreply.github.com>
.github/workflows/pr-checks.yml
Outdated
| @@ -0,0 +1,168 @@ | |||
| name: 'PR Formatting' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert all changes to pr-checks.yml please
.github/workflows/pr-checks.yml
Outdated
| @@ -0,0 +1,168 @@ | |||
| name: 'PR Formatting' | |||
| on: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file can be deleted, i don't think it exists anymore
Signed-off-by: prajeeta <96904203+prajeeta15@users.noreply.github.com>
| ) | ||
|
|
||
| # Test zero amount | ||
| with pytest.raises(ValueError, match="Amount must be a non-zero integer"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be also
with pytest.raises(ValueError, match="Amount must be a non-zero value"):
| - Added validation logic in `.github/workflows/pr-checks.yml` to detect when no new chnagelog entries are added under [Unreleased]. | ||
| - Support for message chunking in `TopicSubmitMessageTransaction`. | ||
| - Added validation logic in `.github/workflows/pr-checks.yml` to detect when no new changelog entries are added under [Unreleased] | ||
| - feat: Allow `add_hbar_transfer`, `add_approved_hbar_transfer`, and internal `_add_hbar_transfer` to accept `Hbar` objects in addition to raw tinybar integers, with internal normalization to tinybars. Added tests validating the new behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 34 must be move to line after 12
| - Added `.github/workflows/bot-office-hours.yml` to automate the Weekly Office Hour Reminder. | ||
| - feat: Implement account creation with EVM-style alias transaction example. | ||
| - Added validation logic in `.github/workflows/pr-checks.yml` to detect when no new chnagelog entries are added under [Unreleased]. | ||
| - Support for message chunking in `TopicSubmitMessageTransaction`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this should not be deleted
|
I am closing this PR and opening a new one with the resolved issues because this is creating problems during push as I switched between remote branches before push. |
Add Hbar object support to TransferTransaction and add tests
Allow
_add_hbar_transfer,add_hbar_transfer, andadd_approved_hbar_transferto acceptHbarobjects in addition to raw integer tinybar amounts. NormalizeHbarinputs to tinybars immediately (viaHbar.to_tinybars()), store the resulting tinybar integer inHbarTransfer, and keep existing integer behavior intact. Add comprehensive unit tests covering the new behavior and edge cases.Union[int, Hbar]for_add_hbar_transfer,add_hbar_transfer, andadd_approved_hbar_transfer.TypeErrorfor invalidaccount_id,amount, oris_approvedtypes.Hbarto tinybars viaHbar.to_tinybars()and store the tinybar integer inHbarTransfer.ValueErrorfor zero tinybar amounts).account_idby adding tinybars.tests/unit/transaction/test_transfer_transaction.py) that cover:Hbarobjects (HBAR and TINYBAR units),Hbarobjects,Hbarand int inputs,Hbar(0),amount,Hbarunits to tinybars,Addedentry describing the feature and tests.Related issue(s):
Fixes #917
Notes for reviewer:
Hbarinputs are normalized immediately to tinybars; theHbarobject is not stored—only the tinybar integer is stored inHbarTransfer.account_idmust be anAccountIdinstance (TypeErrorotherwise).amountmust be anintorHbar(TypeErrorotherwise).is_approvedmust bebool(TypeErrorotherwise).ValueError("Amount must be a non-zero value.").HbarTransfer(ensure they expect tinybar integers) and toHbar.to_tinybars()behavior.Checklist