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

Take offer refactoring #2080

Closed
wants to merge 413 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
413 commits
Select commit Hold shift + click to select a range
decac63
Add USPostalMoneyOrder
Mar 21, 2018
5c55fe9
Add Venmo
Mar 21, 2018
45e126d
Add WesternUnion
Mar 21, 2018
cb55338
Move PaymentAccount to payment package.
Mar 21, 2018
9c261bf
Integration tests for payment methods
Mar 21, 2018
b10855a
Adjust support scripts.
Mar 22, 2018
8f3592f
BisqProxy.addPaymentAccount should work with core model.
Mar 22, 2018
432466e
Additional fields for OfferDetails
Mar 22, 2018
48e8a91
Merge pull request #37 from blabno/feature/payment-accounts Feature/p…
mrosseel Mar 22, 2018
b0d3b65
Additional fields for TradeDetails.
Mar 22, 2018
34871b9
Merge pull request #38 from blabno/feature/additional-fields-to-offer…
mrosseel Mar 22, 2018
2d6f911
Configure CORS to allow connections from any domain
Mar 26, 2018
be16706
Merge pull request #40 from blabno/feature/additional-fields-for-trad…
mrosseel Mar 23, 2018
34094ae
Allow user to pass buyerSecurityDeposit when creating an offer.
Mar 26, 2018
2a1226d
Merge pull request #41 from blabno/feature/cors Configure CORS to all…
mrosseel Mar 26, 2018
2527e7d
Merge pull request #42 from blabno/feature/buyer-security-deposit All…
mrosseel Mar 26, 2018
4388bf5
Add CryptoCurrencyPaymentAccount.
Mar 26, 2018
4fef6cb
Return wallet addresses.
Mar 26, 2018
f4023ad
More details for transaction details.
Mar 26, 2018
9be1ef2
Return wallet addresses. Filter by purpose.
Mar 27, 2018
0f51ce5
Tests for /trade/{id}/move-funds-to-bisq-wallet endpoint
Apr 3, 2018
3f4ef78
Do not include paymentMethod twice to response json object.
Mar 27, 2018
b25ac1c
Merge pull request #49 from blabno/feature/integration-tests-for-with…
mrosseel Apr 3, 2018
e591755
Withdraw funds
Mar 27, 2018
7cb23f0
Merge pull request #50 from blabno/feature/wallet-address-related-end…
mrosseel Apr 5, 2018
6ebe3c1
POST /api/v1/wallet/btc/addresses should return whole wallet address …
Apr 3, 2018
bba5500
Merge pull request #51 from blabno/feature/more-info-on-created-addre…
mrosseel Apr 5, 2018
55e438d
Change /api/v1/wallet/btc/addresses to only give AVAILABLE and UNUSED…
Apr 3, 2018
1eefcd6
Merge pull request #52 from blabno/feature/refactor-post-btc-address …
mrosseel Apr 5, 2018
5bad93e
Integration tests for createOffer with market based offer.
Apr 4, 2018
2a30e27
Remove empty test classes.
Apr 4, 2018
36a0350
P2P network status
Apr 4, 2018
9bf4096
Bitcoin network status
Apr 4, 2018
51e18f8
Integration tests tweak.
Apr 4, 2018
9058d7b
Protect create offer endpoint against missing percentageFromMarketPrice.
Apr 3, 2018
97a4e55
TakeOffer amount should be a number.
Apr 4, 2018
065337a
Better validation for createOffer.
Apr 4, 2018
e5542c4
Better exception handling for unknown typeId.
Apr 4, 2018
ea3d445
Merge pull request #58 from blabno/feature/protect-create-offer-endpo…
mrosseel Apr 5, 2018
689323c
Prevent random errors of PaymentAccount tests.
Apr 5, 2018
4a0d783
Merge pull request #59 from blabno/feature/network-status Feature/net…
mrosseel Apr 5, 2018
186b5af
Preferences management
Apr 5, 2018
9a1c651
Merge pull request #60 from blabno/bugfix/prevent-random-payment-acco…
mrosseel Apr 5, 2018
2a0250c
Swagger note for createPaymentAccount
Apr 5, 2018
eb88c8a
Bump bisq dependencies and make the code compile.
Apr 5, 2018
8099079
Make the app start.
Apr 5, 2018
1828e09
Make the app start in headless mode.
Apr 6, 2018
30ce4c1
Change /api/v1/wallet/btc/addresses to only give AVAILABLE and UNUSED…
Apr 5, 2018
d0b8ff2
Tweak docker and test setup
Apr 6, 2018
c6e32aa
Integration tests for cancelOffer
Apr 5, 2018
443ed96
Add delay to cancelOffer_notMyOffer_returns404.
Apr 6, 2018
22063c0
Remove BisqProxyError and BisqProxyResult.
Apr 5, 2018
0cb0052
Merge pull request #61 from blabno/feature/preferences Feature/prefer…
mrosseel Apr 5, 2018
bbd5baf
Add m2 volume to travis script.
Apr 6, 2018
2fb83b0
Merge pull request #62 from blabno/feature/remove-bisq-error-result F…
mrosseel Apr 5, 2018
8f03b47
Reuse common and core setup.
Apr 10, 2018
7ddf693
I should be able to create offer with negative percentage from market…
Apr 11, 2018
f8f0d79
Merge pull request #73 from blabno/feature/bump-bisq-dependencies Fea…
mrosseel Apr 10, 2018
79250fd
By default bind api to localhost.
Apr 11, 2018
dedde71
GET /api/v1/currencies should return currency code instead of symbol #78
Apr 11, 2018
5585f76
Merge pull request #80 from blabno/bugfix/negative-percentage-from-ma…
mrosseel Apr 11, 2018
d3887c0
Allow api port and host configuration with program arguments.
Apr 11, 2018
2fcd0f2
Merge pull request #81 from blabno/bugfix/currency-code-instead-of-sy…
mrosseel Apr 11, 2018
4b20368
Production docker image
Apr 11, 2018
8d363bf
Merge pull request #83 from blabno/feature/configurable-api-port-and-…
mrosseel Apr 12, 2018
77e25bf
Wallet password and authorization.
Apr 18, 2018
a6015ee
Merge pull request #84 from blabno/feature/production-docker-image Pr…
mrosseel Apr 17, 2018
ccea83d
Trade wallet password for access token.
Apr 18, 2018
62afd35
Swagger support for authorization.
Apr 18, 2018
1ee66bb
Integration tests for authentication.
Apr 19, 2018
5668990
Move WithdrawFundsForm to model package.
Apr 20, 2018
3c6e08e
Increase wait time for docker container by Arquillian Cube.
Apr 19, 2018
2bcfc21
Version endpoint
Apr 20, 2018
1980ac5
Add default maven repo to speed up dependency resolution.
Apr 20, 2018
c69b60d
Portfolio history
Apr 20, 2018
01a1952
Remove empty @Path annotations.
Apr 20, 2018
7709ea2
Merge pull request #86 from blabno/feature/wallet-password Feature/wa…
mrosseel Apr 20, 2018
047eb97
Proper test sequence for VersionResourceIT.
Apr 23, 2018
d6f55d6
Merge pull request #87 from blabno/feature/version-details Feature/ve…
mrosseel Apr 20, 2018
74a0f4e
Merge pull request #89 from blabno/feature/portfolio-history Portfoli…
mrosseel Apr 23, 2018
a8cc411
Endpoint for market prices.
Apr 23, 2018
2785573
Better description for market price endpoint.
Apr 24, 2018
6d91550
Integration tests for amount exceeding account threshold
Apr 24, 2018
35443f7
Merge pull request #91 from blabno/feature/market-price Endpoint for …
mrosseel Apr 24, 2018
b0f5f74
Backup CRUD.
Apr 25, 2018
473cfca
Cleanup support scripts
Apr 25, 2018
25c6a40
I should not be able to accept offer from myself #72
Apr 24, 2018
4648498
Merge pull request #92 from blabno/bugfix/create-offer-exceeding-amou…
mrosseel Apr 24, 2018
5d1b507
Restore backup
Apr 25, 2018
81e1897
Instructions on getting jq tool.
Apr 26, 2018
a42dc5c
Merge pull request #93 from blabno/bugfix/i-should-not-be-able-to-acc…
Apr 24, 2018
779dee5
Backup should include milliseconds to avoid timing issues during tests.
Apr 26, 2018
b1f4255
Merge pull request #94 from blabno/feature/cleanup-support-scripts Cl…
mrosseel Apr 26, 2018
5d0a43f
Bump arquillian-cube-docker version to avoid issue https://github.com…
Apr 26, 2018
ed68b94
Upload backup
Apr 27, 2018
1ff63dd
Retrieve and restore wallet seed #96
Apr 26, 2018
69aa590
Merge pull request #95 from blabno/feature/backup Backup CRUD.
mrosseel Apr 27, 2018
de7c181
Offers are made without account age witness #98
May 7, 2018
3fa1402
Merge pull request #97 from blabno/feature/retrieve-and-restore-walle…
mrosseel May 7, 2018
40277a0
Merge pull request #100 from blabno/bugfix/offers-are-made-without-ac…
mrosseel May 7, 2018
1d4039a
Resolve exception location
mrosseel May 7, 2018
818831b
Protect withdraw endpoint
May 22, 2018
a0bae24
Merge branch 'master' of github.com:mrosseel/bisq-api
mrosseel May 7, 2018
5234880
Rename package io.bisq to networ.bisq.
May 22, 2018
4d0afd8
Merge pull request #103 from blabno/feature/withdraw-endpoint-validat…
mrosseel May 22, 2018
788de40
Merge pull request #104 from blabno/feature/rename-packages Rename pa…
mrosseel May 22, 2018
ee9d806
Core integration
Jul 3, 2018
19a36d5
WIP: core integration
Aug 21, 2018
f26b021
WIP: core integration
Aug 21, 2018
a426dfa
Add gradle files
ManfredKarrer Aug 24, 2018
19444e6
Setup refactorings
ManfredKarrer Aug 24, 2018
4d1039a
HttpApi refactorings
ManfredKarrer Aug 24, 2018
ba8214c
HttpApi refactorings
ManfredKarrer Aug 24, 2018
2dbc6c0
Rename package: network.bisq.api to network.bisq.httpapi
ManfredKarrer Aug 24, 2018
daa5cfd
Remove sub package network from network.bisq
ManfredKarrer Aug 24, 2018
b73c56c
Use Guice constructor injection instead of injector.getInstance
ManfredKarrer Aug 24, 2018
455daa1
Move excetpion classes to excep. package
ManfredKarrer Aug 24, 2018
70d10fb
Refactorings
ManfredKarrer Aug 24, 2018
a842b7d
Move ApiV1 one level up
ManfredKarrer Aug 24, 2018
f434d9d
Use Guice for ApiV1
ManfredKarrer Aug 24, 2018
e139a1b
Refactorings
ManfredKarrer Aug 24, 2018
f921864
Rename bisq.httpapi.service.v1 to bisq.httpapi.service.resources
ManfredKarrer Aug 24, 2018
cafd292
Add comment
ManfredKarrer Aug 24, 2018
75e6216
Refactorings
ManfredKarrer Aug 24, 2018
398eaa8
Remove BisqProxy.getWalletDetails
ManfredKarrer Aug 24, 2018
4aeb5dc
Refactor BisqSetup
ManfredKarrer Aug 25, 2018
4c45070
Refactor BisqProxy
ManfredKarrer Aug 25, 2018
2a78b3c
Move offer specific code to OfferResource
ManfredKarrer Aug 25, 2018
5337827
Refactor OfferResource
ManfredKarrer Aug 25, 2018
533fd5d
Refactor OfferResource, Fix incorrect currency pair
ManfredKarrer Aug 25, 2018
41becc7
Refactor OfferBuilder. Remove code duplication
ManfredKarrer Aug 26, 2018
2ededae
Migrate from maven to gradle
Aug 27, 2018
5417466
Merge pull request #108 from blabno/feature/gradle
mrosseel Aug 28, 2018
57426b0
WIP: core integration
Aug 21, 2018
34c18ca
Manfreds changes
ManfredKarrer Aug 24, 2018
dd2b039
Fix tests
Aug 28, 2018
aeabf93
Add F2F payment account
Aug 29, 2018
40b4841
Static analysis tweaks
Aug 29, 2018
4224c28
HalCash payment account
Aug 29, 2018
fe09c8b
MoneyGram payment account
Aug 29, 2018
91304bc
WeChatPay payment account
Aug 29, 2018
fe4272e
Merge branch 'http-api-with-gradle' into http-api
ManfredKarrer Aug 29, 2018
804c157
Fix wrong currencyCode handling
ManfredKarrer Aug 29, 2018
b7550d8
Use UserThread.execute
ManfredKarrer Aug 29, 2018
a41e259
Change Resource suffix to Endpoint
Aug 30, 2018
92d5350
Rename resources package to endpoint
Aug 30, 2018
780faa4
Revert Manfred changes of build.gradle.
Aug 30, 2018
6c754d2
Change expected maxTradeLimit and restore check of accountAgeWitnessH…
Aug 30, 2018
6616b0f
Change Resource suffix to Endpoint
Aug 30, 2018
e9adb36
Introduce OfferFacade
Aug 31, 2018
d3f0f98
Fix resourcePackage in bisq-api.yml
Aug 31, 2018
1e90b01
Surround all calls in OfferEndpoint with UserThread
Aug 31, 2018
62b04de
Introduce TradeFacade
Aug 31, 2018
f8f722a
Surround all calls in TradeEndpoint with UserThread
Aug 31, 2018
bec938f
Introduce PaymentMethodFacade
Aug 31, 2018
64f2392
Surround all calls in PaymentAccountEndpoint with UserThread
Aug 31, 2018
9bd723e
Introduce WalletFacade and ShutdownFacade
Aug 31, 2018
4dea580
Surround all calls in WalletEndpoint with UserThread
Aug 31, 2018
484ae53
Introduce BackupFacade
Aug 31, 2018
ea5f3d3
Surround all calls in BackupEndpoint with UserThread
Aug 31, 2018
777d9bc
Introduce ArbitratorFacade
Aug 31, 2018
f862496
Surround all calls in ArbitratorEndpoint with UserThread
Aug 31, 2018
474268c
Introduce PreferencesEndpoint
Aug 31, 2018
71fa003
Surround all calls in PreferencesEndpoint with UserThread
Aug 31, 2018
bd59da0
Introduce ClosedTradableEndpoint
Aug 31, 2018
3522058
Surround all calls in ClosedTradableEndpoint with UserThread
Aug 31, 2018
6dc9aaa
Introduce UserEndpoint
Aug 31, 2018
a61aa38
Surround all calls in UserEndpoint with UserThread
Aug 31, 2018
9078307
Introduce NetworkEndpoint
Aug 31, 2018
d32d30d
Surround all calls in NetworkEndpoint with UserThread
Aug 31, 2018
8a0aa67
Remove version method from BisqProxy
Sep 13, 2018
511f1ca
Introduce PriceFeedFacade
Sep 13, 2018
e13e904
Surround all calls in CurrencyEndpoint with UserThread
Sep 13, 2018
3f5004b
Merge pull request #1 from ManfredKarrer/http-api
blabno Sep 13, 2018
fe88c4e
Migration of Manfred's http-api branch against core to the mono repo
mrosseel Sep 13, 2018
3ab0a6f
Migration of Manfred's http-api branch against core to the mono repo
mrosseel Sep 13, 2018
6447a3d
Prepare for monorepo inclusion
Sep 17, 2018
030b243
Merge pull request #107 from blabno/feature/core-integration
mrosseel Sep 18, 2018
64cf68c
merge submodule code from Bernard's branch
mrosseel Sep 18, 2018
3c6f167
added bisq-api on correct branch
mrosseel Sep 18, 2018
3cca384
Migration of Manfred's http-api branch against core to the mono repo
mrosseel Sep 13, 2018
20e63f3
Migration of Manfred's http-api branch against core to the mono repo
mrosseel Sep 13, 2018
19cc7f4
merge submodule code from Bernard's branch
mrosseel Sep 18, 2018
6d52446
added bisq-api on correct branch
mrosseel Sep 18, 2018
ce1c51b
Merge branch 'http-api' of github.com:mrosseel/bisq into http-api
mrosseel Sep 19, 2018
705e360
preparing move from bisq-api to http-api inside of Bisq mono repo
mrosseel Sep 19, 2018
875f908
Merging bisq-api with history into the http-api directory
mrosseel Sep 19, 2018
f5d84fe
remove submodules
mrosseel Sep 19, 2018
d9602be
Fix java10 compatibility for http-api
mrosseel Sep 19, 2018
353acee
Fix stray enter in build.gradle
mrosseel Sep 20, 2018
e049478
Merge remote-tracking branch 'upstream/master' into http-api
mrosseel Sep 28, 2018
272910b
Merge fixes
mrosseel Sep 28, 2018
3b13412
Merge remote-tracking branch 'upstream/master' into http-api
mrosseel Oct 12, 2018
2b882d1
Migrating docker integration tests to Java10, not yet working
mrosseel Oct 12, 2018
c738759
Merge branch 'bisq-master' into mk-http-api
ManfredKarrer Oct 20, 2018
9b5be6f
Add BisqSetupCompleteListener interface
ManfredKarrer Oct 20, 2018
e3e0552
Add HTTP_API_HOST and HTTP_API_PORT options
ManfredKarrer Oct 20, 2018
22b7ba9
Rename getAddressEntriesForAvailableFundsStream
ManfredKarrer Oct 20, 2018
dc469e5
Refactor balanceModel
ManfredKarrer Oct 20, 2018
e6f9d77
Add methods to OfferUtil
ManfredKarrer Oct 20, 2018
0f1e874
Fix imports
ManfredKarrer Oct 20, 2018
118c247
Add TxFeeEstimation class
ManfredKarrer Oct 20, 2018
6d1ae1e
Use OfferUtil.getAcceptedBanks
ManfredKarrer Oct 20, 2018
ea9c221
Use OfferUtil.getExtraDataMap
ManfredKarrer Oct 20, 2018
998dfa7
Use OfferUtil.getAcceptedCountryCodes
ManfredKarrer Oct 20, 2018
063db25
Use OfferUtil.getBankId and getCountryCode
ManfredKarrer Oct 20, 2018
eb89ed2
Add TODOs
ManfredKarrer Oct 20, 2018
6ed70b9
Fix ConcurrentModificationException
ManfredKarrer Oct 21, 2018
a74c656
Add TxFeeEstimation class
ManfredKarrer Oct 21, 2018
495f622
Fix arguments
ManfredKarrer Oct 21, 2018
7f1378a
Merge branch 'prepare-http-api-merge' into mk-http-api
ManfredKarrer Oct 21, 2018
612a2b1
Add getFundsNeededForMaker and getFundsNeededForTaker methods
ManfredKarrer Oct 21, 2018
b954d95
Merge branch 'prepare-http-api-merge' into mk-http-api
ManfredKarrer Oct 21, 2018
b76138d
Apply new TxFeeEstimation class
ManfredKarrer Oct 21, 2018
1f5e7ac
Add TakerUtil
ManfredKarrer Oct 21, 2018
9837ded
Add TakerUtil
ManfredKarrer Oct 21, 2018
92abe5f
Merge branch 'prepare-http-api-merge' into mk-http-api
ManfredKarrer Oct 21, 2018
d5cf4a2
Update imports
ManfredKarrer Oct 21, 2018
ddcb623
Merge branch 'master' into prepare-http-api-merge
ManfredKarrer Oct 22, 2018
44ce9a6
Merge branch 'prepare-http-api-merge' into mk-http-api
ManfredKarrer Oct 22, 2018
f808afd
Merge branch 'move-javafx-dep-to-common' into prepare-http-api-merge
ManfredKarrer Oct 22, 2018
4043d82
Merge branch 'move-javafx-dep-to-common' into mk-http-api
ManfredKarrer Oct 22, 2018
fe13f79
Merge pull request #3 from ManfredKarrer/mk-http-api
mrosseel Oct 23, 2018
2018d6a
Merge branch 'http-api' of github.com:mrosseel/bisq into http-api
mrosseel Oct 23, 2018
ff2b485
Merge branch 'master' into prepare-http-api-merge
ManfredKarrer Oct 23, 2018
ac552f6
Merge branch 'prepare-http-api-merge' into mk-http-api
ManfredKarrer Oct 23, 2018
d5be6be
Merge pull request #4 from ManfredKarrer/mk-http-api
mrosseel Oct 24, 2018
4c6832b
Fix tests of http-api
Oct 24, 2018
872c404
Merge pull request #5 from blabno/fix-tests
mrosseel Oct 24, 2018
f85d896
Tune http-api Dockerfile to speed up development
Oct 24, 2018
27b873e
Merge pull request #6 from blabno/fix-tests
mrosseel Oct 24, 2018
274f808
Experimental feature flag
Oct 29, 2018
0f49373
Speed up container closing after tests
Oct 30, 2018
b9d060e
Fix NullPointerException at CreateMakerFeeTx
Oct 30, 2018
b064418
Merge pull request #7 from blabno/feature/experimental-feature
mrosseel Oct 30, 2018
adba98b
Remove backups from volume before running tests
Nov 2, 2018
4edffc2
Merge pull request #8 from blabno/fix-backup-tests
mrosseel Nov 2, 2018
0db20b2
Merge remote-tracking branch 'upstream/master' into http-api
Dec 3, 2018
f4c4402
Post merge adjustments
Dec 3, 2018
acc5b57
Take offer refactoring
Nov 12, 2018
315a023
Take offer refactoring
Nov 12, 2018
e81d657
Take offer refactoring
Nov 12, 2018
91a3414
WIP
Nov 15, 2018
0262a46
Take offer refactoring
Nov 16, 2018
a6224a3
Take offer refactoring
Nov 19, 2018
e6a28b5
Take offer refactoring to CompletableFuture
Nov 22, 2018
73be02a
Move maker and taker validation to TradeManager
Nov 22, 2018
d9938cb
Test for both offer directions
Nov 22, 2018
4cff362
Fix OfferEndpointIT
Dec 5, 2018
853f2a1
Take offer refactoring move code from OfferFacade to TradeManager
Dec 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Take offer refactoring
Assert error property is not set on the trade
  • Loading branch information
Bernard Labno committed Dec 5, 2018
commit e81d657416fc05a3d2fbac13326b97f7dadb79be
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/trade/TradeManager.java
Original file line number Diff line number Diff line change
@@ -450,7 +450,7 @@ public void onTakeOffer(Coin amount,
model,
tradeResultHandler);
},
errorMessageHandler::handleErrorMessage);
errorMessageHandler);
}

private void createTrade(Coin amount,
8 changes: 6 additions & 2 deletions core/src/test/java/bisq/core/trade/TradeManagerTest.java
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@
import java.util.List;
import java.util.Map;

import org.junit.Assert;
import org.junit.Test;

import static org.mockito.ArgumentMatchers.any;
@@ -115,11 +116,14 @@ public void onTakeOffer_firstAttemptToWriteATest() throws Exception {
}).when(offer).checkOfferAvailability(any(), any(), any());

// When
doAnswer(invocation -> null).when(tradeResultHandlerMock).handleResult(any());
doAnswer(invocation -> {
Assert.assertNull("Trade should not have error property set", ((Trade) invocation.getArgument(0)).getErrorMessage());
return null;
}).when(tradeResultHandlerMock).handleResult(any());
tradeManager.onTakeOffer(amount, txFee, takerFee, true, 1, fundsNeededForTrade, offer, paymentAccountId, false, tradeResultHandlerMock, errorMessageHandlerMock);

// Then
verify(errorMessageHandlerMock, never()).handleErrorMessage(any());
verifyNoMoreInteractions(errorMessageHandlerMock);
// TODO what properties should the trade have?
verify(tradeResultHandlerMock).handleResult(any(Trade.class));
// TODO what should happen as the result of onTakeOffer call? What mocks should be called?