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
Display Enabled=PENDING in CLI 'createoffer' output #5663
Merged
sqrrm
merged 56 commits into
bisq-network:master
from
ghubstan:07-show-new-offer-with-pending-status
Aug 30, 2021
Merged
Display Enabled=PENDING in CLI 'createoffer' output #5663
sqrrm
merged 56 commits into
bisq-network:master
from
ghubstan:07-show-new-offer-with-pending-status
Aug 30, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Define set of editable offer payload fields in MutableOfferPayloadFields. - Move bulk of EditOfferDataModel#onPublishOffer logic to OfferUtil.
- Add editOffer to GrpcOffersService, CoreApi, CoreOffersService. - Set editOffer call rate meter to 1 / minute. - Use new EditOfferValidator to verify editOffer params OK. - Adust getMyOffer(s) rpc impl and OfferInfo model to use OpenOffer for accessing activation state and trigger price.
Reduces size of GrpcClient while allowing for additional bot-friendly variations of the new grpc editOffer method.
Support for editing BSQ offers is in place, but will be added in another PR.
Optionally displaying an ENABLED column in CLI side getoffer output depends on the value of offer.isMyOffer, which is passed via new boolean arguments to the trade & offer pojo builders.
BSQ offers are fixed-price only. This change blocks an attempt to change an altcoin offer to a margin price based offer, or set a trigger price.
And log CLI's getoffer output to see getoffer formatting -- after adding new ENABLED and TRIGGER-PRICE columns.
And make sure function is not duplicated CLI side logic.
Avoid inconsistent CLI output decimal formats across different systems' default locales.
Use LinkedHashSet to maintain NetworkEnvelope ordering when Connection#onBundleOfEnvelopes calls listeners. Connection#onBundleOfEnvelopes builds a set from an ordered list of NetworkEnvelopes, then calls listeners during set iteration. The envelope list ordering is lost if a HashSet is built, but maintained by switching to a LinkedHashSet. Losing the envelope ordering becomes a problem if the peer receives a RemoveDataMessage and an AddDataMessage in the same batch of envelopes, and relays them to listeners in the wrong (random) order. For example, an API 'editoffer' call may result in the edited offer being added, then immediately remove from their UI's offer book.
This reverts commit add6536.
Using the API's CLI to edit offers can sometimes result in add/remove messages being received on peers in the same batch of envolopes, and these messages are sometimes passed to the UI in (1) add, (2) remove order. This can result in a newly edited offer being removed immediately after being added to the OfferBook list. This change uses storage entry sequence number and storage entry payload hash comparisons to avoid the problem. - OfferBookListItem Added new constructor taking P2PDataStorage.ByteArray hashOfPayload, and int sequenceNumber params. Added a new toString() method. - OfferBook Added new checks on OfferBookListItem hashOfPayload and sequenceNumber while determining if offer candidates should be added or removed from the UI's OfferBook List. See OfferBook contructor's implementation of OfferBookChangedListener#onAdded and OfferBookChangedListener#onRemoved. Added many comments explaining the add/remove rules, and plenty of debug statements to help trace the add/remove event process. - OfferBookService#OfferBookChangedListener Added new P2PDataStorage.ByteArray hashOfPayload, and int sequenceNumber params to listener's onAdded and onRemoved method signatures. Added these two new paramater values to listener.onAdded and listener.onRemoved calls. - TakeOfferDataModel Replaced unused, old tradeManager param in offerBook.removeOffer() with (null) P2PDataStorage.ByteArray hashOfPayload, and (-1) int sequenceNumber params. OfferBook will remove the candidate offer as before. - MarketAlerts Adjusted onAdded() & onRemoved listener method signatures, even though new P2PDataStorage.ByteArray hashOfPayload, int sequenceNumber params are not used by the implementations.
(Accidentally included in last commit.)
This change is a refactoring for handling the removal of a peer UI's offer item when it is deactivated and edited in the same CLI `editoffer` command. On the API side, an `editoffer --price=N --enable=false` command results in the edited offer not being re-published. On a UI peer's side, the edited offer is not added to the peer's storage, and the peer's onRemoved(offer) listener event does not find a storage entry with matching payload-hash. This fix assumes an offer that is not in the local store should be removed from the UI's view list -- when the onRemoved method's hashOfPayload does not match the UI's view list item's hashOfPayload.
A newly created offer has no OpenOffer+State (AVAILABLE || DEACTIVATED) when displayed in the CLI's console. This change adds a 'bool isMyPendingOffer' to the OfferInfo proto + wrapper, and the CLI's console offer output formatter uses it to determine if it should display a new offer's Enabled column value as PENDING, instead of an ambiguous NO value.
…ffer-with-pending-status
File conflicts resolved in child PR #5666 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A newly created offer has no OpenOffer+State (
AVAILABLE
||DEACTIVATED
) when displayed in the CLI's console. This change adds abool isMyPendingOffer
to theOfferInfo
proto + wrapper, and the CLI's console offer output formatter uses it to determine if it should display an offer'sEnabled
column value asPENDING
, instead of an ambiguousNO
value.This PR is based on #5659, which should be reviewed and merged before this one.