-
Notifications
You must be signed in to change notification settings - Fork 128
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
CSV address data download. #894
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.
I would make time_stamp
a unix epoch time stamp, since it is compact and unambiguous.
The PR description has a little copypasta: tx_type comes from txhelpers.TxTypeToString(txType)
and value from Coin.
I'd also suggest putting direction
either right before or right after matching_tx_hash
, and with io_index
adjacent to matching_tx_hash
too.
I think there's a pretty strong argument for changing /api/download to just /download with a new router, primarily since the content-type is different.
For the download file name, some kind of current time stamp seems appropriate, perhaps with a best block height.
How were the ttf and svg files edited? fontforge and Inkscape? The file size changes are peculiar.
Oh, it looks like a thumbs up and thumbs down glyph were removed from the ttf. |
New header sequence is Server's filename recommendation is New path is re: font file stuff. I guess I can't say for sure, but it looks like the fonts were previously created with IcoMoon, so that's what I used too. IcoMoon generates the 4 font files. Unfortunately, this means that I can't tell you why the decimal precision changes, but it looks like it only affects 3 numbers and not the entire SVG. I think the thumbs up/down icons were extraneous because I can't seem to find a reference to them in the code. Perhaps someone previously pruned the icon set but didn't replace the TTF. @chappjc I didn't change the address validation because I'm pretty sure that it's right, but could you check. |
The address validation is good for sure, I just wanted to call out that there are a lot of non-nil error values that are not unexpected. I wanted to be explicit about my motivation for changing to Debugf from Errorf. |
…hange CSV header order.
…Fix download button path that I botched during rebase.
… getter for Height. Night mode
Resolves #854
Essentially returns rows of the
addresses
table with CSV-formatting and appropriate headers.It is surprisingly fast, even for the treasury address which returns a 46 MB file.
The rows returned are
dcrutil.Amount(value).ToCoin()
TimeDef.String()
YY-MM-DD HH:MM:SS format, but should maybe be either a timestamp or an ISO formatted stringtxhelpers.TxTypeToString(txType)
Potential areas of discussion
transactions
table.apirouter
at the/api/download
path. There may be an argument for creating a new router at/download
instead.One more note. I'm not sure why the binary icon font files got smaller when I added an icon. All of the icons seem to still be there.