[bisq-network/bisq] Add rpc method 'createpaymentacct' (#4308)

Stan notifications at github.com
Mon Jun 15 17:49:51 UTC 2020


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" demo. An implementation supporting all payment methods is not in the scope.

Changes specific to the new rpc method implementation are:

* New `createpaymentacct` method + help text was added to `CliMain`.
  Help text format specifiers were also changed to make room for larger method names and longer argument lists.

* The `GetPaymentAccounts` proto service def was renamed `PaymentAccounts` to avoid a name collision in the `grpc.proto` file, 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` boilerplate code 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 `cli/test.sh` (checks for successful return status code).

Maybe bit out of scope...  some small changes were made towards making sure the entire API is accessible from `CoreApi`, which is used in this PR 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 should call core services through `CoreApi` for the sake of consistency.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4308

-- Commit Summary --

  * Rename CoreWalletService -> CoreWalletsService
  * Add rpc wallet(s) protection tests
  * Add rpc method 'getfundingaddresses'
  * Replace duplicate code in getFundingAddresses
  * Add rpc method 'getaddressbalance'
  * Add rpc method 'createpaymentacct'

-- File Changes --

    M cli/src/main/java/bisq/cli/CliMain.java (67)
    M cli/test.sh (116)
    M core/src/main/java/bisq/core/grpc/CoreApi.java (11)
    A core/src/main/java/bisq/core/grpc/CorePaymentAccountsService.java (57)
    R core/src/main/java/bisq/core/grpc/CoreWalletsService.java (112)
    A core/src/main/java/bisq/core/grpc/GrpcPaymentAccountsService.java (46)
    M core/src/main/java/bisq/core/grpc/GrpcServer.java (26)
    M core/src/main/java/bisq/core/grpc/GrpcWalletService.java (50)
    M proto/src/main/proto/grpc.proto (34)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4308.patch
https://github.com/bisq-network/bisq/pull/4308.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4308
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200615/00c4c8ac/attachment.html>


More information about the bisq-github mailing list