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

Adds batched amounts to simplewallet balances #1562

Merged
merged 7 commits into from
Jun 13, 2022

Conversation

darcys22
Copy link
Collaborator

@darcys22 darcys22 commented Jun 1, 2022

This adds detail to the balance command of the CLI wallet to show how
much has been batched for each address and also summarises when the next
payout is.

@darcys22 darcys22 requested a review from jagerman June 1, 2022 07:30
@darcys22 darcys22 force-pushed the wallet2-batching branch 2 times, most recently from 840cd35 to 37f835f Compare June 10, 2022 00:37
src/wallet/wallet2.cpp Outdated Show resolved Hide resolved
src/wallet/wallet2.h Outdated Show resolved Hide resolved
This adds detail to the balance command of the CLI wallet to show how
much has been batched for each address and also summarises when the next
payout is.

It also includes additional fields to get_balance rpc endpoint on the
oxen-wallet-rpc so the user can check on the status of their accrued
funds.
If omitted it looks up the current wallet primary address (which is
usually what we want).
wallet2_api needs to provide a way to to get at this.

Also changed the existing wallet_rpc_server and simplewallet code to use
the new wallet2 method.
This cuts the size of the response by about 75%.
Unlike a vector, if a std::array doesn't exist in the response epee
chokes.  This fixes it to make it silently ignore it (and leave the
array values untouched), which just makes it consistent with what it
does for any other type of field.

This is particularly needed to be able to retrieve service_node_info
with the `service_node_version`, `lokinet_version`, and
`storage_server_version` fields omitted without getting a
deserialization failure from the omission.
E.g.:

    [wallet T6TSSZ (has locked stakes)]: balance
    Currently selected account: [0] Primary account
    Tag: (No tag assigned)
    Balance: 73541.719401728, unlocked balance: 72339.332202963 (23 block(s) to unlock)
    Total staked: 919.987654321, 0.000000000 unlocking
    Pending SN rewards: 49.419920278,  (next payout: block 10433, in about 26 minutes)
@jagerman jagerman merged commit 441270b into oxen-io:dev Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants