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: Reject bid after delete should collect larger penalty #92

Merged
merged 11 commits into from
Sep 20, 2022
Merged

Conversation

codynhat
Copy link
Member

Description

Fixes #91

Checklist:

  • My commit message follows the Conventional Commits specification
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have tested my code
  • My changes generate no new warnings
  • My PR is rebased off the most recent main or appropriate feature branch
  • My PR is opened against the main or appropriate feature branch

@coveralls
Copy link

coveralls commented Sep 17, 2022

Pull Request Test Coverage Report for Build 3092993819

  • 56 of 56 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.4%) to 90.013%

Totals Coverage Status
Change from base Build 3092150105: 1.4%
Covered Lines: 549
Relevant Lines: 593

💛 - Coveralls

@codynhat
Copy link
Member Author

@gravenp As I've gone through the test cases, I think there is a different way to do this. Instead of having the payer pay more than the penalty, we could just no longer allow rejecting a bid if the payer deletes their flow. The bid period would immediately end and anyone can trigger a transfer.

So deleting your flow while there is a bid outstanding is the same as accepting the bid. Once it is deleted though, the depleting amount is taken from the for sale price the payer would receive.

Thoughts?

@gravenp
Copy link
Member

gravenp commented Sep 20, 2022

@gravenp As I've gone through the test cases, I think there is a different way to do this. Instead of having the payer pay more than the penalty, we could just no longer allow rejecting a bid if the payer deletes their flow. The bid period would immediately end and anyone can trigger a transfer.

So deleting your flow while there is a bid outstanding is the same as accepting the bid. Once it is deleted though, the depleting amount is taken from the for sale price the payer would receive.

Thoughts?

If you're able to treat flow deletion effectively the same as a bid rejection window passing, that would simplify the accounting perspective for sure. Would we need to update the logic for the Needs Transfer window on the Cadastre to look for something different in the contracts? We'd still want to add the messaging about the reduction of sales proceeds for the intervening Network Fees regardless.

From a user perspective, I don't think it's unfair/unexpected that you'd lose your right to reject a bid if your stream is stopped.

@codynhat
Copy link
Member Author

Yes, I think that logic would need to be updated.

We'd still want to add the messaging about the reduction of sales proceeds for the intervening Network Fees regardless.

Are you talking about Geo-Web-Project/cadastre#242? They could be prompted to trigger a transfer if their stream is closed which will immediately stop the bleeding of their for sale price.

Another case here is if the user deletes their flow and then reopens it. I think we should still not allow them to reject if they reopen. There could be some vulnerabilities here where they can take funds from the bidder.

@gravenp
Copy link
Member

gravenp commented Sep 20, 2022

Yeah that ticket wouldn't fully apply anymore, so I'd modify it to add the appropriate text on the screen with the Transfer Parcel button rather than the screen with the Accept +(disabled) Reject buttons.

As for reopening the stream, agreed. Once a stream has been cancelled, the ship has sailed. The user has forfeited their right to keep the parcel uninterrupted.

@codynhat codynhat merged commit e9da51b into develop Sep 20, 2022
@codynhat codynhat deleted the fix/91 branch September 20, 2022 20:26
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.

3 participants