-
Notifications
You must be signed in to change notification settings - Fork 47
account: improve account onchain transaction labels #396
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
Conversation
25c02f1 to
f5d3203
Compare
450451a to
645daf6
Compare
guggero
left a comment
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.
Looks pretty good, I like the new label format!
I'm wondering if we should also start writing the same account modification data into the database alongside the accounts to make retrieval even easier and independent of lnd's label database (re-scanning the wallet can drop the labels, which users do sometimes).
Then we kind of have redundant information, but the new label is also just nice for the user to see what happened, so I don't think it's overkill.
71a3a35 to
758c156
Compare
guggero
left a comment
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.
Very nice work, looks very good!
Just a few comments about error handling and nits, nothing major 🎉
758c156 to
df2f6a3
Compare
positiveblue
left a comment
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.
LGTM 💯
df2f6a3 to
7d8bc1b
Compare
This commit reformulates transaction labels as JSON strings. The JSON contains the following fields: * An `action` field which takes one of the following values: create, deposit, withdraw, renew, or close. * `key` which is the account key. * `expiry_height` which is an integer block height at which the account expires. This value is important to ease the process of account recovery. * `output_index` which is an integer denoting the account balance transaction output. * `expiry_spend` which is a boolean denoting whether the transaction spends via the expiry output path. * `tx_fee` which is the onchain transaction fee for executing the account action. * `balance_diff` which is a signed integer denoting the difference (+/-) in the account balance as a result of the transaction. The poold specific transaction label prefix tag is also modified such that its prefixes spaces are removed.
7d8bc1b to
d76f0f1
Compare
guggero
left a comment
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.
Getting very close here! Only a few nits remaining 🎉
|
prematurely merged, follow up PR to continue improvements and reference this PR |
Keep prefix tag, but drop the leading space:
poold --. Faraday looks for this tag.Label structure:
{ "account":{ "action": "<action>", "key": "<string>", "expiry_height": <int>, "output_index": <int>, "expiry_spend": <bool>, "tx_fee": <int>, "balance_diff": <int>, } }The
actionfield takes one of the following values:createdepositwithdrawrenewclosekeyis the account key.expiry_heightis an integer block height at which the account expires. This value is important to ease the process of account recovery, see here.output_indexis an integer denoting the account balance transaction output.expiry_spendis a boolean denoting whether the transaction spends via the expiry output path.tx_feeis the onchain transaction fee for executing the account action.balance_diffis a signed integer denoting the difference (+/-) in the account balance as a result of the transaction.Here's a full minimized example (211 characters):
Pull Request Checklist
used.