-
Notifications
You must be signed in to change notification settings - Fork 126
feat: support hbar transfer #1014
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
|
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 |
|
Hi, this is WorkflowBot.
|
|
Requet review if available @MonaaEid @Adityarya11 |
826177d to
0b1e7ac
Compare
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta <96904203+prajeeta15@users.noreply.github.com>
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 please rebase and also add your changelog check correctly :)
thank you
hi @prajeeta15 if the ChangeLog is messed up you may try git checkout main -- CHANGELOG.md |
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.
yes agree, you can just copy in the main's changelog code then add your change on top and commit that.
|
updated changelog |
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta <96904203+prajeeta15@users.noreply.github.com>
Hi @prajeeta15 |
|
@Adityarya11 yeah I was having an issue during rebase so I had just copy-pasted the current changelog.md from main to this. but cool. i pulled and updated changelog with just my lines of work. |
|
Request review if available @hiero-ledger/hiero-sdk-python-triage |
|
|
||
| for transfer in self.hbar_transfers: | ||
| if transfer.account_id == account_id: | ||
| transfer.amount += amount |
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.
what could happen if the amount is equal to 0 here?
| if not isinstance(amount, int) or amount == 0: | ||
| raise ValueError("Amount must be a non-zero integer.") | ||
| raise ValueError("Amount must be a 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.
I'd keep the previous version, is a bit cleaner and also here you have two if with quite te same condition:
if not isinstance(amount, int) or amount == 0(look after the or)if amount == 0
reminder-bot test
Signed-off-by: prajeeta <96904203+prajeeta15@users.noreply.github.com>
Signed-off-by: prajeeta <96904203+prajeeta15@users.noreply.github.com>
…ero-ledger#1137) Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com> Signed-off-by: AntonioCeppellini <128388022+AntonioCeppellini@users.noreply.github.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…r#1135) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: Aditya Shirsatrao <adityashirsatrao007@gmail.com> Signed-off-by: adityashirsatrao007 <adityashirsatrao007@gmail.com> Signed-off-by: Aditya <adityashirsatrao007@gmail.com> Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> Co-authored-by: adityashirsatrao007 <adityashirsatrao007@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…iero-ledger#1114) Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com> Signed-off-by: AntonioCeppellini <128388022+AntonioCeppellini@users.noreply.github.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…er#1122) Signed-off-by: mukundkumarjha <mukundiiitg@gmail.com> Signed-off-by: Mukund Jha <mukundiiitg@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…#1054) (hiero-ledger#1096) Signed-off-by: HusseinYasser <husseinyasser388@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…dger#1146) Signed-off-by: tiya-15 <tiyagarg1511@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: Chaitanya-chute <chaitanyachute11@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…es (hiero-ledger#1038) Signed-off-by: Manish Dait <daitmanish88@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…dger#1148) Signed-off-by: Adityarya11 <arya050411@gmail.com> Signed-off-by: notsogod <149138960+Adityarya11@users.noreply.github.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: Aubrey Du <duk110293@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…PR per user (hiero-ledger#1150) Signed-off-by: Tianyang Ren <victorren86@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: andrerovee <roveda.andrea03@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…hiero-ledger#1160) Signed-off-by: Adityarya11 <arya050411@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
…ero-ledger#1168) Signed-off-by: Manish Dait <daitmanish88@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: Antonio Ceppellini <antonio.ceppellini@gmail.com> Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
Signed-off-by: prajeeta pal <prajeetapal@gmail.com>
06aa368 to
5dfc4b5
Compare
|
i was rebasing and idk all these commits showed up in my push. I am closing this PR for now. |
|
Your main is updated nicely @prajeeta15 happy to help you sort this, please get in touch via discord /MAINTAINERS.md if you want help |
|
thanks !! i tried to fix it myself in a different clean PR because I didnt know how to explain the mistake. |
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
Summary by CodeRabbit
Release Notes
New Features
Tests
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.