-
Notifications
You must be signed in to change notification settings - Fork 91
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
[Wallet][RPC] Export basecoin transactions to CSV file #904
[Wallet][RPC] Export basecoin transactions to CSV file #904
Conversation
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
-hardcoding dates in ExportTransactions 2021-0201:00:00 and such seems like a code smell to me
-log print statement to print # extended private masterkey also seems unneccessary and risky?
Sure, I can default the start time to absolute zero instead then. |
5722 in wallet.cpp -> LogPrintf("# extended private masterkey: %s\n\n", EncodeExtKey(masterKey)); but it looks like that code is removed |
Hi Eugene, would you like me to send you a used testnet wallet? 75MB of wallet.dat. (I've had much larger, but this should suffice.) It's also got some millions of RingCT if I remember correctly. I'm moving and cannot maintain this wallet at present. |
Sure, I received a test wallet.dat already, but another one will only help my testing. |
@Rock-N-Troll, typedef enum Currently, everything is exported in the same format as listtransactions. Would it be helpful if the time related fields are converted to human readable format? Do you see any fields that should be added or removed (ie. unnecessary)? |
I have verified this against the listtransactions feature using two test wallets. All the exported data looks good as far as I can tell. I also tested the data range and pipe separated filter features It all works as I expect. |
Do you guys know why the OSX build failed? I don't believe I touched anything related to that error. |
Currently there is an issue with the build process in Github it seems. CaveSpectre is investigating. |
c235394
to
03a6966
Compare
ProblemAdd feature to export wallet transactions to CSV file, similar to the existing listtransactions command Root CauseNew feature SolutionAdded a well tested external CSV library to the project that will make future CSV functionality trivial in the future IssueBounty Payment Address
Unit Testing ResultsCompare exported CSV with output of existing list transactions command. Should be identical except export CSV shows also sent basecoin transactions which were missing in listtransactions. |
Testing on window 10 I noticed the file is overwritten if the filename is not changed on future exports. |
What should it do rather than overwrite? |
|
Sorry I should have been more clear. We will want to include all transaction types. It might be best to split each additional tx type into separate PR. Let's consider this one the base export function with basecoin tx type. |
Yes that sounds good. Exporting more details about the other transaction types will require a deeper dive and we probably want to improve the listtransactions function while we're at it so a separate or makes sense.
…________________________________
From: Code of All Trades ***@***.***>
Sent: Monday, April 19, 2021 8:52:09 PM
To: Veil-Project/veil ***@***.***>
Cc: eugene-so ***@***.***>; Assign ***@***.***>
Subject: Re: [Veil-Project/veil] [Wallet][RPC] csv wallet transactions export (#904)
Sorry I should have been more clear. We will want to include all transaction types. It might be best to split each additional tx type into separate PR. Let's consider this one the base export function with basecoin tx type.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub<#904 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQ7EU4K66VEC2LKFJVLXOZTTJTT5TANCNFSM4ZVMNJ3Q>.
|
What is the status of this review? |
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.
Please squash to 1 commit. Otherwise good to go for basecoin transactions.
ACK 1c9f6f8
1c9f6f8
to
7e49d8e
Compare
Squashed |
@CaveSpectre11 ready for final review. |
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.
Note that there's some other issues that need to be sorted out. For example, listtransactions
don't show send
transactions that I was actually the receiver on:
bv1q7cmcjcazyxger9y9llnqpuhj33pmrn9hl0ny24 | receive | 42000 |
---|---|---|
bv1qmwyp37wm7nfyhrmf3wdkugquwsl8qrq2jku4he | send | 1023 |
bv1qjg9nzaufgurar3muy7nuqkdk4987egm8cwtrh4 | send | 3066 |
bv1qn6nl6djp7fw5vqdmf4zdyqazy9fxc8gmkmwv6c | send | 3623 |
bv1ql7kjjxvq8sd0l23c62kdydehp8a65vjljs2kkd | send | 100000 |
bv1q93799xecdl50tcnh99epx5kwww42rxs4umt75x | send | 30000 |
19cumt48xkv8s3uegtwqr0c59uapfjvscv5y9z3 | send | 4794309.99 |
I'm not quite sure how listtransactions is preventing those "sends", but they are other outputs in the same transaction this wallet received the 42000.
But that can be fixed at a later date.
For now, only the text in the exporttransactions help needs to be addressed.
src/wallet/rpcwallet.cpp
Outdated
if (!IsDeprecatedRPCEnabled("accounts")) { | ||
help_text = "exporttransactions (dummy filename start end categories include_watchonly)\n" | ||
"\nExports transactions between 'start' date and 'end' date matching 'categories' to a CSV file.\n" | ||
"Note: To export from a specified the \"account\", use this RPC with an \"account\" argument and restart\n" | ||
"veild with -deprecatedrpc=accounts\n" |
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.
NIT. It is best to isolate the differences rather than duplicate a lot of code that would make changes needed to be done in multiple places.
e.g.
help_text = "exporttransactions (" + IsDeprecatedRPCEnabled("accounts") ? "\"account\"" : "dummy" + "..."
if (!IsDepreciatedRPCEnabled("accounts")) {
help_text = help_text + "Note: To export from..."
}
help_text = help_text + "<common stuff here>"
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.
7e49d8e - needs to have the help text for exporttransactions tweaked (see above comment)
7e49d8e
to
e11af21
Compare
…to CSV format If additional export information is required in the future, we should revisit CWalletTx::GetAmounts() to see if send/receive info can be better extracted from the wallet.
e11af21
to
d5b00c3
Compare
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.
Noticed the help tag had 'categories' and text had 'filter'. Also took care of the indenting nit (and another one seen)
ACK d5b00c3
New Feature
Add RPC
exporttransactions
to export to a CSV file, similar to the existinglisttransactions
RPC commandSolution
Added a well tested external CSV library to the project that will make future CSV functionality trivial in the future
Added the rpc
exporttransactions
command supporting an output filename; and filtering by account, date range, and/or basic piped separated search stringBounty Payment Address
sv1qqp6aptgvgp9t9h8sgzkqmu6cgq2e20l9x6fsl5ask7t3ygy2jagftcpq0x5z0h522ca5h06qq3hx33pke00r7gjt3j24n896gf55y68ptrmjqqqqd8lz3
Unit Testing Results
Compare exported CSV with output of existing list transactions command. Should be identical except export CSV shows also sent basecoin transactions which were missing in listtransactions.
Known issues