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

Commits on Jan 4, 2021

  1. Do not shutDown with CloseConnectionReason.PEER_BANNED if we received a

    CloseConnectionMessage as it would trigger a wrong log on the peers side,
    that he got banned.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    b013503 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    456d1f8 View commit details
    Browse the repository at this point in the history
  3. Improve logging of received data

    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.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    a7127d4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ac8711c View commit details
    Browse the repository at this point in the history
  5. Make code more readable

    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    1ef086a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    79a0874 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e868050 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fbfd95b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    de5b69a View commit details
    Browse the repository at this point in the history
  10. If we select TransferWise we switch to show all

    currencies as TransferWise supports sending to
    most currencies.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    e73b6b0 View commit details
    Browse the repository at this point in the history
  11. Add option in preferences to hide payment methods which are not part …

    …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.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    82644fc View commit details
    Browse the repository at this point in the history
  12. Extract methods for show all and edit entries.

    Use isShowAllEntry methods instead of equals checks
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    039d8fb View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    645594f View commit details
    Browse the repository at this point in the history
  14. Add null checks

    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    b0f54d4 View commit details
    Browse the repository at this point in the history
  15. Add denyApiTaker entry to extra field map.

    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.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    9a47a83 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    7a8e863 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    aaef64b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    78282af View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    0ae5006 View commit details
    Browse the repository at this point in the history
  20. Add support for isApiUser and check in OpenOfferManager

    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.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    18e4a39 View commit details
    Browse the repository at this point in the history
  21. Refactor checks for take-able offers

    Extract to OfferFilter method.
    Use enums for return values so the view can show the matching popups.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    400a736 View commit details
    Browse the repository at this point in the history
  22. Add getOffersAvailableForTaker method

    @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.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    2a94810 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    dacdd8f View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    7a76035 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    e2d386e View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    9d3fd03 View commit details
    Browse the repository at this point in the history
  27. Add Result.API_DISABLED

    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    a49505d View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    76022c0 View commit details
    Browse the repository at this point in the history
  29. Remove OfferPayload.DENY_API_TAKER and use preferences

    flag instead.
    
    If we would store the flag in the offer we would
    need to update all offers if the preferences flag changes.
    chimp1984 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    2695415 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    d402496 View commit details
    Browse the repository at this point in the history
  31. Remove DENIED_API_TAKER enum.

    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 committed Jan 4, 2021
    Configuration menu
    Copy the full SHA
    c68c0ed View commit details
    Browse the repository at this point in the history