This change sets the WalletsManager key the first time `unlockwallet` is called.
This is necessary because the key cannot be set during api daemon startup, as it
normally is at UI startup. See commit eb15fda229.
Running the UI's walletPasswordHandler during wallet initialization will fail
and block wallet initialization. This change ensures an encrypted wallet
does not trigger a walletPasswordHandler.run() if isApiUser=true during startup.
Push back the (2nd) DAO hard fork activation block height to 680300,
which is 4 weeks after the planned 1.6.0 release around 2021/03/25.
(Also push back the testnet block activation height to 1943000 - 2 weeks
from now assuming an average block time of 10 minutes.)
This change uses recently added walletService.isAddressUnused to ensure
the api's CoreWalletsService creates an unused address if none exists.
- grpc.proto: Add bool isAddressUnused field to message AddressBalanceInfo.
- AddressBalanceInfo: Adjust AddressBalanceInfo proto wrapper.
- CoreWalletsService: Use walletService.isAddressUnused in getFundingAddresses.
- GrpcClient: Adjust to modified AddressBalanceInfo.
- TableFormat, ColumnHeaderConstants: Add 'Is Used' column to getfundingaddresses output.
Note: bugfix is out of scope for this PR, but the test case helped expose this bug.
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.
- Add description msg TakeOfferReply proto, and fromProto method
to core.offer.enum AvailabilityResult. The description field
maps a client usable error message to the enum.
- Adjust GrpcErrorMessageHandler to add AvailabilityResult.description()
to takeoffer reply.
- Refactor (split up) GrpcClient's takeOffer. Add getTakeOfferReply()
to give clients a chance to make choices based on the reply's
AvailabilityResult when the takeoffer command did not result in a
trade. (Some errors are fatal, some not.)
- GrpcErrorMessageHandler A new ErrorMessageHandler implementation
to get around the api specific problem of having to use Task
ErrorMessageHandlers that build task error messages for the UI.
- GrpcExceptionHandler A new method for working with the
ErrorMessageHandler interface.
- GrpcTradesService, CoreApi, CoreTradesService: Ajdusted takeoffer
error handling to give a failure reason provided by the new
GrpcErrorMessageHandler.
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.