-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Block attempts to edit BSQ swap offers with API #4 #5874
Merged
sqrrm
merged 35 commits into
bisq-network:master
from
ghubstan:4-api-editoffer-bsqswap-support
Dec 14, 2021
Merged
Block attempts to edit BSQ swap offers with API #4 #5874
sqrrm
merged 35 commits into
bisq-network:master
from
ghubstan:4-api-editoffer-bsqswap-support
Dec 14, 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
- Adjust GetBsqSwapOffer(s) rpc services to remove currency param. - Adjust OfferInfo and remove BsqSwapOfferInfo. - Add GetOfferCategory service so CLI can determine what kind of takeoffer service is to be used. - Add comment about adding sub-message BsqSwapTradeInfo field to TradeInfo.
- Add GetOfferCategory service so CLI can determine what kind of takeoffer service is to be used. - Adjust to removal of BsqSwapOfferInfo proto. - Call new coreApi.getRole(BsqSwapTrade) before building BsqSwapTradeInfo proto.
- Complete BsqSwapTradeInfo impl. - Merge BsqSwapOfferInfo fields into OfferInfo and remove BsqSwapOfferInfo. - Change all model builders to private static class Builder.
- Add core api methods to help CLI determine which type of offer to take for a given offerId. CLI's 'takeoffer` will need to determine which gRPC/proto request type to send to server. - Add implemetations for getBsqSwapTradeRole(), for tradeId or trade.
- Adjust to removal of BsqSwapOfferInfo proto, use ammended OfferInfo instead. - Remove currency-code param from all get(My)BsqSwapOffer(s) requests. - Add new OfferCategory getAvailableOfferCategory(String offerId) service. CLI uses this to determine which kind of gRPC request object should be sent with a 'takeoffer' request. - Adjust GetOffersSmokeTest to help see offer/swap-offer CLI output.
- Adjust to removal of BsqSwapOfferInfo proto, use ammended OfferInfo instead. - Remove currency-code param from all get(My)BsqSwapOffer(s) requests.
This commit refactors the first cut of the BsqSwapTradeInfo and TradeInfo gRPC proto defs and wrappers. The change avoids duplication of fields between BsqSwapTradeInfo and TradeInfo, and adds a bsqSwapTradeInfo field to the old TradeInfo proto & wrapper. The immediate goal is moving towards getting the API's 'gettrade' method to work for both Bisq v1 trades and BSQ swap trades: the TradeInfo proto sent to the CLI should represent either a Bisq v1 trade or a BSQ swap trade. A mid-term term goal is to also make a new 'gettrades' method return a List<TradeInfo> to the CLI, where items in the List<TradeInfo> can be either v1 trades or bsq-swap trades.
- Made several adjustments to CLI's 'gettrade' output related code so it can show single trade details for either Bisq v1 trades, or BSQ swap trades. - Did minor refactoring of API's core to retrieve # tx confirmations for an addresses and transactions. - Show # of tx confirmations in bsq swap trade detail.
The old GetTrade and TakeOffer rpc service defs will be used for getting BSQ swap trades, and taking BSQ swap offers.
… swaps The rpc GetBsqSwapTrade and TakeBsqSwapOffer services were a quick hack to help test BSQ swap feature development more quickly, using apitest cases. Their gRPC service method implementations are removed here and the GetTrade & TakeOffer service methods are refactored to support BSQ swaps.
A minor refactoring to support serving TradeModel instances to CLI. For example, the CLI 'gettrade' command must return a v1 Trade or BSQ swap trade.
Also refactored some of the opt parsers.
NEVER RUN ON MAINNET!
There are some use cases where the CLI needs to know what kind of offer is being acted on before the request is made, For example: There are differences between a BsqSwap 'takeoffer'request, and a v1 'takeoffer' request. A BsqSwap offer cannot be edited by an 'editoffer' request, and an attempt should be blocked by the CLI. - Append isMyOffer GetOfferCategoryRequest rpc msg def. - Adjust daemon.grpc services for new boolean GetOfferCategoryRequest param. - Adjust core.api for new boolean GetOfferCategoryRequest param. - Add validation check in core.api EditOfferValidator to block attempt to edit a BsqSwap offer. - Refactor CoreOffersService get*offer(id) methods to optionally throw excpetions.
BSQ swap offers cannot be edited
This reverts commit b5981b5. This was a mistake. There is a swap opt in the createoffer command.
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.
Based on PR #5868