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

Add protection tools to offer #5051

Closed

Conversation

chimp1984
Copy link
Contributor

Implements protection tools in context of API deployment (bisq-network/projects#46)

Based on #5045, #5038
Will merge master and rebase once those are merged so commits are easier to review...

CloseConnectionMessage as it would trigger a wrong log on the peers side,
that he got banned.
The numbers did not match up from delivered response size and items as we did not count
in the overhead of the ProtectedStorageEntry (pub key+sig) and did estimate the size
with taking only first item and multiplying it. A measurement resulted in 20 ms costs
for the exact calculation (toProtoMessage().getSerializedSize() has some costs).
I guess that is acceptable to get correct metrics.
currencies as TransferWise supports sending to
most currencies.
…of the users accounts.

Default value is false, so same behaviour as before the change.
If no payment account is setup then we also show all payment methods.
In that case (no payment account) we disable the toggle as well as set it to false.
Use isShowAllEntry methods instead of equals checks
We cannot add a field to OfferPayload as we
use the hash for signing and any change would
break compatibility between diff. versions.
We also cannot rename one of the un-used fields
as we use json for creating the contract hash
and that would fail in the trade then.
Calls from the API set the flag to true, from the desktop its false.
If offer has denyApiUser enabled the offer availibility check fails.

@ghubstan: I set the value in CoreApi and not directly in the CoreTradesService,
so keep it more open that those sub domain classes can be used from desktop as
well. Not sure if is not intended/permitted for some reason but I though that
way we have more flexibility. Feel free to remove the param and set it directly
in CoreTradesService if that class will never be used from non-api code.
Extract to OfferFilter method.
Use enums for return values so the view can show the matching popups.
@ghubstan: If the `offerFilter.canTakeOffer` call can be included
into `getOffers(String direction, String currencyCode)` and maybe
also in `getOffer(String id)` we can remove the `getOffersAvailableForTaker`
method.
flag instead.

If we would store the flag in the offer we would
need to update all offers if the preferences flag changes.
I would not make sense that the API user has set the
preferences to not accept API taker for their offers.
This was from the older version where we used the
offer to carry the flag.

@ghubstan Api user cannot see if an maker has set
the flag but will receive an error at offer availibility check.
@chimp1984 chimp1984 force-pushed the add-protection-tools-to-offer branch from 8447a6c to c68c0ed Compare January 4, 2021 01:01
@chimp1984 chimp1984 marked this pull request as draft January 4, 2021 17:23
@chimp1984 chimp1984 mentioned this pull request Jan 4, 2021
@chimp1984
Copy link
Contributor Author

Replaced by #5053

@chimp1984 chimp1984 closed this Jan 4, 2021
@chimp1984 chimp1984 deleted the add-protection-tools-to-offer branch January 8, 2021 19: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.

1 participant