-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Implement and test new getbalance(s) api methods #4799
Conversation
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.
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.
This change adds a proto to support a future api implementation for getting an unused, bsq funding address.
This change adds the proto to support a future api implementation for transfering bsq.
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.
- 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.
- 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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Will merge after 1.5.0 is merged to master
@Order(4) | ||
public void testBalancesAfterSendingBsqAndGeneratingBtcBlock(final TestInfo testInfo) { | ||
// There is a wallet persist delay; we have to | ||
// wait for both wallets to be saved to disk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Persistence has had some changes to increase the persist frequency, might not need to wait this long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed significant improvement while testing the api on top of v1.5.0. I'll be checking what wait times I can reduce in apitest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I could not reduce that wait time without the test failing. There may be other wait times that can be reduced, like waiting for app startup & shutdown, but not this one.
Added three new methods to CLI:
getbalances
returns complete bsq and btc balance infogetbsqbalance
returns complete bsq balance infogetbtcbalance
returns complete btc balance infoThe 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 newBtcWalletTest
andWalletBalancesTest
.Added disabled test methods for funding a bsq wallet (todo in next PR).
This is the 7th in a chain of PRs beginning with #4793.
PR #4798 should be reviewed before this one.