Commit Graph

11170 Commits

Author SHA1 Message Date
Stan
9db9ee2906
Merge pull request #2 from dmos62/Z-getfundingaddresses-patch
Refactor getFundingAddresses to use memoization
2020-06-18 11:08:39 -03:00
Dominykas Mostauskis
c5134e14c2
Replace Tuple3 with memoization 2020-06-18 15:57:26 +02:00
ghubstan
258d1801d2
Factor duplicate unlocked wallet checks into new method
Response to comment in PR 4299:
https://github.com/bisq-network/bisq/pull/4299#discussion_r440769032

This PR should be reviewed/merged after PR 4309.
https://github.com/bisq-network/bisq/pull/4309
2020-06-16 12:48:41 -03:00
ghubstan
bac3ed5697
Call core wallets service methods from CoreApi
This change is a refactoring of the gRPC Wallets service
for the purpose of making CoreApi the entry point to
all core implementations.  These changes should have been
made in PR 4295.
See https://github.com/bisq-network/bisq/pull/4295

The gRPC Wallet proto def name was changed to Wallets because
this service manages BSQ and BTC wallets, and GrpcWalletService
was changed to GrpcWalletsService for the same reason.

This PR should be reviewed/merged after PR 4308.
See https://github.com/bisq-network/bisq/pull/4308

This PR's branch was created from the PR 4308 branch.
2020-06-15 16:43:26 -03:00
ghubstan
a7542e98bf
Add rpc method 'createpaymentacct'
This addresses task 4 in issue 4257.
    https://github.com/bisq-network/bisq/issues/4257

This PR should be reviewed/merged after PR 4304.
    https://github.com/bisq-network/bisq/pull/4304

This new gRPC PaymentAccounts service method creates a dummy
PerfectMoney payment account for the given name, number and fiat
currency code, as part of the required "simplest possible trading
API" (for demo).   An implementation supporting all payment
methods is not in the scope.

Changes specific to the new rpc method implementation follow:

* New createpaymentacct method + help text was added to CliMain.
  Help text formatting was also changed to make room for larger
  method names and argument lists.

* The PaymentAccount proto service def was renamed PaymentAccounts
  to avoid a name collision, and the new rpc CreatePaymentAccount
  was made part of the newly named PaymentAccounts service def.

* New GrpcPaymentAccountsService (gRPC boilerplate) and
  CorePaymentAccountsService (method implementations) classes were
  added.

* The gRPC GetPaymentAccountsService stub was moved from GrpcServer
  to the new GrpcPaymentAccountsService class, and
  GrpcPaymentAccountsService is injected into GrpcServer.

* A new createpaymentacct unit test was added to the bats test
  suite (checks for successful return status code).

Maybe bit out of scope, some small changes were made towards making
sure the entire API is defined in CoreApi, which is used as a
pass-through object to the new CorePaymentAccountsService.  In the
next PR, similar refactoring will be done to make CoreApi the
pass-through object for all of the existing CoreWalletsService
methods.  (CoreWalletsService will be injected into CoreApi.)
In the future, all Grpc*Service implementations will call core
services through CoreApi, for the sake of consistency.
2020-06-15 14:32:14 -03:00
ghubstan
b1228e5ea7
Add rpc method 'getaddressbalance'
This addresses task 2 in issue 4257
	https://github.com/bisq-network/bisq/issues/4257

This new gRPC Wallet service method displays the balance and number
of confimirmations of the most recent transaction for the given BTC
wallet address.

The new method required the usual boilerplate changes to grpc.proto,
CliMain, and GrpcWalletService.

Two unit tests to check error msgs was added to cli/test.sh.
2020-06-14 14:23:47 -03:00
ghubstan
2e415de4ad
Replace duplicate code in getFundingAddresses
Cleaned up the method body and improved the returned string's
formatting.  Also added a line for this method in the CLI help text.
2020-06-14 13:05:37 -03:00
ghubstan
85c96764fb
Add rpc method 'getfundingaddresses'
This addresses task #1 in issue https://github.com/bisq-network/bisq/issues/4257.

This new gRPC WalletService method displays the BTC wallet's list of
receiving addresses.  The balance and number of confirmations
for the most recent transaction is displayed to the right of each
address.  Instead of returning a gRPC data structure to the client,
the service method returns a formatted String.

If the BTC wallet has no unused addresses, one will be created and
included in the returned list, and it can be used to fund the wallet.

The new method required injection of the BtcWalletService into CoreWalletsService,
and the usual boilerplate changes to grpc.proto, CliMain, and GrpcWalletService.

Some of the next PRs (for #4257) will require some common functionality within
CoreWalletsService, so these additional changes were included:

  * a private, class level formatSatoshis function
  * a public getNumConfirmationsForMostRecentTransaction method
  * a public getAddressBalance method
  * a private getAddressEntry method

A unit test that verifies a successful return status was added to cli/test.sh.
2020-06-13 19:59:45 -03:00
ghubstan
ec66b14986
Add rpc wallet(s) protection tests
This commit includes the following changes:

 * New tests for methods `lockwallet`, `unlockwallet`,
   `removewalletpassword`, and `setwalletpassword`.

 * New `getbalance` method error handing tests to verify
   error message correctness when wallet is locked.

 * Update to `getversion` method test -- now expects `1.3.4`.

 * Check for new `[params]` column header in help text.
2020-06-12 15:56:19 -03:00
ghubstan
b1146fdd12
Rename CoreWalletService -> CoreWalletsService
This change fixes the ambiguity in the original class name, which
implied it was a btc wallet service, not a bsq and btc wallets service.
2020-06-12 15:24:01 -03:00
sqrrm
7e0c82a791
Merge pull request #4153 from eboukamza/add-blockchain-explorer
Add blockchair mainnet and testnet explorers
2020-06-11 10:53:52 +02:00
sqrrm
94e110d307
Merge pull request #4290 from ripcurlx/update-data-stores-after-shutdown
Update data stores for v1.3.5
2020-06-11 10:27:26 +02:00
Christoph Atteneder
10d6b35cc5
Update data stores for v1.3.5 2020-06-10 16:40:23 +02:00
Christoph Atteneder
6d7fcc178b
Update bitcoinj checkpoints 2020-06-10 16:26:56 +02:00
sqrrm
2ebe7b8959
Merge pull request #4285 from wiz/update-wiz-bitcoin-nodes
Update IPs and onions for wiz Bitcoin nodes
2020-06-07 11:05:30 +02:00
wiz
dbc4574ea3
Update IPs and onions for wiz Bitcoin nodes 2020-06-07 17:04:11 +09:00
Christoph Atteneder
04872e03ee
Merge pull request #4281 from sqrrm/bond-comparator
Add proper comparators to BondsView
2020-06-04 13:51:44 +02:00
Christoph Atteneder
4a832b4c59
Merge pull request #4236 from sqrrm/sign-pob-layout
Improve proof of burn layout
2020-06-04 13:44:02 +02:00
sqrrm
b9d853c499
Merge pull request #4282 from mrosseel/patch-1
Add Readme section on updating a pricenode
2020-06-04 13:17:53 +02:00
sqrrm
06d6953a22
Merge pull request #4230 from cd2357/table-rows-alternate-colors
More readable tables and lists: Alternate row background colors
2020-06-04 13:12:09 +02:00
sqrrm
bd39f05859
Merge pull request #4195 from jmacxx/fix_getsupport_traderchat
Fix Trader Chat row selection and unread message count
2020-06-04 13:09:48 +02:00
sqrrm
1a62f6b8b8
Merge pull request #4193 from jmacxx/add_paymentmethod_openoffers
Display "Payment Method" column in Open Offers view
2020-06-04 12:32:06 +02:00
mrosseel
54cfc7b563
add commands to update the pricenode 2020-06-04 10:53:21 +02:00
sqrrm
50042fa249
Add proper comparators to BondsView 2020-06-03 16:48:52 +02:00
sqrrm
bc3e12288d
Merge pull request #4250 from dmos62/bugfixes-related-to-switch-statements
Bugfixes related to switch statements
2020-05-26 12:55:35 +02:00
sqrrm
4a5d8289b3
Merge pull request #4263 from petrhejna/fix-open-when-already-openned-tab
Opening a take/create offers closes previously openned tab
2020-05-25 16:28:38 +02:00
sqrrm
481ae230e7
Merge pull request #4260 from jmacxx/fix_withdraw_trade
Fix trade withdraw to external wallet step 4
2020-05-25 16:20:41 +02:00
sqrrm
666571347b
Merge pull request #4259 from dmos62/offerbook-secondary-sort-order-refactor
Secondary sort order for offer book (rewrite)
2020-05-25 16:04:46 +02:00
sqrrm
07fc648629
Merge pull request #4253 from jmacxx/fix_validation_address_fields
Fix address validation for whitespace after comma
2020-05-25 15:58:26 +02:00
sqrrm
799d48e74a
Merge pull request #4256 from jmacxx/fix_trade_fees_export
Display correct trade and tx fees in CSV export
2020-05-25 15:46:53 +02:00
sqrrm
a1ec59f36f
Merge pull request #4247 from cd2357/feeservice-support-multiple-endpoints
Extend FeeRateService to support multiple API endpoints
2020-05-25 15:24:59 +02:00
sqrrm
4a6dd93393
Merge pull request #4246 from wiz/increase-bsq-explorer-tmpfs-size
Increase BSQ explorer TMPFS allocation to 2GB for growing datastore
2020-05-25 15:19:45 +02:00
sqrrm
23083840b1
Merge pull request #4239 from cd2357/add-link-to-contributors-docu-commit-msg-checks
Extend CONTRIBUTING.md with info on IDEA settings
2020-05-25 14:59:52 +02:00
Dominykas Mostauskis
3dc13b6eff
Fix reversed ordering in altcoin market 2020-05-25 11:37:30 +02:00
sqrrm
8bffcd62be
Merge pull request #4229 from petrhejna/1387-add-memo-field
Add memo field to withdrawal transaction
2020-05-19 17:05:46 +02:00
Chris Beams
2e33c2c87a
Merge pull request #4214 from ghubstan/rpc-wallet-protection
Add rpc wallet protection endpoints
2020-05-18 14:18:05 +02:00
Chris Beams
7f05f379ab
Remove unused import
This should have been done in commit c7a6c87b.
2020-05-18 14:11:50 +02:00
Chris Beams
d53cc38fde
Wrap comments at 90 chars
Per https://github.com/bisq-network/style/issues/5
2020-05-18 14:08:35 +02:00
Petr Hejna
4c8e89eaa7
Opening a take/create offers closes previously openned tab 2020-05-16 19:09:51 +02:00
sqrrm
2bd4f1a709
Merge pull request #4258 from jmacxx/fix_stale_qrcode_display
Prevent transient negative missingCoin amount sent to QRCode display
2020-05-16 12:52:55 +02:00
Petr Hejna
5352d9b44e
Fix lcode style 2020-05-15 23:17:46 +02:00
Petr Hejna
fbefb9db8e
Better working for memo text 2020-05-15 23:16:18 +02:00
Petr Hejna
335290e464
Revert uneedech whilechars changes 2020-05-15 23:16:18 +02:00
Petr Hejna
e27df8f16a
Remove unnecesary protobuf Transaction (memo is alreay in bitcoinj Transaction object) 2020-05-15 23:16:18 +02:00
Petr Hejna
8d5f42f122
Add memo field to withdrawal transaction
- "Memo" field is modeled as property of the new object Transaction which is stored in persitant storage.
- Transaction object is modeled in a way that allows extension in the furure for more persisted attributes.
2020-05-15 23:16:17 +02:00
Dominykas Mostauskis
2b797dafed
Secondary sort order for offer book
A rewrite of @freimair's PR
https://github.com/bisq-network/bisq/pull/4168.

Adds a secondary sort order of offers in market offer book by offer
amount that goes from high to low. Also, refactors-away overcomplicated
previous implementation of primary sort.

Co-authored-by: Florian Reimair <office@florianreimair.at>
Co-authored-by: cd2357 <15956136+cd2357@users.noreply.github.com>
2020-05-15 19:15:17 +02:00
jmacxx
ea8657e8e0
Fix trade withdraw to external wallet step 4
The routine `cleanUpAddressEntries` in TradeManager was prematurely
releasing funds associated with trades when they reach the last
step of the process (Step 4, Withdraw to External Wallet).
Usually, with a single trade active this would not be an issue
because `cleanUpAddressEntries` is called after the withdrawal,
but if you have more than one trade at Step 4 then the first
withdrawal would go though, but all the others would fail with
an error box "Missing x.xxx BTC" (the trade proceeds or deposit
amount).  Alternatively, if you restart the bisq app with a
trade in Step 4, the same cleanup will occur and the attempt
to withdraw to external wallet will fail.
The change here considers any trade held by the TradeManager to
be in use and therefore will not have their associated address
entries freed up.  After Step 4 has passed, the trade is no
longer held by the TradeManager, and so cleanUpAddressEntries
will at that point free up the address.
2020-05-15 12:07:59 -05:00
jmacxx
d516ba4a59
Display payment method column in Open Offers view
Adjust widths of existing columns to fit in a column for payment method.
Fixes #3902
Fixes #4125
2020-05-15 09:06:48 -05:00
jmacxx
69e46b7025
Prevent transient negative missingCoin amount sent to QRCode display
In bisq-network/bisq/pull/4223 a fix was made to the QRCode display
of amount needed to fund an offer.  This accidentally introduced a
bug whereby if the user overpaid the funding, then the QRCode would
throw an error `Coin must be positive`.  This is due to a race
condition in OfferDataModel which was setting a property first
to a negative amount before checking if it was negative and if so
then setting it to zero.  The fix here is to check for negative
before setting the property so that any listeners do not get an
event (negative) followed by another event (zero).
2020-05-14 20:24:17 -05:00
ghubstan
9178ad7a31
Fix unlockwallet timeout override bug
The CoreWalletService should never be running more than one wallet lock
TimerTask at any given time, and the wallet should lock at the correct time
after a user overrides a prior timeout value.

The CoreWalletService now cancels any existing lock TimerTask thread
before creating a new one, to prevent the wallet from re-locking at
unexpected times.

This change prevents error conditions created in scenarios similar to
the following:

  (1)  User unlocks wallet for 60s
  (2)  User overrides unlock timeout by calling unlockwallet "pwd" 600s
  (3)  After 60s, the 1st, uncanceled lock timeout expires, and wallet is
       locked 4 minutes too soon.
2020-05-13 12:30:39 -03:00