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

Refactor BtcWalletService to add tx-fee-rate param to 'sendbsq' #4867

Commits on Nov 13, 2020

  1. Define new grpc bsq/btc balances protos

    This change adds proto serivces and messages to support new api
    implementations for serving bsq, btc or all wallet balances.
    
    - RPC GetBsqBalances will return complete BSQ balance info.
    - Message BsqBalanceInfo is proto returned by rpc GetBsqBalances.
    
    - RPC GetBtcBalances wil return complete BTC balance info.
    - Message BtcBalanceInfo is proto returned by rpc GetBtcBalances.
    
    - RPC GetBalances returns complete BTC and BSQ balance info.
    - Message BalancesInfo is proto returned by rpc GetBalances.
    
    RPC GetBalance remains unchnaged, still returns only the available
    BTC balance.  It may be deprecated and removed in a future PR.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    fc8af8c View commit details
    Browse the repository at this point in the history
  2. Add proto wrappers for serving bsq, btc or all balances

    This change adds proto wrappers for sending bsq, btc, or all balances
    to the CLI.  They will be used in future api method implementations:
    getbsqbalance, getbtcbalance and getbalances.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    faf45ec View commit details
    Browse the repository at this point in the history
  3. Define proto for api method 'getunusedbsqaddress'

    This change adds a proto to support a future api implementation for
    getting an unused, bsq funding address.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    4c03b46 View commit details
    Browse the repository at this point in the history
  4. Define proto fapi method 'sendbsq'

    This change adds the proto to support a future api implementation for
    transfering bsq.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    3e98910 View commit details
    Browse the repository at this point in the history
  5. Add proto fields to support trade fee currency choice

    This change adds proto support for paying maker fees in bsq or btc.
    The implementation will come in a future PR.
    
    - Added makerFeeCurrencyCode field to CreateOfferRequest proto.
    
    - Added isCurrencyForMakerFeeBtc field to OfferInfo proto wrapper.
    
    - Add takerFeeCurrencyCode field to TakeOfferRequest proto.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    9f033ee View commit details
    Browse the repository at this point in the history
  6. Implement and test api method 'getunusedbsqaddress'

    - Added new method to CLI, split some long msg strings into two lines,
      and added a white space after a braceless else statement.
    
    - Added the gRPC server boilerplate.
    
    - Added the core implementation.
    
    - Added a test, and moved method wallet tests into their own package.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    c1c099c View commit details
    Browse the repository at this point in the history
  7. Add teardown to test case

    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    7c2068e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8dc1a74 View commit details
    Browse the repository at this point in the history
  9. Implement and test new getbalance(s) api methods

    - Added three new methods to CLI:
    
          getbalances   ...	returns complete bsq and btc balance info
          getbsqbalance ...	returns complete bsq balance info
          getbtcbalance ...	returns complete btc balance info
    
          The old getbalance method is deprecated and will be removed
          if there is agreement to do that.
    
    - Made the needed changes in the CLI's output formatting classes.
    
    - Added new tests to existing BsqWalletTest, added new BtcWalletTest
      and WalletBalancesTest.
    
    - Added disabled tests for funding a bsq wallet (todo in next PR).
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    208a37b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    7f0f949 View commit details
    Browse the repository at this point in the history
  11. Stub out api method 'sendbsq' in core

    All the boilerplate for this method is included in this change, but
    the implementation in CoreWalletsService#sendBsq is commented out
    until the needed logic to send bsq is refactored out of desktop's
    BsqSendView class -- to be included in the next PR.
    
    - Added new method to CLI.
    
    - Added the gRPC server boilerplate.
    
    - Added the core implementation, commented out.
    
    - Enabled tests.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    0d3b3a6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    dc3274f View commit details
    Browse the repository at this point in the history
  13. Refactor desktop's BsqSendView, share with api

    Moved just enough code out of BsqSendView to avoid desktop/api
    'sendbsq' duplication, at the cost of adding 1 new method to
    BsqSendView.
    
    - Created new BsqTransferModel to hold tx details shared by desktop and api.
    
    - Created new BsqTransferService to send bsq using a BsqTransferModel shared
      by desktop and api.
    
    - Uncommented CoreWalletsService#sendBsq implementation.
    
    - Uncommented sendbsq tests.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    446bd32 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4a90b40 View commit details
    Browse the repository at this point in the history
  15. Support paying trade fees in bsq or btc (api)

    - Add optional makerFeeCurrencyCode argument to CLI's 'createoffer'.
    
    - Add optional takerFeeCurrencyCode argument to CLI's 'takeoffer'.
    
    - Add isCurrencyForMakerFeeBtc field to OfferInfo proto wrapper.
    
    - Pass fee currency argument down to CoreOffersService and CoreTradesService's
      create and take offer methods.
    
    - Add maybeSetFeePaymentCurrencyPreference method to OfferUtil to
      conditionally set the 'payFeeInBtc' preference before creating
      or taking an offer.
    
    - Adjust affected tests.
    ghubstan committed Nov 13, 2020
    Configuration menu
    Copy the full SHA
    722460e View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    8157f8f View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2020

  1. Refactor api getbalance methods.

    This change fixes the recently bloated wallet balances api.  Now there
    is one CLI getbalance [bsq|btc] method that calls a getbalances(currency-code)
    on the server.  The server returns full wallet balance information for
    BSQ, BTC, or both if the CLI's currency argument is absent.
    
    - grpc.proto:  Reduced number of getbalance(s) proto services from
      four to one.
    
    - GrpcWalletsService:  Reduced number of getbalance(s) gRPC service
      boilerplate methods from four to one.
    
    - CoreApi, CoreWalletsService:  Reduced number of getbalance(s) gRPC
      service implementation methods from four to one.
    
    - CliMain:  Reduced number of getbalance(s) commands from four to one.
    
    - BalancesInfo: Changed BsqBalanceInfo & BtcBalanceInfo field names
      to bsq and btc, respectively, to make calling their accessors
      more readable, less verbose.
    
    - BtcBalanceInfo, BsqBalanceInfo: Defined static final EMPTY instances
      as place holders in a BalancesInfo returned by the gRPC server, when
      one or the other balance types is not requested.  Would be nice
      to serve Optional.empty() instead, but protobuf does not support
      it or null.
    
    - Adjusted affected api tests and build doc.
    ghubstan committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    7e9ab22 View commit details
    Browse the repository at this point in the history
  2. Fix typo

    ghubstan committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    187a85f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    34efc04 View commit details
    Browse the repository at this point in the history
  4. Remove unused imports

    ghubstan committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    530a9f9 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2020

  1. Add api method 'getpaymentmethods'

    Returns a list of supported payment method IDs.  This gives CLI users
    the correct payment method id for creating a new payment account.
    
    - Added gRPC service GetPaymentMethods to grpc.proto.
    
    - Added gRPC boilerplate method to GrpcPaymentAccountsService.
    
    - Added implimentation to CoreApi -> CorePaymentAccountsService.
    
    - Refactored PaymentAccountTest hierarchy.
    
    - Add api method to CLI.
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    ec38152 View commit details
    Browse the repository at this point in the history
  2. Avoid codacy issue over use of fully qualified name

    Had to change the getPaymentMethods() names to getPaymentMethodIds() to
    avoid this codacy issue:
    
    "Unnecessary use of fully qualified name 'PaymentMethod.getPaymentMethods'
    due to existing static import 'bisq.core.payment.payload.PaymentMethod.*'"
    
    If 'PaymentMethod.getPaymentMethods' was changed to 'getPaymentMethods',
    a recursive loop would result, ending in an out of stack heap crash.
    
    This renaming of the method on the server is correct, but the CLI's
    'getpaymentmethods' name was not changed.
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    a465261 View commit details
    Browse the repository at this point in the history
  3. Revert "Avoid codacy issue over use of fully qualified name"

    This reverts commit a465261.
    
    The service side method name change is not correct.
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    0046b08 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7a7d5ba View commit details
    Browse the repository at this point in the history
  5. Avoid codacy issue over use of fully qualified name

    Changed the core getPaymentMethods() -> getFiatPaymentMethods() to avoid
    
    "Unnecessary use of fully qualified name 'PaymentMethod.getPaymentMethods'
    due to existing static import 'bisq.core.payment.payload.PaymentMethod.*'"
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    0e0af20 View commit details
    Browse the repository at this point in the history
  6. Make codacy happy again

    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    7d0648a View commit details
    Browse the repository at this point in the history
  7. Add ReflectionUtils to common.util pkg

    This class will aid the api's (create) PaymentAccount json form
    serialization/de-serialization.
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    32ed7ac View commit details
    Browse the repository at this point in the history
  8. Add new (gson) PaymentAccountTypeAdapter to core.api.model

    This class does most of the work of the api's (create) PaymentAccount
    json form serialization/de-serialization.
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    c25deba View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1f84ad0 View commit details
    Browse the repository at this point in the history
  10. Add new PaymentAccountForm to core.api.model

    This class uses the gson PaymentAccountTypeAdapter to generate editable
    json forms for PaymentAccount sub-types, and instantiate PaymentAccount
    instances from edited json forms.
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    32dd727 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8996fa1 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    dc227ec View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    fdb89a2 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    35c1c4e View commit details
    Browse the repository at this point in the history
  15. Replace existing api method 'createpaymentacct' impl

    In the CLI, this method now takes a single argument, the path to a json
    file (a payment account form).  The json text is read from the file
    and sent to the server, where it is serialized to a new PaymentAccount
    instance, saved, and sent back to the CLI as a protobuf.PaymentAccount.
    
    - Modified existing gRPC boilerplate in grpc.proto and GrpcPaymentAccountsService.
    
    - Modified existing method signatures in CoreApi and CorePaymentAccountsService.
    
    - Replaced existing method impl in CorePaymentAccountsService and
      removed dead code.
    
    - Replaced the CLI's existing 'createpaymentacct' method impl.
    
    - Modified existing tests.
    ghubstan committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    08228d0 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    138822e View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2020

  1. Configuration menu
    Copy the full SHA
    cb9a68b View commit details
    Browse the repository at this point in the history
  2. Fix createpaymentacct validation problems

    - Add missing boilerplate error handling to GrpcPaymentAccountsService.
    
    - Edit some PaymentAccountForm & PaymentAccountTypeAdapter exception
      messages that would be passed to CLI;  they should be in the same
      style as existing CLI err msgs.
    ghubstan committed Nov 19, 2020
    Configuration menu
    Copy the full SHA
    ff887eb View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2020

  1. Log server stack traces, pass concise err msgs to CLI

    For exceptions caught in the server, we want to log a reason and a
    full stack trace, then send less verbose exception msgs up to the CLI.
    ghubstan committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    58f1af6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    459b2a9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bb6762a View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2020

  1. Configuration menu
    Copy the full SHA
    636fac9 View commit details
    Browse the repository at this point in the history
  2. Refactor didReadCountryField to set country on MoneyGram acct

    MoneyGram is not a CountryBasedPaymentAccount, but it does
    have a country field.
    ghubstan committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    23bfa2e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    76097fc View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2020

  1. Fix broken tests

    - Change the getbalance tests to just check a sucessful '0' status code.
    
      The api's getbalance method returns full balance info now, not just a
      formatted long.  We still assert the cmd did not fail, but don't check
      the value string.
    
    - Remove obsolete createpaymentacct tests.
    
      This is well tested in apitest, and testing this cmd is unnecesarily
      complex to do in a bats script.
    ghubstan committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    424f948 View commit details
    Browse the repository at this point in the history
  2. Add two new api method tests

    Keeping the bats test simple.  More complex use cases are tested in
    apitest, and we don't want to be trading on mainnet with a bats test.
    
    - Add new getunusedbsqaddress test, assert success return status.
    - Add new getpaymentmethods test, assert success return status.
    ghubstan committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    daeb34b View commit details
    Browse the repository at this point in the history
  3. Fix getbalance out bug in CLI

    Running the bats test exposed a bug that shows BSQ and BTC balance
    info no matter what currency code argument is passed to the server.
    ghubstan committed Nov 22, 2020
    Configuration menu
    Copy the full SHA
    08d5673 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ab5780e View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2020

  1. Configuration menu
    Copy the full SHA
    c885438 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2020

  1. Resolve BsqSendView file conflict

    Restore BsqSendView to version @ commit 48a515b.
    Author: jmacxx
    Date:   Tue Nov 10 19:35:31 2020 -0600
    
        Add encrypted wallet password prompt when sending funds from BSQ wallet
    
        Correct wording of transaction confirmation popup to use 'mining fee'
        instead of 'transaction fee' to make it consistent with wording of
        the BTC confirmation popup.
    ghubstan committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    f50634e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9d863e5 View commit details
    Browse the repository at this point in the history
  3. Add missing newlines to console output statements

    And remove some unecessary single quotes.
    ghubstan committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    baf300a View commit details
    Browse the repository at this point in the history
  4. Implement fromProto

    This is marked unused, but it will be in future tests.
    ghubstan committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    1559288 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8f13b85 View commit details
    Browse the repository at this point in the history
  6. Adjust to changed CoinUtil

    ghubstan committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    5a06e4e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8fd5786 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4464676 View commit details
    Browse the repository at this point in the history
  9. Add protbuf TxFeeRateInfo

    ghubstan committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    9662f26 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    abe7160 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0b0f9f1 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    06eb378 View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2020

  1. Configuration menu
    Copy the full SHA
    965b003 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2020

  1. Refactor BtcWalletService to add tx-fee-rate param to 'sendbsq'

    This change gives an API user the option to transfer bsq with a one off
    tx fee rate, overriding both the network FeeService's tx fee rate,
    and the user preference set in the UI or API.
    
    Use of this optional 'sendbsq' param does not alter any preferences, nor
    does it's existence affect the functionality of the UI.
    
    - Refactored BtcWalletService.
    
    	Renamed completePreparedSendBsqTx -> completePreparedBsqTx.
    
    	Removed the isSendTx parmater in
    	completePreparedBsqTx(Transaction preparedBsqTx, boolean isSendTx),
    
    	Overloaded Transaction completePreparedBsqTx to make it possible
    	for the api to override the txFeePerVbyte via the sendbsq command,
    	instead of having to set preferences.
    	(Added new txFeePerVbyte param.)
    
    - Adjusted BsqSendView, UnlockTxService, LockupTxService to the
      refactored BtcWalletService.  (Removed redundant params, used new
      method name.)
    
    - Added txFeePerVbyte param to BsqTransferService#getBsqTransferModel signature.
    
    - Adjusted GrpcWalletsService, CoreApi, CoreWalletsService, BsqTransferService
      to allow txFeePerVbyte override via sendbsq api method, and wrap a TxInfo
      in the gRPC response.
    
    - Aded new SendBsqRequest param: txFeeRate.
    
    - Added SendBsqReply return value: txInfo.
    
    - Added new 'Transactions' section to grpc.proto, moved existing TxFeeRateInfo
      message def into it, and added new TxInfo message def.
    
    - Added new TxInfo proto wrapper, now returned to CLI from api's sendbsq.
    
    - Adjusted CLI for new sendbsq param and TxInfo return value.
    
    - Adjust affected tests.
    ghubstan committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    6aa7e53 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f47e6d8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0562506 View commit details
    Browse the repository at this point in the history