- 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.
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.
If not present, a default BSQ swap account is saved when a User object
is initialized. Use the existing default account in API bsq-swap test
cases, and rename the legacy BSQ payment account fixtures to distinguish
them from the new default 'BSQ Swap' payment account.
This change adds a bisq.properties file to apitest/src/main/resources,
and makes sure it is copied to regtest/dev bisq instances' app data dirs
before they are started. By default it is empty, but can be used to
override default BisqApp options during ad-hoc testing.
The change was necessary because the core's bisq.properties resource is
not copied to test harness bisq instance's regtest data dirs during a normal
build.
Method was added on the false assumption `PaymentAccount#hasMultipleCurrencies()`
would not always return a correct value when a `PaymentAccount` instance is created
via reflection. But `hasMultipleCurrencies()` will work as long as appropriate
PaymentAccount subclasses continue setting their `tradeCurrencies` fields within
their default constructors.
Ad-hoc API testers need to be able to run the test harness without
interference from the production api method call rate meters.
This change overrides and disables most call rate meters when the
test harness is run from the ApiTestMain driver (no jupiter tests).
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.
The test harness is compatible with bitcoin-core 0.19, 0.20, 0.21.
Also removed some unnecessary comments about registering dispute
agents in the test harness because it now happens by default.
- Added CreateBSQOffersTest, TakeBuyBSQOfferTest, TakeSellBSQOfferTest.
The first tests bsq offer creation, the second & third test bsq trade
protocol, and includes bsq payment verification checks.
- Made test dispute agent registration a test harness opt.
It was a test case option, now it happens by default.
- Moved some global test constants into ApiTestConfig.
Adjusted affected test cases.
This new api testcase can run long series' of regtest trades by looping
over modified TakeBuyBTCOfferTest and TakeSellBTCOfferTest cases. The
purpose is to help reproduce problems and isolate bugs Bisq's core and
api layers.
LongRunningTradesTest is not enabled by default; it will not run in a
default test environment (such a Travis CI). Enviornment variable
LONG_RUNNING_TRADES_TEST_ENABLED must exist for the test to run.
The env variable can be set in a bash shell before running the test
case in a shell (using a gradle command), or the environment variable can
be set in an Intellij test launcher's Evironment variables field.
The modifed (short running) TakeBuyBTCOfferTest and TakeSellBTCOfferTest
cases run as before.
Changes include:
- Add static boolean isLongRunningTest to AbstractOfferTest.
- Add looping control Supplier maxTradeStateAndPhaseChecks to AbstractTradeTest.
It uses the isLongRunningTest flag in the superclass to help define the
wait times for trade state/phase changes during short and long running tests.
- Made AbstractTradeTest assert(true, trade.isDepositPublished) conditional upon
isLongRunningTest value. Long running trade test asserts have to be looser due
to increasing latency of wallet, offer and trade operations in the server as the
trade counts increase.
- Overload ApiTestCase#startSupportingApps with additional flag:
startSupportingAppsInDebugMode. Default is false. This makes
starting background apps in debug mode a bit more convenient
and self explanatory.
Make it clear the user needs to enter a two letter country code
in json form's "country" field, not a country name.
The json form's field name was not changed to "countryCode" in
this change for the following reason:
The API's payment account forms are dynamically generated using
reflection, and PaymentAccount class hierarchy @Setter methods
determine which form fields are included or excluded. Reflection
and @Setter methods are also used when reading completed json
forms, to set the field values on a new PaymentAccount instance
before it is persisted.
CountryBasedPaymentAccount subclasses have a country field and a
@Setter, not a countryCode field, hence this shortcut to informing
the user the country field value is a country-code.
Make it clear the user needs to enter a two letter country code
in json form's "country" field, not a country name.
The json form's field name was not changed to "countryCode" in
this change for the following reason:
The API's payment account forms are dynamically generated using
reflection, and PaymentAccount class hierarchy @Setter methods
determine which form fields are included or excluded. Reflection
and @Setter methods are also used when reading completed json
forms, to set the field values on a new PaymentAccount instance
before it is persisted.
CountryBasedPaymentAccount subclasses have a country field and a
@Setter, not a countryCode field, hence this shortcut to informing
the user the country field value is a country-code.
This new api testcase can run long series' of regtest trades by looping
over modified TakeBuyBTCOfferTest and TakeSellBTCOfferTest cases. The
purpose is to help reproduce problems and isolate bugs Bisq's core and
api layers.
LongRunningTradesTest is not enabled by default; it will not run in a
default test environment (such a Travis CI). Enviornment variable
LONG_RUNNING_TRADES_TEST_ENABLED must exist for the test to run.
The env variable can be set in a bash shell before running the test
case in a shell (using a gradle command), or the environment variable can
be set in an Intellij test launcher's Evironment variables field.
The modifed (short running) TakeBuyBTCOfferTest and TakeSellBTCOfferTest
cases run as before.
Changes include:
- Add static boolean isLongRunningTest to AbstractOfferTest.
- Add looping control Supplier maxTradeStateAndPhaseChecks to AbstractTradeTest.
It uses the isLongRunningTest flag in the superclass to help define the
wait times for trade state/phase changes during short and long running tests.
- Made AbstractTradeTest assert(true, trade.isDepositPublished) conditional upon
isLongRunningTest value. Long running trade test asserts have to be looser due
to increasing latency of wallet, offer and trade operations in the server as the
trade counts increase.
- Overload ApiTestCase#startSupportingApps with additional flag:
startSupportingAppsInDebugMode. Default is false. This makes
starting background apps in debug mode a bit more convenient
and self explanatory.
If a new account has a trading currency, assign it as the selected trading currency.
Also fixed a payment acct console formatting issue (left justify the ccy code).
These changes make tradeCurrencies a required twise acct form field.
Addresses issue https://github.com/bisq-network/bisq/issues/5281
- Added comment to PaymentAccountForm about special 'tradeCurrencies' field handling.
- Added support for Transferwise 'tradeCurrencies' to PaymentAccountTypeAdapter.
- Added instance of isTransferwiseAccount check to PaymentAccount.
- Added methods to CurrencyUtil to convert comma delimited code list to TradeCurrency list.
- Added methods to ReflectionUtil for getting fields and methods on class.
- Added required field check to CorePaymentAccountsService.
- Added CreatePaymentAccount test cases.
This change prohibits creation of new offers with incompatible payment
accounts with the api.
- PaymentAccountUtil
Renamed isAnyTakerPaymentAccountValidForOffer -> isAnyPaymentAccountValidForOffer.
Renmaed isTakerPaymentAccountValidForOffer -> isPaymentAccountValidForOffer.
Deleted commented code.
- PaymentAccounts: Adjusted to PaymentAccountUtil method name changes.
- OfferFilter: Adjusted to PaymentAccountUtil method name changes.
- OfferBookViewModelTest: Adjusted to PaymentAccountUtil method name changes.
- Add CoreOffersService#verifyPaymentAccountIsValidForOffer
- ValidateCreateOfferTest, OfferTest: Added test cases.
This change replaces the hard coded strings used as keys in
interceptor rate-metering lookup maps.
Now, the fullMethodName defined in each bisq.proto.grpc.* class'
io.grpc.MethodDescriptor is used, not a hard coded String.
For example, the rate metering lookup key for 'GetBalances',
in 'GrpcWalletsService', is the
fullMethodName = SERVICE_NAME + '/' + "GetBalances",
where SERVICE_NAME = "io.bisq.protobuffer.Wallets".
Also adjusted affected tests, and tidy'd up interceptor logging.
The gRPC interceptor was not using the correct method/ratemeter
map key, and failing to find a rate meter for the server call.
- Fix the rate meter key lookup bug.
- Disable most strict, default call rate meters in tests.
Made an adjustment to the test harness' scaffold setup so an interceptor
testing or disabling config file is always picked up by bob and alice
daemons.
- Set arbitration daemon's registerDisputeAgent rate @ 10/second, so
it does not interfere with the test harness. (There is no pre-existing
arb node appDataDir before that daemon starts.)
Note: The test harness cannot install the custom rate metering file in
an arb daemon's appDataDir before it starts because there is no dao-setup
file for that node type.
TODO: Adjust api simulation scripts to interceptor bug fix.
The offer volume is shown so traders know how much fiat
they are sending or receiving without having to call getoffer.
Changed the 'Fiat Sent' and 'Fiat Received' column headers
to show which fiat is being transfered, e.g., 'EUR Sent',
'EUR Received'.
Adjusted apitest's trade-simulation-utils.sh to the modified
gettrade output.
This is a follow up to PR https://github.com/bisq-network/bisq/pull/5240,
which moved client side gRPC boilerplate to a new, reusable GrpcClient class.
From this change forward, all (including test) client side gRPC request/response
boilerplate should now live in GrpcClient.
The BaseCurrencyNetwork#getDefaultMinFeePerVbyte now returns
15 (sats/byte) since commit b341bb6e89.
This change adjusts the api to the new min tx fee rate by validating
the api's setTxFeeRatePreference param, and throwing an appropirate
exception if the param value is below the minimum. Also adjusted a broken
test, and added a new test to check the appropriate exception is received
from the server.