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

Monetary Exchange #48

Merged
merged 7 commits into from
May 15, 2024
Merged

Monetary Exchange #48

merged 7 commits into from
May 15, 2024

Conversation

oliviab598
Copy link
Collaborator

  • Modified the Peer class methods to work for "sale" and "trade"
  • Modified naming of various methods and modules to fit with the new "exchange" ("sale" and "trade") rather than just "trade".
  • Tested the new Peer methods.

oliviab598 and others added 4 commits April 28, 2024 13:47
I refactor my code to be more consistent, and remove duplicate
code. I comment out the peer_test methods because I plan to
refactor them.
- Added ledger integration to the handle_accept_exchange() method
of the Peer class
- Added a get_artwork_by_id() method to the Inventory class

Next steps:
Add peer tests.
- Changed naming of modules and methods to fit the exchange type,
which is divided into "sale" and "trade".
- Modified exchange ```Peer``` methods to fit "sale" on top of "trade"
- Tested all ```Peer``` class methods.
Copy link
Owner

@zimmermatt zimmermatt left a comment

Choose a reason for hiding this comment

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

Quick look over with limited time. I'll take a deeper look once a couple if things I noted are addressed.

src/main/py/peer/peer.py Outdated Show resolved Hide resolved
src/main/py/peer/peer.py Outdated Show resolved Hide resolved
src/test/py/peer/peer_test.py Outdated Show resolved Hide resolved
src/test/py/peer/peer_test.py Outdated Show resolved Hide resolved
- Rework ```Peer``` exchange method tests to account for failure cases
and remove redundancy
    - For example, a method may have an additional functionality for
    only one ```exchange_type```, so I test the ```exchange_type```
    with additional funcitonality.
- Rework ```Peer``` exchange methods
    - Remove redundant code between ```handle_exchange_response``` and
    ```handle_response_deadline```
    - Change naming of logs to be concise and sensical
- Rework additional classes
    - Convert ```artwork_id``` argument to ```artwork``` in
    ```OfferAnnouncement``` and ```OfferResponse```
    - Change naming of arguments to be more sensical
- Added Ledger integration to the `handle_accept_exchnage` method
of the `Peer` class.
     - The `handle_accept_exchange` method now adds the exchanger
     to the ledger.
- Modified Ledger class
    - `add_owner()` method now takes in the peer's public key instead
    of the peer object.
@zimmermatt zimmermatt merged commit 7d75aef into zimmermatt:main May 15, 2024
1 check passed
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.

2 participants