Commit Graph

121 Commits

Author SHA1 Message Date
ghubstan
9942529448
Remove redundant DisputeAgentType enum
Use existing SupportType enum instead, and map the valid api
'registerdisputeagent' method's dispute-agent-type parameter
names to SupportType.
2020-10-03 15:42:27 -03:00
ghubstan
d3d6d98666
Revert all changes since commit d55114e
Revert Task.java back to the state it was in prior to
my attempts to make it work for passing error msgs to a
gRPC CLI running 'placeoffer'.  Adjust the affected test
accordingly.
2020-10-03 11:55:58 -03:00
ghubstan
631c3f4f12
Log provenance of Task error on server, but pass only exception msg to clients
Adjusted create offer validation test
2020-10-02 15:02:37 -03:00
ghubstan
fc94b97a00
Throw exception to CLI if attempted offer placement fails 2020-09-28 18:11:08 -03:00
ghubstan
fa5c21c0b2
Fix BitcoinCli wrapper create bug 2020-09-28 14:30:30 -03:00
ghubstan
94996a5e25
Fix tx result handling in GrpcOffersService
Separates offer placement from offer creation to fix tx result
handling problem in GrpcOffersService, and readies the core api
for a new CLI 'placeoffer' implementation.  Offer placement still
happens in the api's 'createoffer', but we may want to change it
to show the created offer to a CLI user for review, prior to manual
placement via a new 'placeoffer offer-id' (of 'confirmoffer offer-id'?)
api method.
2020-09-28 11:48:56 -03:00
ghubstan
70531693f0
Fix asserts 2020-09-27 17:02:38 -03:00
ghubstan
35a77be7e4
Redefine DisputeAgentType REFUNDAGENT as REFUND_AGENT
The CLI needs to be able to register a REFUND_AGENT using the
'refund_agent' or 'refundagent' parameter value (in any case),
so an alt-name mapping was added to the enum def.
2020-09-27 15:23:19 -03:00
ghubstan
96abda4e2d
Tidy up create offer using mkt price margin % test 2020-09-26 13:40:10 -03:00
ghubstan
18df1e2fd4
Fix abs(dbl) comparison 2020-09-25 20:53:45 -03:00
ghubstan
2f3e3a31e1
Add simple mkt-price service & test calculated offer prices
A gRPC price service was added, and api create-offer tests can check
mkt based price margin calculations.
2020-09-25 20:48:26 -03:00
ghubstan
6cf9bbbaa9
Minor createoffer test changes 2020-09-25 13:58:32 -03:00
ghubstan
6cdbc137c1
Move 'createoffer' price arg transform to server & test it
The CreateOfferRequest's price field type was changed from long to string,
so a CLI param like 10000.0055 can be passed to the server as is, to be
scaled and converted there.  In general, we want to keep validation logic
on the CLI as simple as possible, and use existing core logic to
validate args and convert arg types when needed.
2020-09-24 18:13:19 -03:00
ghubstan
9999c95a9e
Change 'createoffer' argument order
And list the args in CLI --help outout.
2020-09-24 13:48:50 -03:00
ghubstan
ec9c1b0f10
Uppercase direction & ccy-code CLI arguments in core
Don't convert parameter case in CLI.
2020-09-24 09:18:13 -03:00
ghubstan
d190d09e2b
Fix unnecessary use of fully qualified name 2020-09-22 22:58:32 -03:00
ghubstan
fc1f0bac60
Fix imports 2020-09-22 22:56:08 -03:00
ghubstan
70e3be0032
Add API CreateOfferTest case 2020-09-22 22:16:55 -03:00
ghubstan
92f36ed03a
Add get default payment acct helper 2020-09-22 22:08:01 -03:00
ghubstan
c4dd041d97
Don't use static boilerplate helpers if not necessary 2020-09-22 18:20:23 -03:00
ghubstan
1d88d27330
Remove final modifiers 2020-09-22 18:11:55 -03:00
ghubstan
6a5040228e
Add simple create payment acct test
And make test dispute agent registration work from static fixture
setup methods.
2020-09-22 18:05:09 -03:00
ghubstan
8896372a0f
Move test dispute agent type constants to core
The string constants deleted from the test case are re-defined as enums,
but the test harness still passes around strings (enum.name()) because
the handling of invalid dispute agent type string args needs to be
tested.  (Reminder:  CLI does not accept any enum arguments.)
2020-09-22 15:31:38 -03:00
ghubstan
34cfe9532f
Remove comment 2020-09-22 14:51:31 -03:00
ghubstan
9132722bbf
Replace hardcoded version with Version.java value
Bats version check tests now use a bash script for parsing
the value from the Bisq class file, and these test cases
no longer need to be manually updated.
2020-09-22 14:45:21 -03:00
sqrrm
c814e3b8ed
Merge pull request #4540 from ghubstan/remove-strings
Reduce apitest harness' dependency on string matching
2020-09-22 11:39:32 +02:00
ghubstan
ab282c2c77
Reduce apitest harness' dependency on string matching
- Pass list of supporting app names as enum vararg to scaffold setup.
- Use dispute agent type constants in RegisterDisputeAgentsTest case.
2020-09-19 15:41:12 -03:00
ghubstan
e2bd89f39a
Refactor API & add registerdisputeagent method to CLI
This commit contains most of the changes suggested by @chimp1984 in
his api-suggestions branch.  See
961703ecea

A new 'registerdisputeagent' method was also added to MainCli, finishing
the work to support registration of mediators and refund agents on
arbitration daemons running in regtest mode.  This method cannot be
used to register dispute agents on mainnet;  users will see an error
msg if they try.
2020-09-18 11:33:16 -03:00
ghubstan
3f0394f722
Bump version to 1.3.8 2020-09-14 12:14:37 -03:00
ghubstan
8384dd8004
Add api dispute agent registration test case
This test case checks that mediators and refund agents can be
registered over grpc, but not on mainnet.
2020-09-14 12:13:36 -03:00
ghubstan
148a0f1200
Refactor test cases to use arbitrary grpc stubs
Most test cases send requests to the alicedaemon, but new test cases
will need to be able to send requests to arbitration and bob daemons.
2020-09-14 12:09:04 -03:00
ghubstan
899bea8df5
Replace "localhost" strings with InetAddress.getLoopbackAddress calls 2020-09-14 11:53:02 -03:00
ghubstan
4d12b8f3d3
Allow remote debugging of background Bisq apps
A unique hard coded debug listening port is assigned to the different
Bisq app types in the BisqAppConfig enum, and background Bisq apps
will be started with remote debug options if the scaffold-setup method
is passed an --enableBisqDebugging=true option.

* Added enableBisqDebugging (default=false) option to ApiTestConfig.

* Added remoteDebugPort field to BisqAppConfig enum.

* Added debugOpts field to BisqApp (using BisqAppConfig#remoteDebugPort).

* Appends debugOpts to exported JAVA_OPTS environment variable if present.

* Removed messy quotes from BisqAppConfig enum javaOpts values.

* Removed redundant return statement from BisqApp#shutdown().
2020-08-25 12:59:55 -03:00
ghubstan
b9c1feba9a
Remove redundant ApiTestConfig options
This change removes three options: runArbNodeAsDesktop,
runAliceNodeAsDesktop, and runBobNodeAsDesktop, which should have
been deleted when the supportingApps option was added.  The comma
delimited list of apps passed with the supportingApps option
now determines whether arbitration / bob / alice nodes are started as
desktops or daemons.
2020-08-25 12:35:57 -03:00
ghubstan
cb6166c65f
Remove duplicated grpc stub creation logic
The :apitest GrpcStubs class was removed and recreated in the :cli
subproject, to be used by both :cli and :apitest.  CliMain was changed
to use the new GrpcStubs.
2020-08-25 12:01:29 -03:00
ghubstan
2c803ef811
Move :cli test.sh to :apitest mainnet-test.sh
* The bats test script was moved to the apitest subproject and renamed.

* Version tests were updated for release 1.3.7.

* The duplicated "test getoffers buy eur check return status" was
  replaced by a new "test getoffers sell eur check return status" test.

* The bats dependency was switched to bats-core because development
  has halted on https://github.com/sstephenson/bats/tree/master.
  The new bats repository is
          https://github.com/bats-core/bats-core/tree/master
2020-08-25 11:42:09 -03:00
ghubstan
ac3c6e07f0
Fix setUpScaffold() signature
Adds the missing String[] params to the method signature, so test cases
can pass any needed combination of options to the scaffolding setup
from a @BeforeAll method.
2020-08-25 11:29:27 -03:00
ghubstan
c4023869bf
Remove duplicate CompositeOptionSet class
This commit changes the access modifier on
bisq.common.config.CompositeOptionSet to make
it visible to bisq.apitest.config.ApiTestConfig,
and the duplicate bisq.apitest.config.ApiTestConfig
was deleted from 'apitest'.
2020-08-24 15:29:32 -03:00
ghubstan
1de6239527
Shorten line length < 120 chars 2020-08-24 11:03:26 -03:00
ghubstan
ba8b9ccf54
Put 'empty' comments inside ignored catch blocks
Follow codacy rule against empty blocks.
2020-08-19 11:49:21 -03:00
ghubstan
2ba0ee9d5d
Change access modifer
This commit is for forcing a codacy check.  The previous
change to an .md doc did not force a codacy check.
2020-08-19 11:14:33 -03:00
ghubstan
fa11dab28b
Add punctuation & re-phrase sentence in README
A new commit was needed to force a codacy check after changes were
made to codacy rules.
2020-08-19 11:04:21 -03:00
ghubstan
c3abd4e533
Remove white lines 2020-08-18 10:38:26 -03:00
ghubstan
8b081ad5f2
Update README 2020-08-17 16:18:08 -03:00
ghubstan
af7252ec47
Fix typo 2020-08-17 16:14:37 -03:00
ghubstan
f85ae2bb4d
Explain how to run test cases from Intellij 2020-08-17 16:11:31 -03:00
ghubstan
fc541257ae
Add build / run / test categories docs 2020-08-17 15:57:54 -03:00
ghubstan
12d52e869c
Fix port number typo 2020-08-15 13:22:32 -03:00
ghubstan
e88bdb9f8a
Add regtest-port-conflicts.md doc 2020-08-15 12:46:38 -03:00
ghubstan
72ff4dca2b
Use non-default regtest bitcoind -rpcport
The default bitcoind / bitcoin-cli rpcport option has been changed
from 18443 to 19443, to help avoid rpcport conflicts between apitest's
bitcoind instances and other bitcoind and/or bitcion-qt instances
which are probably using the bitcoin-core default (regtest) rpcport
18443.

However, this commit cannot include other changes for avoiding bind
address:port conflicts between apitest bitcoind instances and other
regtest bitcoin-core instances because bitcoinj's bind port is hardcoded
in RegTestParams.java as 18444.

In order to avoid bitcoin-core regtest mode bind address conflicts,
you must start or restart your bitcoind or bitcoin-qt instance with a
non-default bind port argument, e.g.

	bitcoin-qt -regtest -port=20444
2020-08-15 12:20:25 -03:00