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

Fix issue with owner payouts to setland34 #19

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Setland34
Copy link

@Setland34 Setland34 commented Jan 16, 2025

Fixes #15

Add logic to handle owner payouts and balance updates.

  • blocks.py

    • Add handle_owner_payout method to handle owner payouts and update balances.
    • Modify pay_fee method to call handle_owner_payout for owner payouts.
  • manager.py

    • Add logic to handle owner payouts and balance updates in the receive function.
    • Modify the broadcast function to handle owner payouts.
  • processblock.py

    • Add logic to handle owner payouts and balance updates in the process_transactions function.
    • Modify the eval function to handle owner payouts during transaction processing.
  • tests/test_owner_payouts.py

    • Add tests to verify correct handling of owner payouts and balance updates.

For more details, open the Copilot Workspace session.

Fixes vbuterin#15

Add logic to handle owner payouts and balance updates.

* **blocks.py**
  - Add `handle_owner_payout` method to handle owner payouts and update balances.
  - Modify `pay_fee` method to call `handle_owner_payout` for owner payouts.

* **manager.py**
  - Add logic to handle owner payouts and balance updates in the `receive` function.
  - Modify the `broadcast` function to handle owner payouts.

* **processblock.py**
  - Add logic to handle owner payouts and balance updates in the `process_transactions` function.
  - Modify the `eval` function to handle owner payouts during transaction processing.

* **tests/test_owner_payouts.py**
  - Add tests to verify correct handling of owner payouts and balance updates.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/vbuterin/pyethereum/issues/15?shareId=XXXX-XXXX-XXXX-XXXX).
* Remove logic to handle owner payouts in the `process_transactions` function
…ates

* **Setup**: Modify `setUp` method to initialize test address and balance.
* **Test Owner Payout**: Add test for owner payout and balance update.
* **Test Owner Payout with Fee**: Add test for owner payout with transaction fee.
* **Test Multiple Owner Payouts**: Add test for multiple owner payouts and balance updates.
* Add `test_owner_payout_balance_update` to verify correct balance updates after owner payout
* Add `test_owner_payout_insufficient_balance` to verify behavior when balance is insufficient for owner payout
* Add `test_owner_payout_on_transaction` to verify owner payout during transaction processing
* Add `test_owner_payout_on_receive` to verify owner payout during transaction reception
* Add `test_owner_payout_on_multiple_transactions` to verify owner payout with multiple transactions
* Update `setUp` method to initialize sender, receiver, and owner addresses and balances
* Remove old test cases for owner payouts
…ates

* Update `txpool` and `broadcast` calls to use `blk` instead of `obj`
* Add logic to handle owner payouts by calling `mainblk.handle_owner_payout` with `tx.sender` and `tx.value`
* Add `test_owner_payout_on_transaction` to verify owner payout on a single transaction
* Add `test_owner_payout_on_fee` to verify owner payout on transaction fee
* Add `test_owner_payout_on_multiple_transactions` to verify owner payout on multiple transactions
* Update `setUp` method to initialize balances and addresses
* Remove unused imports and update imports for `Trie` and `rlp`
Copy link
Author

@Setland34 Setland34 left a comment

Choose a reason for hiding this comment

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

Approved

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.

https://github.com/paytr-protocol/contracts.git
1 participant